From: Christophe CURIS <[email protected]>

The WINGs toolkit dispatch events on widgets using callbacks, which means
having a fixed argument list for the handling 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]>
---
 WINGs/wbrowser.c    |  3 +++
 WINGs/wcolorpanel.c | 27 +++++++++++++++++++++++++++
 WINGs/wfilepanel.c  | 19 +++++++++++++++++++
 WINGs/wfontpanel.c  | 20 ++++++++++++++++++++
 WINGs/wtext.c       |  6 ++++++
 5 files changed, 75 insertions(+)

diff --git a/WINGs/wbrowser.c b/WINGs/wbrowser.c
index f1a29a1..d390407 100644
--- a/WINGs/wbrowser.c
+++ b/WINGs/wbrowser.c
@@ -480,6 +480,9 @@ static void paintItem(WMList * lPtr, int index, Drawable d, 
char *text, int stat
        WMColor *backColor = ((state & WLDSSelected) ? scr->white : 
view->backColor);
        int width, height, x, y, textLen;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) index;
+
        width = rect->size.width;
        height = rect->size.height;
        x = rect->pos.x;
diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c
index 78e5649..d6bd79c 100644
--- a/WINGs/wcolorpanel.c
+++ b/WINGs/wcolorpanel.c
@@ -1129,6 +1129,9 @@ static void closeWindowCallback(WMWidget * w, void *data)
 {
        W_ColorPanel *panel = (W_ColorPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        WMCloseColorPanel(panel);
 }
 
@@ -1680,6 +1683,9 @@ static void magnifyPutCursor(WMWidget * w, void *data)
        XEvent event;
        WMPoint initialPosition;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        /* Destroy wheelBackImg, so it'll update properly */
        if (panel->selectionBackImg) {
                XFreePixmap(WMWidgetScreen(panel->win)->display, 
panel->selectionBackImg);
@@ -2130,6 +2136,9 @@ static void wheelBrightnessSliderCallback(WMWidget * w, 
void *data)
 
        W_ColorPanel *panel = (W_ColorPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        value = 255 - WMGetSliderValue(panel->wheelBrightnessS);
 
        wheelCalculateValues(panel, value);
@@ -2275,6 +2284,9 @@ static void grayBrightnessSliderCallback(WMWidget * w, 
void *data)
        char tmp[4];
        W_ColorPanel *panel = (W_ColorPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        value = WMGetSliderValue(panel->grayBrightnessS);
 
        sprintf(tmp, "%d", value);
@@ -2350,6 +2362,9 @@ static void rgbSliderCallback(WMWidget * w, void *data)
        char tmp[4];
        W_ColorPanel *panel = (W_ColorPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        value[0] = WMGetSliderValue(panel->rgbRedS);
        value[1] = WMGetSliderValue(panel->rgbGreenS);
        value[2] = WMGetSliderValue(panel->rgbBlueS);
@@ -2422,6 +2437,9 @@ static void cmykSliderCallback(WMWidget * w, void *data)
        W_ColorPanel *panel = (W_ColorPanel *) data;
        double scale;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        value[0] = WMGetSliderValue(panel->cmykCyanS);
        value[1] = WMGetSliderValue(panel->cmykMagentaS);
        value[2] = WMGetSliderValue(panel->cmykYellowS);
@@ -2862,6 +2880,9 @@ static void customPaletteMenuCallback(WMWidget * w, void 
*data)
        W_ColorPanel *panel = (W_ColorPanel *) data;
        int item = WMGetPopUpButtonSelectedItem(panel->customPaletteMenuBtn);
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        switch (item) {
        case CPmenuNewFromFile:
                customPaletteMenuNewFromFile(panel);
@@ -3200,6 +3221,9 @@ static void colorListColorMenuCallback(WMWidget * w, void 
*data)
        W_ColorPanel *panel = (W_ColorPanel *) data;
        int item = WMGetPopUpButtonSelectedItem(panel->colorListColorMenuBtn);
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        switch (item) {
        case CLmenuAdd:
                break;
@@ -3215,6 +3239,9 @@ static void colorListListMenuCallback(WMWidget * w, void 
*data)
        W_ColorPanel *panel = (W_ColorPanel *) data;
        int item = WMGetPopUpButtonSelectedItem(panel->colorListListMenuBtn);
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        switch (item) {
        case CLmenuAdd:
                /* New Color List */
diff --git a/WINGs/wfilepanel.c b/WINGs/wfilepanel.c
index 56fdda5..8219ee6 100644
--- a/WINGs/wfilepanel.c
+++ b/WINGs/wfilepanel.c
@@ -551,6 +551,10 @@ static void fillColumn(WMBrowserDelegate * self, WMBrowser 
* bPtr, int column, W
        char *path;
        WMFilePanel *panel;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) self;
+       (void) list;
+
        if (column > 0) {
                path = WMGetBrowserPathToColumn(bPtr, column - 1);
        } else {
@@ -566,6 +570,9 @@ static void browserDClick(WMWidget *widget, void *p_panel)
 {
        WMFilePanel *panel = p_panel;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) widget;
+
        WMPerformButtonClick(panel->okButton);
 }
 
@@ -604,6 +611,9 @@ static void createDir(WMWidget *widget, void *p_panel)
        size_t slen;
        WMScreen *scr = WMWidgetScreen(panel->win);
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) widget;
+
        dirName = WMRunInputPanel(scr, panel->win, _("Create Directory"),
                                  _("Enter directory name"), "", _("OK"), 
_("Cancel"));
        if (!dirName)
@@ -688,6 +698,9 @@ static void deleteFile(WMWidget *widget, void *p_panel)
        WMScreen *scr = WMWidgetScreen(panel->win);
 #define __msgbufsize__ 512
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) widget;
+
        buffer = wmalloc(__msgbufsize__);
        file = getCurrentFileName(panel);
        normalizePath(file);
@@ -733,6 +746,9 @@ static void goFloppy(WMWidget *widget, void *p_panel)
        struct stat filestat;
        WMScreen *scr = WMWidgetScreen(panel->win);
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) widget;
+
        if (stat(WINGsConfiguration.floppyPath, &filestat)) {
                showError(scr, panel->win, _("An error occured browsing 
'%s'."), WINGsConfiguration.floppyPath);
                return;
@@ -749,6 +765,9 @@ static void goHome(WMWidget *widget, void *p_panel)
        WMFilePanel *panel = p_panel;
        char *home;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) widget;
+
        /* home is statically allocated. Don't free it! */
        home = wgethomedir();
        if (!home)
diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c
index c6df7b3..3f29051 100644
--- a/WINGs/wfontpanel.c
+++ b/WINGs/wfontpanel.c
@@ -85,6 +85,10 @@ static void listFamilies(WMScreen * scr, WMFontPanel * 
panel);
 
 static void splitViewConstrainCallback(WMSplitView * sPtr, int indView, int 
*min, int *max)
 {
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) sPtr;
+       (void) max;
+
        if (indView == 0)
                *min = MIN_UPPER_HEIGHT;
        else
@@ -138,6 +142,9 @@ static void closeWindow(WMWidget * w, void *data)
 {
        FontPanel *panel = (FontPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        WMHideFontPanel(panel);
 }
 
@@ -145,12 +152,19 @@ static void setClickedAction(WMWidget * w, void *data)
 {
        FontPanel *panel = (FontPanel *) data;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        if (panel->action)
                (*panel->action) (panel, panel->data);
 }
 
 static void revertClickedAction(WMWidget * w, void *data)
 {
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+       (void) data;
+
        /*FontPanel *panel = (FontPanel*)data; */
        /* XXX TODO */
 }
@@ -676,6 +690,9 @@ static void typefaceClick(WMWidget * w, void *data)
        int sizei = -1;
        void *size;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        osize = WMGetTextFieldText(panel->sizT);
 
        item = WMGetListSelectedItem(panel->typLs);
@@ -715,6 +732,9 @@ static void sizeClick(WMWidget * w, void *data)
        FontPanel *panel = (FontPanel *) data;
        WMListItem *item;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        item = WMGetListSelectedItem(panel->sizLs);
        WMSetTextFieldText(panel->sizT, item->text);
 
diff --git a/WINGs/wtext.c b/WINGs/wtext.c
index 8bb6016..99b15b9 100644
--- a/WINGs/wtext.c
+++ b/WINGs/wtext.c
@@ -2678,6 +2678,9 @@ static void rulerMoveCallBack(WMWidget * w, void *self)
 {
        Text *tPtr = (Text *) self;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        if (!tPtr)
                return;
        if (W_CLASS(tPtr) != WC_Text)
@@ -2690,6 +2693,9 @@ static void rulerReleaseCallBack(WMWidget * w, void *self)
 {
        Text *tPtr = (Text *) self;
 
+       /* Parameter not used, but tell the compiler that it is ok */
+       (void) w;
+
        if (!tPtr)
                return;
        if (W_CLASS(tPtr) != WC_Text)
-- 
1.8.4.rc3


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

Reply via email to