soc.2009.transport: f953bf79: Fixed some gcc warnings...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Wed Jun 3 04:15:21 EDT 2009


-----------------------------------------------------------------
Revision: f953bf7976f4a38ccf522bef66329e5ed635bee2
Ancestor: 0b80dc7a5b430754167a85ae15584cfc83d11b33
Author: hanzz at soc.pidgin.im
Date: 2009-06-03T08:12:33
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/f953bf7976f4a38ccf522bef66329e5ed635bee2

Modified files:
        main.cpp protocols/facebook.cpp protocols/gg.cpp
        protocols/icq.cpp striphtmltags.cpp thread.cpp user.cpp
        utf8/checked.h

ChangeLog: 

Fixed some gcc warnings...

-------------- next part --------------
============================================================
--- main.cpp	1d477ddfcbd637e1ed42dcfdacf8310ec359561f
+++ main.cpp	b5fa6afd3406bb39cc4eb9681ca7ff7fb3c0ece6
@@ -173,6 +173,7 @@ static void * requestInput(const char *t
 			}
 		}
 	}
+	return NULL;
 }
 
 static void * requestAction(const char *title, const char *primary,const char *secondary, int default_action,PurpleAccount *account, const char *who,PurpleConversation *conv, void *user_data,size_t action_count, va_list actions){
@@ -180,10 +181,11 @@ static void * requestAction(const char *
 		std::string headerString(title);
 		Log().Get("purple") << "header string: " << headerString;
 		if (headerString=="SSL Certificate Verification"){
-			char * name = va_arg(actions, char *);
+			va_arg(actions, char *);
 			((PurpleRequestActionCb) va_arg(actions, GCallback))(user_data,2);
 		}
 	}
+	return NULL;
 }
 
 static void requestClose(PurpleRequestType type, void *ui_handle) {
@@ -257,6 +259,7 @@ static void * notify_user_info(PurpleCon
 static void * notify_user_info(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info)
 {
 	GlooxMessageHandler::instance()->vcard()->userInfoArrived(gc,(std::string) who,user_info);
+	return NULL;
 }
 
 static void buddyListAddBuddy(PurpleAccount *account, const char *username, const char *group, const char *alias){
@@ -481,7 +484,7 @@ GlooxMessageHandler::GlooxMessageHandler
 //  	j->removeIqHandler(XMLNS_DISCO_INFO);
 	
  	m_discoInfoHandler=new GlooxDiscoInfoHandler(this);
- 	j->registerIqHandler(m_discoInfoHandler,XMLNS_DISCO_INFO);
+ 	j->registerIqHandler(m_discoInfoHandler,ExtDiscoInfo);
 	
 	m_adhoc = new GlooxAdhocHandler(this);
 	
@@ -686,7 +689,6 @@ void GlooxMessageHandler::loadConfigFile
 	GKeyFile *keyfile;
 	int flags;
 	GError *error = NULL;
-	gsize length;
   	char **bind;
 	int i;
 	
@@ -695,7 +697,7 @@ void GlooxMessageHandler::loadConfigFile
 	
 	if (!g_key_file_load_from_file (keyfile, "highflyer.cfg", (GKeyFileFlags)flags, &error))
 	{
-		g_error (error->message);
+// 		g_error (error->message);
 		Log().Get("gloox") << "Can't load highflyer.cfg!!!";
 		return;
 	}
@@ -1070,7 +1072,7 @@ void GlooxMessageHandler::handleMessage 
 				Tag *activity = item->findChild("activity");
 				if (!activity) return;
 				Tag *text = item->findChild("text");
-				if (!activity) return;
+				if (!text) return;
 				std::string message(activity->cdata());
 				if (message.empty()) return;
 
@@ -1112,7 +1114,7 @@ bool GlooxMessageHandler::initPurple(){
 bool GlooxMessageHandler::initPurple(){
 	bool ret;
 	GList *iter;
-	int i, num;
+	int i;
 	GList *names = NULL;
 
 	purple_util_set_user_dir(configuration().userDir.c_str());
============================================================
--- protocols/facebook.cpp	41d9edf22a537bbb7300de6cc56ea6a069f2d912
+++ protocols/facebook.cpp	3eb4d18a879356cdbf7d8946c6e5e4e86f0ee884
@@ -65,7 +65,7 @@ std::string FacebookProtocol::replace(st
 	// Find the first string to replace
 	int index = str.find(string_to_replace);
 	// while there is one
-	while(index != std::string::npos)
+	while(index != (int) std::string::npos)
 	{
 		// Replace it
 		str.replace(index, strlen(string_to_replace), new_string);
============================================================
--- protocols/gg.cpp	327a7f6c2ef739b75f166ca6d7f5831fc8e23e32
+++ protocols/gg.cpp	5d85dad887eafd241042ab941fa07f5ebc0aa689
@@ -47,7 +47,7 @@ std::string GGProtocol::replace(std::str
 	// Find the first string to replace
 	int index = str.find(string_to_replace);
 	// while there is one
-	while(index != std::string::npos)
+	while(index != (int) std::string::npos)
 	{
 		// Replace it
 		str.replace(index, strlen(string_to_replace), new_string);
============================================================
--- protocols/icq.cpp	a01d688223f2151170123c614b9991ebf899962f
+++ protocols/icq.cpp	715dac537bfc443a8774411e0312dc427c4a5e27
@@ -44,7 +44,7 @@ std::string ICQProtocol::replace(std::st
 	// Find the first string to replace
 	int index = str.find(string_to_replace);
 	// while there is one
-	while(index != std::string::npos)
+	while(index != (int) std::string::npos)
 	{
 		// Replace it
 		str.replace(index, strlen(string_to_replace), new_string);
============================================================
--- striphtmltags.cpp	471981079c7772dd80e7027e146a0dfa8d3f0db3
+++ striphtmltags.cpp	af43b195fff333545b21819789a148111b8c3e5e
@@ -32,7 +32,6 @@ std::string& stripHTMLTags(std::string& 
 
 std::string& stripHTMLTags(std::string& s) {
 	static bool inTag = false;
-	bool done = false;
 
 	std::string::iterator input;
 	std::string::iterator output;
============================================================
--- thread.cpp	3c301c57070ce931f656c8665174e84f152728a3
+++ thread.cpp	a165b51620188a7c99b452f877666c58a442cc1b
@@ -53,7 +53,7 @@ void Thread::run() {
 
 void Thread::run() {
 #ifdef HAVE_PTHREADS
-        int status = pthread_create(&m_id, NULL, thread_thread, this);
+        /*int status = */pthread_create(&m_id, NULL, thread_thread, this);
 #elif WIN32
     ResumeThread(m_handle);
 #endif
============================================================
--- user.cpp	fc72a1c7fb4a1445f4ad8078de27f6633a4d704c
+++ user.cpp	56711e102628e26b93f6f67a926331b0b90ace19
@@ -905,6 +905,7 @@ void User::receivedPresence(const Presen
 						PurplePresenceType=PURPLE_STATUS_EXTENDED_AWAY;
 						break;
 					}
+					default: break;
 				}
 				// send presence to our legacy network
 				status = purple_savedstatus_new(NULL, (PurpleStatusPrimitive)PurplePresenceType);
============================================================
--- utf8/checked.h	e5cd8635f2464ed93e0a559c65bd784536e99efa
+++ utf8/checked.h	e1bf78889914017e0f234344c4a4b1290bbc7e52
@@ -117,13 +117,13 @@ namespace utf8
         }
         else if (cp < 0x10000) {              // three octets
             *(result++) = static_cast<uint8_t>((cp >> 12)           | 0xe0);
-            *(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f     | 0x80);
+            *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f)     | 0x80);
             *(result++) = static_cast<uint8_t>((cp & 0x3f)          | 0x80);
         }
         else if (cp <= internal::CODE_POINT_MAX) {      // four octets
             *(result++) = static_cast<uint8_t>((cp >> 18)           | 0xf0);
-            *(result++) = static_cast<uint8_t>((cp >> 12)& 0x3f     | 0x80);
-            *(result++) = static_cast<uint8_t>((cp >> 6) & 0x3f     | 0x80);
+            *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f)     | 0x80);
+            *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f)     | 0x80);
             *(result++) = static_cast<uint8_t>((cp & 0x3f)          | 0x80);
         }
         else


More information about the Commits mailing list