/pidgin/main: 398577183905: Fix Pidgin's plugins warnings about ...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Thu Aug 22 05:35:39 EDT 2013


Changeset: 398577183905b0e63a024371d408a99015524320
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-08-22 11:35 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/398577183905

Description:

Fix Pidgin's plugins warnings about -Wsign-compare

diffstat:

 pidgin/plugins/pidginrc.c |  10 +++++-----
 pidgin/plugins/spellchk.c |  11 ++++++-----
 2 files changed, 11 insertions(+), 10 deletions(-)

diffs (84 lines):

diff --git a/pidgin/plugins/pidginrc.c b/pidgin/plugins/pidginrc.c
--- a/pidgin/plugins/pidginrc.c
+++ b/pidgin/plugins/pidginrc.c
@@ -108,7 +108,7 @@ static GtkWidget *widget_bool_widgets[G_
 static GString *
 make_gtkrc_string(void)
 {
-	gint i;
+	gsize i;
 	gchar *prefbase = NULL;
 	GString *style_string = g_string_new("");
 
@@ -366,7 +366,7 @@ purplerc_make_interface_vbox(void)
 {
 	GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL;
 	GtkSizeGroup *labelsg = NULL;
-	gint i;
+	gsize i;
 
 	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
 	labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -405,7 +405,7 @@ purplerc_make_fonts_vbox(void)
 {
 	GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
 	GtkSizeGroup *labelsg = NULL;
-	int i;
+	gsize i;
 
 	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
 	labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -465,7 +465,7 @@ purplerc_make_misc_vbox(void)
 	 * the size group not the whole thing, which isn't what I want. */
 	GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
 	GtkSizeGroup *labelsg = NULL;
-	int i;
+	gsize i;
 
 	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
 	labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -644,7 +644,7 @@ static PurplePluginInfo purplerc_info =
 static void
 purplerc_init(PurplePlugin *plugin)
 {
-	gint i;
+	gsize i;
 
 	purple_prefs_add_none("/plugins");
 	purple_prefs_add_none("/plugins/gtk");
diff --git a/pidgin/plugins/spellchk.c b/pidgin/plugins/spellchk.c
--- a/pidgin/plugins/spellchk.c
+++ b/pidgin/plugins/spellchk.c
@@ -125,7 +125,8 @@ make_word_proper(const gchar *word)
 	gchar *ret;
 
 	bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf);
-	buf[MIN(bytes, sizeof(buf) - 1)] = '\0';
+	g_assert(bytes >= 0);
+	buf[MIN((gsize)bytes, sizeof(buf) - 1)] = '\0';
 
 	ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL);
 	g_free(lower);
@@ -678,10 +679,10 @@ spellchk_new_attach(PurpleConversation *
 	return;
 }
 
-static int buf_get_line(char *ibuf, char **buf, int *position, gsize len)
+static int buf_get_line(char *ibuf, char **buf, gsize *position, gsize len)
 {
-	int pos = *position;
-	int spos = pos;
+	gsize pos = *position;
+	gsize spos = pos;
 
 	if (pos == len)
 		return 0;
@@ -1778,7 +1779,7 @@ static void load_conf(void)
 	GHashTable *hashes;
 	char bad[82] = "";
 	char good[256] = "";
-	int pnt = 0;
+	gsize pnt = 0;
 	gsize size;
 	gboolean complete = TRUE;
 	gboolean case_sensitive = FALSE;



More information about the Commits mailing list