Bug 787971 - Fix warnings about function pointers in gtk2 webapprt; r=glandium
authorMs2ger <ms2ger@gmail.com>
Thu, 06 Sep 2012 09:25:05 +0200
changeset 104385 73910fb9acdbe7978d6b89231c4bd9a0d26ff9f8
parent 104384 79504d9c90d3086399c93d84d76b4ef665bec8d6
child 104386 47126ccdb6602d746b6778e218614089796c8912
push id23421
push userMs2ger@gmail.com
push dateThu, 06 Sep 2012 08:20:50 +0000
treeherdermozilla-central@47126ccdb660 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs787971
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 787971 - Fix warnings about function pointers in gtk2 webapprt; r=glandium
webapprt/gtk2/Makefile.in
webapprt/gtk2/webapprt.cpp
--- a/webapprt/gtk2/Makefile.in
+++ b/webapprt/gtk2/Makefile.in
@@ -1,28 +1,31 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
 
 include $(DEPTH)/config/autoconf.mk
 
 # Build a binary bootstrapping with XRE_main
 PROGRAM = webapprt-stub
 
 CPPSRCS = webapprt.cpp
 
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
-LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
-LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
-LOCAL_INCLUDES += -I$(DEPTH)/build
+LOCAL_INCLUDES += \
+  -I$(topsrcdir)/toolkit/xre \
+  -I$(topsrcdir)/xpcom/base \
+  -I$(topsrcdir)/xpcom/build \
+  -I$(DEPTH)/build \
+  $(NULL)
 
 DEFINES += -DXPCOM_GLUE
 STL_FLAGS=
 
 LIBS = \
   $(XPCOM_STANDALONE_GLUE_LDOPTS) \
   $(MOZ_GTK2_LIBS) \
   $(NULL)
--- a/webapprt/gtk2/webapprt.cpp
+++ b/webapprt/gtk2/webapprt.cpp
@@ -267,30 +267,30 @@ void RemoveApplication(nsINIParser& pars
   char uninstallMsg[MAXPATHLEN];
   if (NS_SUCCEEDED(parser.GetString("Webapp", "UninstallMsg", uninstallMsg, MAXPATHLEN))) {
     /**
      * The only difference between libnotify.so.4 and libnotify.so.1 for these symbols
      * is that notify_notification_new takes three arguments in libnotify.so.4 and
      * four in libnotify.so.1.
      * Passing the fourth argument as NULL is binary compatible.
      */
-    typedef void  (*notify_init_t)(char*);
-    typedef void* (*notify_notification_new_t)(char*, char*, char*, char*);
-    typedef void  (*notify_notification_show_t)(void*, char*);
+    typedef void  (*notify_init_t)(const char*);
+    typedef void* (*notify_notification_new_t)(const char*, const char*, const char*, const char*);
+    typedef void  (*notify_notification_show_t)(void*, void**);
 
     void *handle = dlopen("libnotify.so.4", RTLD_LAZY);
     if (!handle) {
       handle = dlopen("libnotify.so.1", RTLD_LAZY);
       if (!handle)
         return;
     }
 
-    notify_init_t nn_init = (notify_init_t)dlsym(handle, "notify_init");
-    notify_notification_new_t nn_new = (notify_notification_new_t)dlsym(handle, "notify_notification_new");
-    notify_notification_show_t nn_show = (notify_notification_show_t)dlsym(handle, "notify_notification_show");
+    notify_init_t nn_init = (notify_init_t)(uintptr_t)dlsym(handle, "notify_init");
+    notify_notification_new_t nn_new = (notify_notification_new_t)(uintptr_t)dlsym(handle, "notify_notification_new");
+    notify_notification_show_t nn_show = (notify_notification_show_t)(uintptr_t)dlsym(handle, "notify_notification_show");
     if (!nn_init || !nn_new || !nn_show) {
       dlclose(handle);
       return;
     }
 
     nn_init(appName);
 
     void* n = nn_new(uninstallMsg, NULL, "dialog-information", NULL);