From bc5985e824abb1dcf2f9aff640402b0d73d5afcb Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 1 Nov 2013 16:06:48 +0100 Subject: [PATCH] WPrefs: 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 --- WPrefs.app/Appearance.c | 15 +++++++++++++++ WPrefs.app/FontSimple.c | 9 +++++++++ WPrefs.app/KeyboardShortcuts.c | 3 +++ WPrefs.app/Preferences.c | 3 +++ WPrefs.app/TexturePanel.c | 9 +++++++++ WPrefs.app/WPrefs.c | 22 ++++++++++++++++++++++ WPrefs.app/WindowHandling.c | 9 +++++++++ WPrefs.app/editmenu.c | 3 +++ 8 files changed, 73 insertions(+) diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 8a3fe6b8..46e74996 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -971,6 +971,9 @@ static void editTexture(WMWidget * w, void *data) WMListItem *item; TextureListItem *titem; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + item = WMGetListItem(panel->texLs, WMGetListSelectedItemRow(panel->texLs)); titem = (TextureListItem *) item->clientData; @@ -988,6 +991,9 @@ static void newTexture(WMWidget * w, void *data) { _Panel *panel = (_Panel *) data; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + SetTexturePanelPixmapPath(panel->texturePanel, GetObjectForKey("PixmapPath")); SetTexturePanelTexture(panel->texturePanel, "New Texture", NULL); @@ -1007,6 +1013,9 @@ static void deleteTexture(WMWidget * w, void *data) int row; int section; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + section = WMGetPopUpButtonSelectedItem(panel->secP); row = WMGetListSelectedItemRow(panel->texLs); item = WMGetListItem(panel->texLs, row); @@ -1144,6 +1153,9 @@ static void textureClick(WMWidget * w, void *data) WMListItem *item; TextureListItem *titem; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + i = WMGetListSelectedItemRow(panel->texLs); item = WMGetListItem(panel->texLs, i); @@ -1164,6 +1176,9 @@ static void textureDoubleClick(WMWidget * w, void *data) WMListItem *item; TextureListItem *titem; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + /* unselect old texture */ section = WMGetPopUpButtonSelectedItem(panel->secP); diff --git a/WPrefs.app/FontSimple.c b/WPrefs.app/FontSimple.c index 0793ae04..1bcb277c 100644 --- a/WPrefs.app/FontSimple.c +++ b/WPrefs.app/FontSimple.c @@ -355,6 +355,9 @@ static void selectedFamily(WMWidget * w, void *data) FontStyle *oldStyle = NULL; char buffer[1024]; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + item = WMGetListSelectedItem(panel->styleL); if (item) oldStyle = (FontStyle *) item->clientData; @@ -436,6 +439,9 @@ static void selected(WMWidget * w, void *data) FcChar8 *ofont; char *nfont; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + ofont = (FcChar8 *) WMGetMenuItemRepresentedObject(item); nfont = getSelectedFont(panel, ofont); if (ofont) @@ -453,6 +459,9 @@ static void selectedOption(WMWidget * w, void *data) WMMenuItem *item = WMGetPopUpButtonMenuItem(panel->optionP, index); char *font; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + font = (char *)WMGetMenuItemRepresentedObject(item); if (font) { FcPattern *pat; diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index 1d8e0ed5..8c9cafa6 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -378,6 +378,9 @@ static void clearShortcut(WMWidget * w, void *data) _Panel *panel = (_Panel *) data; int row = WMGetListSelectedItemRow(panel->actLs); + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + WMSetTextFieldText(panel->shoT, NULL); if (row >= 0) { diff --git a/WPrefs.app/Preferences.c b/WPrefs.app/Preferences.c index 93990231..3ab7d8ed 100644 --- a/WPrefs.app/Preferences.c +++ b/WPrefs.app/Preferences.c @@ -62,6 +62,9 @@ static void borderCallback(WMWidget * w, void *data) char buffer[64]; int i; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + i = WMGetSliderValue(panel->borderS); if (i == 0) diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c index 65d2a0ea..3101a165 100644 --- a/WPrefs.app/TexturePanel.c +++ b/WPrefs.app/TexturePanel.c @@ -460,6 +460,9 @@ static void gradAddCallback(WMWidget * w, void *data) int row; RColor *rgb; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + row = WMGetListSelectedItemRow(panel->gcolL) + 1; item = WMInsertListItem(panel->gcolL, row, "00,00,00"); rgb = wmalloc(sizeof(RColor)); @@ -502,6 +505,9 @@ static void gradDeleteCallback(WMWidget * w, void *data) WMListItem *item; int row; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + row = WMGetListSelectedItemRow(panel->gcolL); if (row < 0) return; @@ -534,6 +540,9 @@ static void opaqChangeCallback(WMWidget * w, void *data) { TexturePanel *panel = (TexturePanel *) data; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + updateTGradImage(panel); } diff --git a/WPrefs.app/WPrefs.c b/WPrefs.app/WPrefs.c index 9683d374..f174a7df 100644 --- a/WPrefs.app/WPrefs.c +++ b/WPrefs.app/WPrefs.c @@ -72,6 +72,10 @@ static void prepareForClose(void); static void quit(WMWidget *w, void *data) { + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + (void) data; + prepareForClose(); exit(0); @@ -85,6 +89,9 @@ static void save(WMWidget * w, void *data) WMPropList *key; XEvent ev; + /* Parameter not used, but tell the compiler that it is ok */ + (void) data; + /* puts("gathering data"); */ for (i = 0; i < WPrefs.sectionCount; i++) { PanelRec *rec = WMGetHangedData(WPrefs.sectionB[i]); @@ -134,6 +141,10 @@ static void undo(WMWidget * w, void *data) { PanelRec *rec = (PanelRec *) WPrefs.currentPanel; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + (void) data; + if (!rec) return; @@ -146,6 +157,10 @@ static void undoAll(WMWidget * w, void *data) { int i; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + (void) data; + for (i = 0; i < WPrefs.sectionCount; i++) { PanelRec *rec = WMGetHangedData(WPrefs.sectionB[i]); @@ -171,6 +186,10 @@ static void toggleBalloons(WMWidget *w, void *data) WMUserDefaults *udb = WMGetStandardUserDefaults(); Bool flag; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + (void) data; + flag = WMGetButtonSelected(WPrefs.balloonBtn); WMSetBalloonEnabled(WMWidgetScreen(WPrefs.win), flag); @@ -317,6 +336,9 @@ static void savePanelData(Panel * panel) static void changeSection(WMWidget * self, void *data) { + /* Parameter not used, but tell the compiler that it is ok */ + (void) self; + if (WPrefs.currentPanel == data) return; diff --git a/WPrefs.app/WindowHandling.c b/WPrefs.app/WindowHandling.c index 4f59a516..dee15435 100644 --- a/WPrefs.app/WindowHandling.c +++ b/WPrefs.app/WindowHandling.c @@ -94,6 +94,9 @@ static void sliderCallback(WMWidget * w, void *data) int swidth = WMGetSliderMaxValue(panel->hsli); int sheight = WMGetSliderMaxValue(panel->vsli); + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + x = WMGetSliderValue(panel->hsli); y = WMGetSliderValue(panel->vsli); @@ -111,6 +114,9 @@ static void resistanceCallback(WMWidget * w, void *data) char buffer[64]; int i; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + i = WMGetSliderValue(panel->resS); if (i == 0) @@ -127,6 +133,9 @@ static void resizeCallback(WMWidget * w, void *data) char buffer[64]; int i; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + i = WMGetSliderValue(panel->resizeS); if (i == 0) diff --git a/WPrefs.app/editmenu.c b/WPrefs.app/editmenu.c index 1f3e4814..da71db4f 100644 --- a/WPrefs.app/editmenu.c +++ b/WPrefs.app/editmenu.c @@ -574,6 +574,9 @@ static void closeMenuAction(WMWidget * w, void *data) { WEditMenu *menu = (WEditMenu *) data; + /* Parameter not used, but tell the compiler that it is ok */ + (void) w; + WMAddIdleHandler(WMDestroyWidget, menu->closeB); menu->closeB = NULL;