changeset 19412:1096aea98217

merge of '0fc7f6e97f5dab2cfc59a71a0aba499d560220b2' and '9e054d6dc9f395a8e2026e8c6babc6faf51ec4cd'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 25 Aug 2007 01:14:56 +0000
parents b8cbc7659a5a (diff) b80379b1f3c6 (current diff)
children deb9471d7142 4fced00fdc9f
files
diffstat 8 files changed, 44 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/network.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/network.c	Sat Aug 25 01:14:56 2007 +0000
@@ -436,7 +436,7 @@
 static gint
 wpurple_get_connected_network_count(void)
 {
-	guint net_cnt = 0;
+	gint net_cnt = 0;
 
 	WSAQUERYSET qs;
 	HANDLE h;
@@ -521,7 +521,7 @@
 		HANDLE hLookup, DWORD dwControlCode, LPVOID lpvInBuffer,
 		DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer,
 		LPDWORD lpcbBytesReturned, LPWSACOMPLETION lpCompletion) = NULL;
- 
+
 	if (!(MyWSANSPIoctl = (void*) wpurple_find_and_loadproc("ws2_32.dll", "WSANSPIoctl"))) {
 		g_thread_exit(NULL);
 		return NULL;
@@ -636,7 +636,7 @@
 purple_network_get_handle(void)
 {
 	static int handle;
-	
+
 	return &handle;
 }
 
@@ -675,7 +675,7 @@
 
 	purple_signal_register(purple_network_get_handle(), "network-configuration-changed",
 						   purple_marshal_VOID, NULL, 0);
-	
+
 	purple_pmp_init();
 	purple_upnp_init();
 }
--- a/libpurple/protocols/sametime/sametime.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Sat Aug 25 01:14:56 2007 +0000
@@ -3183,13 +3183,12 @@
   PurpleConnection *gc;
   struct mwPurplePluginData *pd;
   struct mwAwareIdBlock t = { mwAware_USER, b->name, NULL };
-  const char *ret;
-
-  gc = b->account->gc;
-  pd = gc->proto_data;
-
-  ret = mwServiceAware_getText(pd->srvc_aware, &t);
-  
+  const char *ret = NULL;
+
+  if ((gc = purple_account_get_connection(b->account))
+      && (pd = gc->proto_data))
+    ret = mwServiceAware_getText(pd->srvc_aware, &t);
+
   return (ret && g_utf8_validate(ret, -1, NULL)) ? g_markup_escape_text(ret, -1): NULL;
 }
 
@@ -3242,17 +3241,17 @@
 
 static void mw_prpl_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) {
   PurpleConnection *gc;
-  struct mwPurplePluginData *pd;
+  struct mwPurplePluginData *pd = NULL;
   struct mwAwareIdBlock idb = { mwAware_USER, b->name, NULL };
 
-  const char *message;
+  const char *message = NULL;
   const char *status;
   char *tmp;
 
-  gc = b->account->gc;
-  pd = gc->proto_data;
-
-  message = mwServiceAware_getText(pd->srvc_aware, &idb);
+  if ((gc = purple_account_get_connection(b->account))
+      && (pd = gc->proto_data))
+     message = mwServiceAware_getText(pd->srvc_aware, &idb);
+
   status = status_text(b);
 
   if(message != NULL && g_utf8_validate(message, -1, NULL) && purple_utf8_strcasecmp(status, message)) {
@@ -3264,7 +3263,7 @@
 	purple_notify_user_info_add_pair(user_info, _("Status"), status);
   }
 
-  if(full) {
+  if(full && pd != NULL) {
     tmp = user_supports_text(pd->srvc_aware, b->name);
     if(tmp) {
 	  purple_notify_user_info_add_pair(user_info, _("Supports"), tmp);
--- a/libpurple/request.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/request.c	Sat Aug 25 01:14:56 2007 +0000
@@ -1172,7 +1172,7 @@
 
 void *
 purple_request_choice(void *handle, const char *title, const char *primary,
-					const char *secondary, unsigned int default_value,
+					const char *secondary, int default_value,
 					const char *ok_text, GCallback ok_cb,
 					const char *cancel_text, GCallback cancel_cb,
 					PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -1197,7 +1197,7 @@
 void *
 purple_request_choice_varg(void *handle, const char *title,
 			 const char *primary, const char *secondary,
-			 unsigned int default_value,
+			 int default_value,
 			 const char *ok_text, GCallback ok_cb,
 			 const char *cancel_text, GCallback cancel_cb,
 			 PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -1233,7 +1233,7 @@
 
 void *
 purple_request_action(void *handle, const char *title, const char *primary,
-					const char *secondary, unsigned int default_action,
+					const char *secondary, int default_action,
 					PurpleAccount *account, const char *who, PurpleConversation *conv,
 					void *user_data, size_t action_count, ...)
 {
@@ -1254,7 +1254,7 @@
 void *
 purple_request_action_varg(void *handle, const char *title,
 						 const char *primary, const char *secondary,
-						 unsigned int default_action,
+						 int default_action,
 						 PurpleAccount *account, const char *who, PurpleConversation *conv,
 						  void *user_data, size_t action_count, va_list actions)
 {
--- a/libpurple/request.h	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/request.h	Sat Aug 25 01:14:56 2007 +0000
@@ -190,13 +190,13 @@
 						   PurpleAccount *account, const char *who, PurpleConversation *conv,
 						   void *user_data);
 	void *(*request_choice)(const char *title, const char *primary,
-							const char *secondary, unsigned int default_value,
+							const char *secondary, int default_value,
 							const char *ok_text, GCallback ok_cb,
 							const char *cancel_text, GCallback cancel_cb,
 							PurpleAccount *account, const char *who, PurpleConversation *conv,
 							void *user_data, va_list choices);
 	void *(*request_action)(const char *title, const char *primary,
-							const char *secondary, unsigned int default_action,
+							const char *secondary, int default_action,
 							PurpleAccount *account, const char *who, PurpleConversation *conv,
 							void *user_data, size_t action_count,
 							va_list actions);
@@ -1215,7 +1215,7 @@
  * @param cancel_cb     The callback for the @c Cancel button.
  * @param account		The PurpleAccount associated with this request, or NULL if none is
  * @param who			The username of the buddy assocaited with this request, or NULL if none is
- * @param conv			The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv			The PurpleConversation associated with this request, or NULL if none is
  * @param user_data     The data to pass to the callback.
  * @param ...           The choices.  This argument list should be
  *                      terminated with a NULL parameter.
@@ -1224,7 +1224,7 @@
  */
 void *purple_request_choice(void *handle, const char *title,
 						  const char *primary, const char *secondary,
-						  unsigned int default_value,
+						  int default_value,
 						  const char *ok_text, GCallback ok_cb,
 						  const char *cancel_text, GCallback cancel_cb,
 						  PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -1246,7 +1246,7 @@
  * @param cancel_cb     The callback for the @c Cancel button.
  * @param account		The PurpleAccount associated with this request, or NULL if none is
  * @param who			The username of the buddy assocaited with this request, or NULL if none is
- * @param conv			The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv			The PurpleConversation associated with this request, or NULL if none is
  * @param user_data     The data to pass to the callback.
  * @param choices       The choices.  This argument list should be
  *                      terminated with a @c NULL parameter.
@@ -1255,7 +1255,7 @@
  */
 void *purple_request_choice_varg(void *handle, const char *title,
 							   const char *primary, const char *secondary,
-							   unsigned int default_value,
+							   int default_value,
 							   const char *ok_text, GCallback ok_cb,
 							   const char *cancel_text, GCallback cancel_cb,
 							   PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -1275,7 +1275,7 @@
  * @param default_action The default value.
  * @param account		 The PurpleAccount associated with this request, or NULL if none is
  * @param who			 The username of the buddy assocaited with this request, or NULL if none is
- * @param conv			 The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv			 The PurpleConversation associated with this request, or NULL if none is
  * @param user_data      The data to pass to the callback.
  * @param action_count   The number of actions.
  * @param ...            A list of actions.  These are pairs of
@@ -1290,7 +1290,7 @@
  */
 void *purple_request_action(void *handle, const char *title,
 						  const char *primary, const char *secondary,
-						  unsigned int default_action,
+						  int default_action,
 						  PurpleAccount *account, const char *who, PurpleConversation *conv,
 						  void *user_data, size_t action_count, ...);
 
@@ -1308,7 +1308,7 @@
  * @param default_action The default value.
  * @param account		 The PurpleAccount associated with this request, or NULL if none is
  * @param who			 The username of the buddy assocaited with this request, or NULL if none is
- * @param conv			 The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv			 The PurpleConversation associated with this request, or NULL if none is
  * @param user_data      The data to pass to the callback.
  * @param action_count   The number of actions.
  * @param actions        A list of actions and callbacks.
@@ -1317,7 +1317,7 @@
  */
 void *purple_request_action_varg(void *handle, const char *title,
 							   const char *primary, const char *secondary,
-							   unsigned int default_action,
+							   int default_action,
 							   PurpleAccount *account, const char *who, PurpleConversation *conv,
 							   void *user_data, size_t action_count,
 							   va_list actions);
@@ -1338,7 +1338,7 @@
  * @param cancel_cb   The callback for the @c Cancel button.
  * @param account	  The PurpleAccount associated with this request, or NULL if none is
  * @param who		  The username of the buddy associated with this request, or NULL if none is
- * @param conv		  The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv		  The PurpleConversation associated with this request, or NULL if none is
  * @param user_data   The data to pass to the callback.
  *
  * @return A UI-specific handle.
@@ -1411,7 +1411,7 @@
  * @param cancel_cb   The callback for the @c Cancel button.
  * @param account	  The PurpleAccount associated with this request, or NULL if none is
  * @param who		  The username of the buddy assocaited with this request, or NULL if none is
- * @param conv		  The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv		  The PurpleConversation associated with this request, or NULL if none is
  * @param user_data   The data to pass to the callback.
  *
  * @return A UI-specific handle.
@@ -1435,7 +1435,7 @@
  * @param cancel_cb   The callback for the @c Cancel button.
  * @param account	  The PurpleAccount associated with this request, or NULL if none is
  * @param who		  The username of the buddy assocaited with this request, or NULL if none is
- * @param conv		  The PurpleConversation associated with this request, or NULL if none is 
+ * @param conv		  The PurpleConversation associated with this request, or NULL if none is
  * @param user_data   The data to pass to the callback.
  *
  * @return A UI-specific handle.
--- a/libpurple/util.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/util.c	Sat Aug 25 01:14:56 2007 +0000
@@ -1374,7 +1374,7 @@
 								g_string_free(cdata, TRUE);
 								cdata = NULL;
 							}
-							
+
 						}
 						if(tags == tag)
 							break;
@@ -1425,7 +1425,7 @@
 				ALLOW_TAG("strong");
 				ALLOW_TAG("ul");
 
-				
+
 				/* we skip <HR> because it's not legal in XHTML-IM.  However,
 				 * we still want to send something sensible, so we put a
 				 * linebreak in its place. <BR> also needs special handling
@@ -2539,7 +2539,7 @@
  * people's settings if there is a problem writing the new values.
  */
 gboolean
-purple_util_write_data_to_file(const char *filename, const char *data, size_t size)
+purple_util_write_data_to_file(const char *filename, const char *data, gssize size)
 {
 	const char *user_dir = purple_user_dir();
 	gchar *filename_temp, *filename_full;
@@ -4305,7 +4305,7 @@
 	}
 }
 
-gboolean purple_message_meify(char *message, size_t len)
+gboolean purple_message_meify(char *message, gssize len)
 {
 	char *c;
 	gboolean inside_html = FALSE;
--- a/libpurple/util.h	Fri Aug 24 22:19:52 2007 +0000
+++ b/libpurple/util.h	Sat Aug 25 01:14:56 2007 +0000
@@ -586,7 +586,7 @@
  * @return TRUE if the file was written successfully.  FALSE otherwise.
  */
 gboolean purple_util_write_data_to_file(const char *filename, const char *data,
-									  size_t size);
+									  gssize size);
 
 /**
  * Read the contents of a given file and parse the results into an
@@ -1113,7 +1113,7 @@
  * @return TRUE if it starts with "/me ", and it has been removed, otherwise
  *         FALSE
  */
-gboolean purple_message_meify(char *message, size_t len);
+gboolean purple_message_meify(char *message, gssize len);
 
 /**
  * Removes the underscore characters from a string used identify the mnemonic
--- a/pidgin/gtkrequest.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/pidgin/gtkrequest.c	Sat Aug 25 01:14:56 2007 +0000
@@ -442,7 +442,7 @@
 
 static void *
 pidgin_request_choice(const char *title, const char *primary,
-			const char *secondary, unsigned int default_value,
+			const char *secondary, int default_value,
 			const char *ok_text, GCallback ok_cb,
 			const char *cancel_text, GCallback cancel_cb,
 			PurpleAccount *account, const char *who, PurpleConversation *conv,
@@ -548,7 +548,7 @@
 
 static void *
 pidgin_request_action(const char *title, const char *primary,
-						const char *secondary, unsigned int default_action,
+						const char *secondary, int default_action,
 					    PurpleAccount *account, const char *who, PurpleConversation *conv,
 						void *user_data, size_t action_count, va_list actions)
 {
@@ -1083,7 +1083,7 @@
 	data->cbs[0] = ok_cb;
 	data->cbs[1] = cancel_cb;
 
-	
+
 #ifdef _WIN32
 	data->dialog = win = pidgin_create_window(PIDGIN_ALERT_TITLE, PIDGIN_HIG_BORDER, "multifield", TRUE) ;
 #else /* !_WIN32 */
--- a/pidgin/plugins/spellchk.c	Fri Aug 24 22:19:52 2007 +0000
+++ b/pidgin/plugins/spellchk.c	Sat Aug 25 01:14:56 2007 +0000
@@ -667,7 +667,7 @@
 	return;
 }
 
-static int buf_get_line(char *ibuf, char **buf, int *position, int len)
+static int buf_get_line(char *ibuf, char **buf, int *position, gsize len)
 {
 	int pos = *position;
 	int spos = pos;