Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Commit

Permalink
Bug 787971 - Fix warnings about function pointers in gtk2 webapprt; r…
Browse files Browse the repository at this point in the history
…=glandium
  • Loading branch information
Ms2ger committed Sep 6, 2012
1 parent 39bf3c2 commit 638e40f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions webapprt/gtk2/Makefile.in
Expand Up @@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1

include $(DEPTH)/config/autoconf.mk

Expand All @@ -14,10 +15,12 @@ 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=
Expand Down
12 changes: 6 additions & 6 deletions webapprt/gtk2/webapprt.cpp
Expand Up @@ -272,9 +272,9 @@ void RemoveApplication(nsINIParser& parser, const char* curExeDir, const char* p
* 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) {
Expand All @@ -283,9 +283,9 @@ void RemoveApplication(nsINIParser& parser, const char* curExeDir, const char* p
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;
Expand Down

0 comments on commit 638e40f

Please sign in to comment.