1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-10 15:54:17 +01:00

WINGs: Marked args as unused for compiler in event callback code

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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-10-19 22:17:55 +02:00
committed by Carlos R. Mafra
parent 237c386fdc
commit ea74fe8871
5 changed files with 75 additions and 0 deletions

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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)

View File

@@ -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);

View File

@@ -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)