From: Christophe CURIS <[email protected]>

The toolkit dispatches X events for MouseButton using callback functions,
which means having a fixed argument list for that function.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <[email protected]>
---
 src/menu.c   | 10 ++++++++++
 src/window.c | 21 +++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/src/menu.c b/src/menu.c
index e032270..9645b10 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -2094,6 +2094,9 @@ static void menuTitleDoubleClick(WCoreWindow * sender, 
void *data, XEvent * even
        WMenu *menu = data;
        int lower;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        if (event->xbutton.state & MOD_MASK) {
                if (menu->flags.lowered) {
                        lower = 0;
@@ -2114,6 +2117,9 @@ static void menuTitleMouseDown(WCoreWindow * sender, void 
*data, XEvent * event)
        int i, lower;
        Bool started;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        /* can't touch the menu copy */
        if (menu->flags.brother)
                return;
@@ -2221,6 +2227,10 @@ static void menuCloseClick(WCoreWindow * sender, void 
*data, XEvent * event)
        WMenu *parent = menu->parent;
        int i;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+       (void) event;
+
        if (parent) {
                for (i = 0; i < parent->cascade_no; i++) {
                        /* find the entry that points to the copy */
diff --git a/src/window.c b/src/window.c
index 3146bb5..19dd721 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2669,6 +2669,9 @@ static void resizebarMouseDown(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
 #ifndef NUMLOCK_HACK
        if ((event->xbutton.state & ValidModMask)
            != (event->xbutton.state & ~LockMask)) {
@@ -2711,6 +2714,9 @@ static void titlebarDblClick(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        event->xbutton.state &= w_global.shortcut.modifiers_mask;
 
        if (event->xbutton.button == Button1) {
@@ -2826,6 +2832,9 @@ static void titlebarMouseDown(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = (WWindow *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
 #ifndef NUMLOCK_HACK
        if ((event->xbutton.state & ValidModMask) != (event->xbutton.state & 
~LockMask))
                wwarning(_("The NumLock, ScrollLock or similar key seems to be 
turned on. "
@@ -2889,6 +2898,9 @@ static void windowCloseClick(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        event->xbutton.state &= w_global.shortcut.modifiers_mask;
 
        CloseWindowMenu(wwin->screen_ptr);
@@ -2912,6 +2924,9 @@ static void windowCloseDblClick(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        CloseWindowMenu(wwin->screen_ptr);
 
        if (event->xbutton.button < Button1 || event->xbutton.button > Button3)
@@ -2933,6 +2948,9 @@ static void windowLanguageClick(WCoreWindow *sender, void 
*data, XEvent *event)
        WScreen *scr = fwin->screen_ptr;
        int tl;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        if (event->xbutton.button != Button1 && event->xbutton.button != 
Button3)
                return;
        tl = wwin->frame->languagemode;
@@ -2952,6 +2970,9 @@ static void windowIconifyClick(WCoreWindow *sender, void 
*data, XEvent *event)
 {
        WWindow *wwin = data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sender;
+
        event->xbutton.state &= w_global.shortcut.modifiers_mask;
 
        CloseWindowMenu(wwin->screen_ptr);
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to