mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-13 19:43:32 +02: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:
committed by
Carlos R. Mafra
parent
237c386fdc
commit
ea74fe8871
@@ -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);
|
WMColor *backColor = ((state & WLDSSelected) ? scr->white : view->backColor);
|
||||||
int width, height, x, y, textLen;
|
int width, height, x, y, textLen;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) index;
|
||||||
|
|
||||||
width = rect->size.width;
|
width = rect->size.width;
|
||||||
height = rect->size.height;
|
height = rect->size.height;
|
||||||
x = rect->pos.x;
|
x = rect->pos.x;
|
||||||
|
|||||||
@@ -1129,6 +1129,9 @@ static void closeWindowCallback(WMWidget * w, void *data)
|
|||||||
{
|
{
|
||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
WMCloseColorPanel(panel);
|
WMCloseColorPanel(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1680,6 +1683,9 @@ static void magnifyPutCursor(WMWidget * w, void *data)
|
|||||||
XEvent event;
|
XEvent event;
|
||||||
WMPoint initialPosition;
|
WMPoint initialPosition;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
/* Destroy wheelBackImg, so it'll update properly */
|
/* Destroy wheelBackImg, so it'll update properly */
|
||||||
if (panel->selectionBackImg) {
|
if (panel->selectionBackImg) {
|
||||||
XFreePixmap(WMWidgetScreen(panel->win)->display, 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;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
value = 255 - WMGetSliderValue(panel->wheelBrightnessS);
|
value = 255 - WMGetSliderValue(panel->wheelBrightnessS);
|
||||||
|
|
||||||
wheelCalculateValues(panel, value);
|
wheelCalculateValues(panel, value);
|
||||||
@@ -2275,6 +2284,9 @@ static void grayBrightnessSliderCallback(WMWidget * w, void *data)
|
|||||||
char tmp[4];
|
char tmp[4];
|
||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
value = WMGetSliderValue(panel->grayBrightnessS);
|
value = WMGetSliderValue(panel->grayBrightnessS);
|
||||||
|
|
||||||
sprintf(tmp, "%d", value);
|
sprintf(tmp, "%d", value);
|
||||||
@@ -2350,6 +2362,9 @@ static void rgbSliderCallback(WMWidget * w, void *data)
|
|||||||
char tmp[4];
|
char tmp[4];
|
||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
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[0] = WMGetSliderValue(panel->rgbRedS);
|
||||||
value[1] = WMGetSliderValue(panel->rgbGreenS);
|
value[1] = WMGetSliderValue(panel->rgbGreenS);
|
||||||
value[2] = WMGetSliderValue(panel->rgbBlueS);
|
value[2] = WMGetSliderValue(panel->rgbBlueS);
|
||||||
@@ -2422,6 +2437,9 @@ static void cmykSliderCallback(WMWidget * w, void *data)
|
|||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
value[0] = WMGetSliderValue(panel->cmykCyanS);
|
value[0] = WMGetSliderValue(panel->cmykCyanS);
|
||||||
value[1] = WMGetSliderValue(panel->cmykMagentaS);
|
value[1] = WMGetSliderValue(panel->cmykMagentaS);
|
||||||
value[2] = WMGetSliderValue(panel->cmykYellowS);
|
value[2] = WMGetSliderValue(panel->cmykYellowS);
|
||||||
@@ -2862,6 +2880,9 @@ static void customPaletteMenuCallback(WMWidget * w, void *data)
|
|||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
int item = WMGetPopUpButtonSelectedItem(panel->customPaletteMenuBtn);
|
int item = WMGetPopUpButtonSelectedItem(panel->customPaletteMenuBtn);
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case CPmenuNewFromFile:
|
case CPmenuNewFromFile:
|
||||||
customPaletteMenuNewFromFile(panel);
|
customPaletteMenuNewFromFile(panel);
|
||||||
@@ -3200,6 +3221,9 @@ static void colorListColorMenuCallback(WMWidget * w, void *data)
|
|||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
int item = WMGetPopUpButtonSelectedItem(panel->colorListColorMenuBtn);
|
int item = WMGetPopUpButtonSelectedItem(panel->colorListColorMenuBtn);
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case CLmenuAdd:
|
case CLmenuAdd:
|
||||||
break;
|
break;
|
||||||
@@ -3215,6 +3239,9 @@ static void colorListListMenuCallback(WMWidget * w, void *data)
|
|||||||
W_ColorPanel *panel = (W_ColorPanel *) data;
|
W_ColorPanel *panel = (W_ColorPanel *) data;
|
||||||
int item = WMGetPopUpButtonSelectedItem(panel->colorListListMenuBtn);
|
int item = WMGetPopUpButtonSelectedItem(panel->colorListListMenuBtn);
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case CLmenuAdd:
|
case CLmenuAdd:
|
||||||
/* New Color List */
|
/* New Color List */
|
||||||
|
|||||||
@@ -551,6 +551,10 @@ static void fillColumn(WMBrowserDelegate * self, WMBrowser * bPtr, int column, W
|
|||||||
char *path;
|
char *path;
|
||||||
WMFilePanel *panel;
|
WMFilePanel *panel;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) self;
|
||||||
|
(void) list;
|
||||||
|
|
||||||
if (column > 0) {
|
if (column > 0) {
|
||||||
path = WMGetBrowserPathToColumn(bPtr, column - 1);
|
path = WMGetBrowserPathToColumn(bPtr, column - 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -566,6 +570,9 @@ static void browserDClick(WMWidget *widget, void *p_panel)
|
|||||||
{
|
{
|
||||||
WMFilePanel *panel = p_panel;
|
WMFilePanel *panel = p_panel;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) widget;
|
||||||
|
|
||||||
WMPerformButtonClick(panel->okButton);
|
WMPerformButtonClick(panel->okButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,6 +611,9 @@ static void createDir(WMWidget *widget, void *p_panel)
|
|||||||
size_t slen;
|
size_t slen;
|
||||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
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"),
|
dirName = WMRunInputPanel(scr, panel->win, _("Create Directory"),
|
||||||
_("Enter directory name"), "", _("OK"), _("Cancel"));
|
_("Enter directory name"), "", _("OK"), _("Cancel"));
|
||||||
if (!dirName)
|
if (!dirName)
|
||||||
@@ -688,6 +698,9 @@ static void deleteFile(WMWidget *widget, void *p_panel)
|
|||||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||||
#define __msgbufsize__ 512
|
#define __msgbufsize__ 512
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) widget;
|
||||||
|
|
||||||
buffer = wmalloc(__msgbufsize__);
|
buffer = wmalloc(__msgbufsize__);
|
||||||
file = getCurrentFileName(panel);
|
file = getCurrentFileName(panel);
|
||||||
normalizePath(file);
|
normalizePath(file);
|
||||||
@@ -733,6 +746,9 @@ static void goFloppy(WMWidget *widget, void *p_panel)
|
|||||||
struct stat filestat;
|
struct stat filestat;
|
||||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) widget;
|
||||||
|
|
||||||
if (stat(WINGsConfiguration.floppyPath, &filestat)) {
|
if (stat(WINGsConfiguration.floppyPath, &filestat)) {
|
||||||
showError(scr, panel->win, _("An error occured browsing '%s'."), WINGsConfiguration.floppyPath);
|
showError(scr, panel->win, _("An error occured browsing '%s'."), WINGsConfiguration.floppyPath);
|
||||||
return;
|
return;
|
||||||
@@ -749,6 +765,9 @@ static void goHome(WMWidget *widget, void *p_panel)
|
|||||||
WMFilePanel *panel = p_panel;
|
WMFilePanel *panel = p_panel;
|
||||||
char *home;
|
char *home;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) widget;
|
||||||
|
|
||||||
/* home is statically allocated. Don't free it! */
|
/* home is statically allocated. Don't free it! */
|
||||||
home = wgethomedir();
|
home = wgethomedir();
|
||||||
if (!home)
|
if (!home)
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ static void listFamilies(WMScreen * scr, WMFontPanel * panel);
|
|||||||
|
|
||||||
static void splitViewConstrainCallback(WMSplitView * sPtr, int indView, int *min, int *max)
|
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)
|
if (indView == 0)
|
||||||
*min = MIN_UPPER_HEIGHT;
|
*min = MIN_UPPER_HEIGHT;
|
||||||
else
|
else
|
||||||
@@ -138,6 +142,9 @@ static void closeWindow(WMWidget * w, void *data)
|
|||||||
{
|
{
|
||||||
FontPanel *panel = (FontPanel *) data;
|
FontPanel *panel = (FontPanel *) data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
WMHideFontPanel(panel);
|
WMHideFontPanel(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,12 +152,19 @@ static void setClickedAction(WMWidget * w, void *data)
|
|||||||
{
|
{
|
||||||
FontPanel *panel = (FontPanel *) data;
|
FontPanel *panel = (FontPanel *) data;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
if (panel->action)
|
if (panel->action)
|
||||||
(*panel->action) (panel, panel->data);
|
(*panel->action) (panel, panel->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void revertClickedAction(WMWidget * w, void *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; */
|
/*FontPanel *panel = (FontPanel*)data; */
|
||||||
/* XXX TODO */
|
/* XXX TODO */
|
||||||
}
|
}
|
||||||
@@ -676,6 +690,9 @@ static void typefaceClick(WMWidget * w, void *data)
|
|||||||
int sizei = -1;
|
int sizei = -1;
|
||||||
void *size;
|
void *size;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
osize = WMGetTextFieldText(panel->sizT);
|
osize = WMGetTextFieldText(panel->sizT);
|
||||||
|
|
||||||
item = WMGetListSelectedItem(panel->typLs);
|
item = WMGetListSelectedItem(panel->typLs);
|
||||||
@@ -715,6 +732,9 @@ static void sizeClick(WMWidget * w, void *data)
|
|||||||
FontPanel *panel = (FontPanel *) data;
|
FontPanel *panel = (FontPanel *) data;
|
||||||
WMListItem *item;
|
WMListItem *item;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
item = WMGetListSelectedItem(panel->sizLs);
|
item = WMGetListSelectedItem(panel->sizLs);
|
||||||
WMSetTextFieldText(panel->sizT, item->text);
|
WMSetTextFieldText(panel->sizT, item->text);
|
||||||
|
|
||||||
|
|||||||
@@ -2678,6 +2678,9 @@ static void rulerMoveCallBack(WMWidget * w, void *self)
|
|||||||
{
|
{
|
||||||
Text *tPtr = (Text *) self;
|
Text *tPtr = (Text *) self;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
if (!tPtr)
|
if (!tPtr)
|
||||||
return;
|
return;
|
||||||
if (W_CLASS(tPtr) != WC_Text)
|
if (W_CLASS(tPtr) != WC_Text)
|
||||||
@@ -2690,6 +2693,9 @@ static void rulerReleaseCallBack(WMWidget * w, void *self)
|
|||||||
{
|
{
|
||||||
Text *tPtr = (Text *) self;
|
Text *tPtr = (Text *) self;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) w;
|
||||||
|
|
||||||
if (!tPtr)
|
if (!tPtr)
|
||||||
return;
|
return;
|
||||||
if (W_CLASS(tPtr) != WC_Text)
|
if (W_CLASS(tPtr) != WC_Text)
|
||||||
|
|||||||
Reference in New Issue
Block a user