# HG changeset patch # User Daniel Atallah # Date 1187984621 0 # Node ID cc36a5aac908d45a2f4a44a580a43ecb3f049143 # Parent 41417f94afe9b878606c99aa43fdf0fc4a2b3ba8 Fix some conversion warnings about using negative values with unsigned types. There are more, but these were easy fixes. You may think that I'm changing the API, but I'm really not - it was just wrong. diff -r 41417f94afe9 -r cc36a5aac908 libpurple/network.c --- a/libpurple/network.c Fri Aug 24 15:58:46 2007 +0000 +++ b/libpurple/network.c Fri Aug 24 19:43:41 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(); } diff -r 41417f94afe9 -r cc36a5aac908 libpurple/request.c --- a/libpurple/request.c Fri Aug 24 15:58:46 2007 +0000 +++ b/libpurple/request.c Fri Aug 24 19:43:41 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) { diff -r 41417f94afe9 -r cc36a5aac908 libpurple/request.h --- a/libpurple/request.h Fri Aug 24 15:58:46 2007 +0000 +++ b/libpurple/request.h Fri Aug 24 19:43:41 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. diff -r 41417f94afe9 -r cc36a5aac908 libpurple/util.c --- a/libpurple/util.c Fri Aug 24 15:58:46 2007 +0000 +++ b/libpurple/util.c Fri Aug 24 19:43:41 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
because it's not legal in XHTML-IM. However, * we still want to send something sensible, so we put a * linebreak in its place.
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; diff -r 41417f94afe9 -r cc36a5aac908 libpurple/util.h --- a/libpurple/util.h Fri Aug 24 15:58:46 2007 +0000 +++ b/libpurple/util.h Fri Aug 24 19:43:41 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 diff -r 41417f94afe9 -r cc36a5aac908 pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Fri Aug 24 15:58:46 2007 +0000 +++ b/pidgin/gtkrequest.c Fri Aug 24 19:43:41 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 */ diff -r 41417f94afe9 -r cc36a5aac908 pidgin/plugins/spellchk.c --- a/pidgin/plugins/spellchk.c Fri Aug 24 15:58:46 2007 +0000 +++ b/pidgin/plugins/spellchk.c Fri Aug 24 19:43:41 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;