mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
wmaker: Marked args as unused for compiler in menu callback code
When an entry of a menu is selected, the appropriate action is triggered using a callback, 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 <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
adb936e9f2
commit
9330ddf946
@@ -483,6 +483,9 @@ static void relaunchCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
{
|
{
|
||||||
WApplication *wapp = (WApplication *) entry->clientdata;
|
WApplication *wapp = (WApplication *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
relaunchApplication(wapp);
|
relaunchApplication(wapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,6 +505,9 @@ static void unhideHereCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
{
|
{
|
||||||
WApplication *wapp = (WApplication *) entry->clientdata;
|
WApplication *wapp = (WApplication *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
wUnhideApplication(wapp, False, True);
|
wUnhideApplication(wapp, False, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,6 +518,9 @@ static void setIconCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WScreen *scr;
|
WScreen *scr;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(icon != NULL);
|
assert(icon != NULL);
|
||||||
|
|
||||||
if (icon->editing)
|
if (icon->editing)
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ static void notifyClient(WMenu * menu, WMenuEntry * entry)
|
|||||||
{
|
{
|
||||||
WAppMenuData *data = entry->clientdata;
|
WAppMenuData *data = entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
sendMessage(data->window, wmSelectItem, data->tag);
|
sendMessage(data->window, wmSelectItem, data->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
53
src/dock.c
53
src/dock.c
@@ -169,6 +169,9 @@ static void renameCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
int wspace;
|
int wspace;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
|
|
||||||
wspace = w_global.workspace.current;
|
wspace = w_global.workspace.current;
|
||||||
@@ -419,6 +422,9 @@ static void omnipresentCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WMArrayIterator iter;
|
WMArrayIterator iter;
|
||||||
int failed;
|
int failed;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
|
|
||||||
dock = clickedIcon->dock;
|
dock = clickedIcon->dock;
|
||||||
@@ -484,6 +490,9 @@ static void removeIconsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WDock *dock;
|
WDock *dock;
|
||||||
WMArray *selectedIcons;
|
WMArray *selectedIcons;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(clickedIcon != NULL);
|
assert(clickedIcon != NULL);
|
||||||
|
|
||||||
dock = clickedIcon->dock;
|
dock = clickedIcon->dock;
|
||||||
@@ -521,6 +530,9 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WMArray *selectedIcons;
|
WMArray *selectedIcons;
|
||||||
WMArrayIterator it;
|
WMArrayIterator it;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(clickedIcon != NULL);
|
assert(clickedIcon != NULL);
|
||||||
dock = clickedIcon->dock;
|
dock = clickedIcon->dock;
|
||||||
|
|
||||||
@@ -635,6 +647,9 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
int x, y, x_pos, y_pos;
|
int x, y, x_pos, y_pos;
|
||||||
Bool update_icon = False;
|
Bool update_icon = False;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
clip = clickedIcon->dock;
|
clip = clickedIcon->dock;
|
||||||
|
|
||||||
@@ -731,6 +746,10 @@ static void toggleAutoRaiseLower(WDock *dock)
|
|||||||
static void toggleAutoRaiseLowerCallback(WMenu *menu, WMenuEntry *entry)
|
static void toggleAutoRaiseLowerCallback(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
WDock *dock;
|
WDock *dock;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
|
|
||||||
dock = (WDock *) entry->clientdata;
|
dock = (WDock *) entry->clientdata;
|
||||||
@@ -746,6 +765,9 @@ static void launchCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
{
|
{
|
||||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
launchDockedApplication(btn, False);
|
launchDockedApplication(btn, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -753,6 +775,9 @@ static void settingsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
{
|
{
|
||||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (btn->editing)
|
if (btn->editing)
|
||||||
return;
|
return;
|
||||||
ShowDockAppSettingsPanel(btn);
|
ShowDockAppSettingsPanel(btn);
|
||||||
@@ -763,6 +788,9 @@ static void hideCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WApplication *wapp;
|
WApplication *wapp;
|
||||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
wapp = wApplicationOf(btn->icon->owner->main_window);
|
wapp = wApplicationOf(btn->icon->owner->main_window);
|
||||||
|
|
||||||
if (wapp->flags.hidden) {
|
if (wapp->flags.hidden) {
|
||||||
@@ -778,6 +806,9 @@ static void unhideHereCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WApplication *wapp;
|
WApplication *wapp;
|
||||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
wapp = wApplicationOf(btn->icon->owner->main_window);
|
wapp = wApplicationOf(btn->icon->owner->main_window);
|
||||||
|
|
||||||
wUnhideApplication(wapp, False, True);
|
wUnhideApplication(wapp, False, True);
|
||||||
@@ -841,6 +872,9 @@ static void switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
|||||||
WMArray *selectedIcons;
|
WMArray *selectedIcons;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (entry->order == w_global.workspace.current)
|
if (entry->order == w_global.workspace.current)
|
||||||
return;
|
return;
|
||||||
src = icon->dock;
|
src = icon->dock;
|
||||||
@@ -1047,6 +1081,10 @@ static void setDockPositionNormalCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
{
|
{
|
||||||
WDock *dock = (WDock *) entry->clientdata;
|
WDock *dock = (WDock *) entry->clientdata;
|
||||||
WDrawerChain *dc;
|
WDrawerChain *dc;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (entry->flags.indicator_on) // already set, nothing to do
|
if (entry->flags.indicator_on) // already set, nothing to do
|
||||||
return;
|
return;
|
||||||
// Do we come from auto raise lower or keep on top?
|
// Do we come from auto raise lower or keep on top?
|
||||||
@@ -1070,6 +1108,10 @@ static void setDockPositionAutoRaiseLowerCallback(WMenu *menu, WMenuEntry *entry
|
|||||||
{
|
{
|
||||||
WDock *dock = (WDock *) entry->clientdata;
|
WDock *dock = (WDock *) entry->clientdata;
|
||||||
WDrawerChain *dc;
|
WDrawerChain *dc;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (entry->flags.indicator_on) // already set, nothing to do
|
if (entry->flags.indicator_on) // already set, nothing to do
|
||||||
return;
|
return;
|
||||||
// Do we come from normal or keep on top?
|
// Do we come from normal or keep on top?
|
||||||
@@ -1089,6 +1131,10 @@ static void setDockPositionKeepOnTopCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
{
|
{
|
||||||
WDock *dock = (WDock *) entry->clientdata;
|
WDock *dock = (WDock *) entry->clientdata;
|
||||||
WDrawerChain *dc;
|
WDrawerChain *dc;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (entry->flags.indicator_on) // already set, nothing to do
|
if (entry->flags.indicator_on) // already set, nothing to do
|
||||||
return;
|
return;
|
||||||
dock->auto_raise_lower = 0;
|
dock->auto_raise_lower = 0;
|
||||||
@@ -4333,6 +4379,9 @@ static int addADrawer(WScreen *scr)
|
|||||||
|
|
||||||
static void addADrawerCallback(WMenu *menu, WMenuEntry *entry)
|
static void addADrawerCallback(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(entry->clientdata!=NULL);
|
assert(entry->clientdata!=NULL);
|
||||||
addADrawer(((WAppIcon *) entry->clientdata)->dock->screen_ptr);
|
addADrawer(((WAppIcon *) entry->clientdata)->dock->screen_ptr);
|
||||||
}
|
}
|
||||||
@@ -4401,6 +4450,10 @@ static void drawerDestroy(WDock *drawer)
|
|||||||
static void removeDrawerCallback(WMenu *menu, WMenuEntry *entry)
|
static void removeDrawerCallback(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
WDock *dock = ((WAppIcon*)entry->clientdata)->dock;
|
WDock *dock = ((WAppIcon*)entry->clientdata)->dock;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
assert(dock != NULL);
|
assert(dock != NULL);
|
||||||
|
|
||||||
if (dock->icon_count > 2) {
|
if (dock->icon_count > 2) {
|
||||||
|
|||||||
@@ -250,6 +250,10 @@ static void shutdownCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
static void restartCommand(WMenu * menu, WMenuEntry * entry)
|
static void restartCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
Shutdown(WSRestartPreparationMode);
|
Shutdown(WSRestartPreparationMode);
|
||||||
Restart((char *)entry->clientdata, False);
|
Restart((char *)entry->clientdata, False);
|
||||||
Restart(NULL, True);
|
Restart(NULL, True);
|
||||||
@@ -257,26 +261,41 @@ static void restartCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
static void refreshCommand(WMenu * menu, WMenuEntry * entry)
|
static void refreshCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wRefreshDesktop(menu->frame->screen_ptr);
|
wRefreshDesktop(menu->frame->screen_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void arrangeIconsCommand(WMenu * menu, WMenuEntry * entry)
|
static void arrangeIconsCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wArrangeIcons(menu->frame->screen_ptr, True);
|
wArrangeIcons(menu->frame->screen_ptr, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showAllCommand(WMenu * menu, WMenuEntry * entry)
|
static void showAllCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wShowAllWindows(menu->frame->screen_ptr);
|
wShowAllWindows(menu->frame->screen_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hideOthersCommand(WMenu * menu, WMenuEntry * entry)
|
static void hideOthersCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wHideOtherApplications(menu->frame->screen_ptr->focused_window);
|
wHideOtherApplications(menu->frame->screen_ptr->focused_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void saveSessionCommand(WMenu * menu, WMenuEntry * entry)
|
static void saveSessionCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
if (!wPreferences.save_session_on_exit)
|
if (!wPreferences.save_session_on_exit)
|
||||||
wSessionSaveState(menu->frame->screen_ptr);
|
wSessionSaveState(menu->frame->screen_ptr);
|
||||||
|
|
||||||
@@ -285,17 +304,26 @@ static void saveSessionCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
static void clearSessionCommand(WMenu *menu, WMenuEntry *entry)
|
static void clearSessionCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wSessionClearState();
|
wSessionClearState();
|
||||||
wScreenSaveState(menu->frame->screen_ptr);
|
wScreenSaveState(menu->frame->screen_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void infoPanelCommand(WMenu * menu, WMenuEntry * entry)
|
static void infoPanelCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wShowInfoPanel(menu->frame->screen_ptr);
|
wShowInfoPanel(menu->frame->screen_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void legalPanelCommand(WMenu * menu, WMenuEntry * entry)
|
static void legalPanelCommand(WMenu * menu, WMenuEntry * entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wShowLegalPanel(menu->frame->screen_ptr);
|
wShowLegalPanel(menu->frame->screen_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ static void focusWindow(WMenu * menu, WMenuEntry * entry)
|
|||||||
WScreen *scr;
|
WScreen *scr;
|
||||||
int x, y, move = 0;
|
int x, y, move = 0;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
wwin = (WWindow *) entry->clientdata;
|
wwin = (WWindow *) entry->clientdata;
|
||||||
scr = wwin->screen_ptr;
|
scr = wwin->screen_ptr;
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ static void execWindowOptionCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
{
|
{
|
||||||
WWindow *wwin = (WWindow *) entry->clientdata;
|
WWindow *wwin = (WWindow *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
switch (entry->order) {
|
switch (entry->order) {
|
||||||
case WO_KEEP_ON_TOP:
|
case WO_KEEP_ON_TOP:
|
||||||
if (wwin->frame->core->stacking->window_level != WMFloatingLevel)
|
if (wwin->frame->core->stacking->window_level != WMFloatingLevel)
|
||||||
@@ -180,6 +183,9 @@ static void switchWSCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
{
|
{
|
||||||
WWindow *wwin = (WWindow *) entry->clientdata;
|
WWindow *wwin = (WWindow *) entry->clientdata;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
wSelectWindow(wwin, False);
|
wSelectWindow(wwin, False);
|
||||||
wWindowChangeWorkspace(wwin, entry->order);
|
wWindowChangeWorkspace(wwin, entry->order);
|
||||||
}
|
}
|
||||||
@@ -190,6 +196,9 @@ static void makeShortcutCommand(WMenu *menu, WMenuEntry *entry)
|
|||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
int index = entry->order - WO_ENTRIES;
|
int index = entry->order - WO_ENTRIES;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) menu;
|
||||||
|
|
||||||
if (w_global.shortcut.windows[index]) {
|
if (w_global.shortcut.windows[index]) {
|
||||||
WMFreeArray(w_global.shortcut.windows[index]);
|
WMFreeArray(w_global.shortcut.windows[index]);
|
||||||
w_global.shortcut.windows[index] = NULL;
|
w_global.shortcut.windows[index] = NULL;
|
||||||
|
|||||||
@@ -640,11 +640,17 @@ static void switchWSCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
static void lastWSCommand(WMenu *menu, WMenuEntry *entry)
|
static void lastWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wWorkspaceChange(menu->frame->screen_ptr, w_global.workspace.last_used);
|
wWorkspaceChange(menu->frame->screen_ptr, w_global.workspace.last_used);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deleteWSCommand(WMenu *menu, WMenuEntry *entry)
|
static void deleteWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) entry;
|
||||||
|
|
||||||
wWorkspaceDelete(menu->frame->screen_ptr, w_global.workspace.count - 1);
|
wWorkspaceDelete(menu->frame->screen_ptr, w_global.workspace.count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -652,6 +658,9 @@ static void newWSCommand(WMenu *menu, WMenuEntry *foo)
|
|||||||
{
|
{
|
||||||
int ws;
|
int ws;
|
||||||
|
|
||||||
|
/* Parameter not used, but tell the compiler that it is ok */
|
||||||
|
(void) foo;
|
||||||
|
|
||||||
ws = wWorkspaceNew(menu->frame->screen_ptr);
|
ws = wWorkspaceNew(menu->frame->screen_ptr);
|
||||||
|
|
||||||
/* autochange workspace */
|
/* autochange workspace */
|
||||||
|
|||||||
Reference in New Issue
Block a user