/pidgin/main: 5dc98ddc6a9a: Backport more warning fixes for Pidg...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue May 6 09:17:20 EDT 2014


Changeset: 5dc98ddc6a9a8c8c945a242169b62c59a7835735
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-06 15:17 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/5dc98ddc6a9a

Description:

Backport more warning fixes for Pidgin and Finch from default

diffstat:

 finch/libgnt/gntmain.c |   3 +++
 finch/libgnt/gntwm.c   |  16 ++++++++++------
 pidgin/gtkconv.c       |   5 ++++-
 pidgin/gtkprefs.c      |   3 +--
 pidgin/gtkrequest.c    |   4 +++-
 pidgin/gtksession.c    |   2 +-
 pidgin/gtkutils.c      |   2 +-
 7 files changed, 23 insertions(+), 12 deletions(-)

diffs (156 lines):

diff --git a/finch/libgnt/gntmain.c b/finch/libgnt/gntmain.c
--- a/finch/libgnt/gntmain.c
+++ b/finch/libgnt/gntmain.c
@@ -508,7 +508,10 @@ void gnt_init()
 	signal(SIGINT, sighandler);
 	signal(SIGPIPE, SIG_IGN);
 
+#if !GLIB_CHECK_VERSION(2, 36, 0)
+	/* GLib type system is automaticaly initialized since 2.36. */
 	g_type_init();
+#endif
 
 	init_wm();
 
diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c
--- a/finch/libgnt/gntwm.c
+++ b/finch/libgnt/gntwm.c
@@ -776,14 +776,16 @@ dump_file_save(GntFileSel *fs, const cha
 			if ((now & A_COLOR) != (old & A_COLOR) ||
 				(now & A_REVERSE) != (old & A_REVERSE))
 			{
-				int ret;
 				short fgp, bgp, r, g, b;
 				struct
 				{
 					int r, g, b;
 				} fg, bg;
 
-				ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp);
+				if (pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp) != OK) {
+					fgp = -1;
+					bgp = -1;
+				}
 				if (fgp == -1)
 					fgp = COLOR_BLACK;
 				if (bgp == -1)
@@ -794,9 +796,13 @@ dump_file_save(GntFileSel *fs, const cha
 					fgp = bgp;
 					bgp = tmp;
 				}
-				ret = color_content(fgp, &r, &g, &b);
+				if (color_content(fgp, &r, &g, &b) != OK) {
+					r = g = b = 0;
+				}
 				fg.r = r; fg.b = b; fg.g = g;
-				ret = color_content(bgp, &r, &g, &b);
+				if (color_content(bgp, &r, &g, &b) != OK) {
+					r = g = b = 255;
+				}
 				bg.r = r; bg.b = b; bg.g = g;
 #define ADJUST(x) (x = x * 255 / 1000)
 				ADJUST(fg.r);
@@ -1144,13 +1150,11 @@ toggle_clipboard(GntBindable *bindable, 
 {
 	static GntWidget *clip;
 	gchar *text;
-	int maxx, maxy;
 	if (clip) {
 		gnt_widget_destroy(clip);
 		clip = NULL;
 		return TRUE;
 	}
-	getmaxyx(stdscr, maxy, maxx);
 	text = gnt_get_clipboard_string();
 	clip = gnt_hwindow_new(FALSE);
 	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -5970,7 +5970,6 @@ pidgin_conv_write_conv(PurpleConversatio
 		/* The initial offset is to deal with
 		 * escaped entities making the string longer */
 		int tag_start_offset = 0;
-		int tag_end_offset = 0;
 		const char *tagname = NULL;
 
 		GtkTextIter start, end;
@@ -5993,7 +5992,9 @@ pidgin_conv_write_conv(PurpleConversatio
 			else {
 				g_snprintf(str, 1024, "*%s*:", alias_escaped);
 				tag_start_offset += 1;
+#if 0
 				tag_end_offset = 2;
+#endif
 				tagname = "whisper-name";
 			}
 		} else {
@@ -6016,7 +6017,9 @@ pidgin_conv_write_conv(PurpleConversatio
 					tag_start_offset += strlen(AUTO_RESPONSE) - 6 + 1;
 				} else {
 					g_snprintf(str, 1024, "%s:", alias_escaped);
+#if 0
 					tag_end_offset = 1;
+#endif
 				}
 
 				if (flags & PURPLE_MESSAGE_NICK) {
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -2658,7 +2658,6 @@ away_page(void)
 	GtkWidget *dd;
 	GtkWidget *label;
 	GtkWidget *button;
-	GtkWidget *select;
 	GtkWidget *menu;
 	GtkSizeGroup *sg;
 
@@ -2681,7 +2680,7 @@ away_page(void)
 	gtk_size_group_add_widget(sg, dd);
 	gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
 
-	select = pidgin_prefs_labeled_spin_button(vbox,
+	pidgin_prefs_labeled_spin_button(vbox,
 			_("_Minutes before becoming idle:"), "/purple/away/mins_before_away",
 			1, 24 * 60, sg);
 
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1647,8 +1647,10 @@ pidgin_request_file(const char *title, c
 			g_free(my_documents);
 		}
 	}
+#else
+	(void)folder_set;
+#endif
 
-#endif
 	g_signal_connect(G_OBJECT(GTK_FILE_CHOOSER(filesel)), "response",
 					 G_CALLBACK(file_ok_check_if_exists_cb), data);
 
diff --git a/pidgin/gtksession.c b/pidgin/gtksession.c
--- a/pidgin/gtksession.c
+++ b/pidgin/gtksession.c
@@ -364,7 +364,7 @@ pidgin_session_init(gchar *argv0, gchar 
 	g_free(tmp);
 
 	session_set_gchar(session, SmRestartStyleHint, (gchar) SmRestartIfRunning);
-	session_set_string(session, SmProgram, g_get_prgname());
+	session_set_string(session, SmProgram, (gchar *) g_get_prgname());
 
 	myself = g_strdup(argv0);
 	purple_debug(PURPLE_DEBUG_MISC, "Session Management",
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -1314,7 +1314,7 @@ pidgin_menu_position_func_helper(GtkMenu
 
 	monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
 
-	push_in = FALSE;
+	*push_in = FALSE;
 
 	/*
 	 * The placement of popup menus horizontally works like this (with



More information about the Commits mailing list