/pidgin/main: 9a0203562da5: pidgin: Fix build and warnings with ...

Ankit Vani a at nevitus.org
Mon Jan 27 07:02:09 EST 2014


Changeset: 9a0203562da5644ce9d96013998c1ff8980a06ca
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-01-27 17:27 +0530
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/9a0203562da5

Description:

pidgin: Fix build and warnings with glib 2.24

diffstat:

 libpurple/glibcompat.h |  19 +++++++++++++++++++
 pidgin/gtkconv.c       |   4 +++-
 pidgin/gtkmain.c       |   3 ++-
 pidgin/gtkutils.c      |   1 +
 pidgin/gtkwebview.c    |   4 +++-
 5 files changed, 28 insertions(+), 3 deletions(-)

diffs (119 lines):

diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -44,6 +44,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include <string.h>
+
 #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 #define G_GNUC_END_IGNORE_DEPRECATIONS
 
@@ -53,6 +55,21 @@ static inline GThread * g_thread_try_new
 	return g_thread_create(func, data, TRUE, error);
 }
 
+#if !GLIB_CHECK_VERSION(2, 30, 0)
+
+static inline gchar *g_utf8_substring(const gchar *str, glong start_pos,
+	glong end_pos)
+{
+	gchar *start = g_utf8_offset_to_pointer(str, start_pos);
+	gchar *end = g_utf8_offset_to_pointer(start, end_pos - start_pos);
+	gchar *out = g_malloc(end - start + 1);
+
+	memcpy(out, start, end - start);
+	out[end - start] = 0;
+
+	return out;
+}
+
 #if !GLIB_CHECK_VERSION(2, 28, 0)
 
 static inline gint64 g_get_monotonic_time(void)
@@ -97,6 +114,8 @@ static inline void g_object_class_instal
 
 #endif /* < 2.28.0 */
 
+#endif /* < 2.30.0 */
+
 #endif /* < 2.32.0 */
 
 #endif /* _PIDGINGLIBCOMPAT_H_ */
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -39,6 +39,7 @@
 #include "cmds.h"
 #include "core.h"
 #include "debug.h"
+#include "glibcompat.h"
 #include "idle.h"
 #include "imgstore.h"
 #include "log.h"
@@ -9845,7 +9846,8 @@ notebook_remove_tab_from_menu_cb(GtkNote
 	GtkWidget *item;
 
 	/* Disconnecting the "child-notify::menu-label" signal. */
-	g_signal_handlers_disconnect_by_data(child, notebook);
+	g_signal_handlers_disconnect_matched(child, G_SIGNAL_MATCH_DATA, 0, 0,
+			NULL, NULL, notebook);
 
 	item = g_object_get_data(G_OBJECT(child), "popup-menu-item");
 	gtk_container_remove(GTK_CONTAINER(win->notebook_menu), item);
diff --git a/pidgin/gtkmain.c b/pidgin/gtkmain.c
--- a/pidgin/gtkmain.c
+++ b/pidgin/gtkmain.c
@@ -30,7 +30,7 @@
 #include "dbus-maybe.h"
 #include "debug.h"
 #include "eventloop.h"
-#include "xfer.h"
+#include "glibcompat.h"
 #include "log.h"
 #include "network.h"
 #include "notify.h"
@@ -41,6 +41,7 @@
 #include "status.h"
 #include "util.h"
 #include "whiteboard.h"
+#include "xfer.h"
 
 #include "gtkaccount.h"
 #include "gtkblist.h"
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -26,6 +26,7 @@
 #define _PIDGIN_GTKUTILS_C_
 
 #include "internal.h"
+#include "glibcompat.h"
 #include "pidgin.h"
 
 #ifdef _WIN32
diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -27,9 +27,11 @@
 
 #include "internal.h"
 #include "debug.h"
+#include "glibcompat.h"
 #include "pidgin.h"
 
 #include <gdk/gdkkeysyms.h>
+
 #include "gtkutils.h"
 #include "gtkwebview.h"
 #include "gtkwebviewtoolbar.h"
@@ -1342,7 +1344,7 @@ do_formatting(GtkWebView *webview, const
 	}
 
 	priv->edit.block_changed = TRUE;
-	webkit_dom_document_exec_command(dom, name, FALSE, value);
+	webkit_dom_document_exec_command(dom, (gchar *)name, FALSE, (gchar *)value);
 	priv->edit.block_changed = FALSE;
 
 	if (priv->edit.wbfo) {



More information about the Commits mailing list