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;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
relaunchApplication(wapp);
|
||||
}
|
||||
|
||||
@@ -502,6 +505,9 @@ static void unhideHereCallback(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
WApplication *wapp = (WApplication *) entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
wUnhideApplication(wapp, False, True);
|
||||
}
|
||||
|
||||
@@ -512,6 +518,9 @@ static void setIconCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WScreen *scr;
|
||||
int result;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(icon != NULL);
|
||||
|
||||
if (icon->editing)
|
||||
|
||||
@@ -76,6 +76,9 @@ static void notifyClient(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
WAppMenuData *data = entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
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;
|
||||
char *name;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(entry->clientdata != NULL);
|
||||
|
||||
wspace = w_global.workspace.current;
|
||||
@@ -419,6 +422,9 @@ static void omnipresentCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WMArrayIterator iter;
|
||||
int failed;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(entry->clientdata != NULL);
|
||||
|
||||
dock = clickedIcon->dock;
|
||||
@@ -484,6 +490,9 @@ static void removeIconsCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WDock *dock;
|
||||
WMArray *selectedIcons;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(clickedIcon != NULL);
|
||||
|
||||
dock = clickedIcon->dock;
|
||||
@@ -521,6 +530,9 @@ static void keepIconsCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WMArray *selectedIcons;
|
||||
WMArrayIterator it;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(clickedIcon != NULL);
|
||||
dock = clickedIcon->dock;
|
||||
|
||||
@@ -635,6 +647,9 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry)
|
||||
int x, y, x_pos, y_pos;
|
||||
Bool update_icon = False;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(entry->clientdata != NULL);
|
||||
clip = clickedIcon->dock;
|
||||
|
||||
@@ -731,6 +746,10 @@ static void toggleAutoRaiseLower(WDock *dock)
|
||||
static void toggleAutoRaiseLowerCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WDock *dock;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(entry->clientdata != NULL);
|
||||
|
||||
dock = (WDock *) entry->clientdata;
|
||||
@@ -746,6 +765,9 @@ static void launchCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
launchDockedApplication(btn, False);
|
||||
}
|
||||
|
||||
@@ -753,6 +775,9 @@ static void settingsCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WAppIcon *btn = (WAppIcon *) entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
if (btn->editing)
|
||||
return;
|
||||
ShowDockAppSettingsPanel(btn);
|
||||
@@ -763,6 +788,9 @@ static void hideCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WApplication *wapp;
|
||||
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);
|
||||
|
||||
if (wapp->flags.hidden) {
|
||||
@@ -778,6 +806,9 @@ static void unhideHereCallback(WMenu *menu, WMenuEntry *entry)
|
||||
WApplication *wapp;
|
||||
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);
|
||||
|
||||
wUnhideApplication(wapp, False, True);
|
||||
@@ -841,6 +872,9 @@ static void switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||
WMArray *selectedIcons;
|
||||
int x, y;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
if (entry->order == w_global.workspace.current)
|
||||
return;
|
||||
src = icon->dock;
|
||||
@@ -1047,6 +1081,10 @@ static void setDockPositionNormalCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WDock *dock = (WDock *) entry->clientdata;
|
||||
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
|
||||
return;
|
||||
// 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;
|
||||
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
|
||||
return;
|
||||
// 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;
|
||||
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
|
||||
return;
|
||||
dock->auto_raise_lower = 0;
|
||||
@@ -4333,6 +4379,9 @@ static int addADrawer(WScreen *scr)
|
||||
|
||||
static void addADrawerCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(entry->clientdata!=NULL);
|
||||
addADrawer(((WAppIcon *) entry->clientdata)->dock->screen_ptr);
|
||||
}
|
||||
@@ -4401,6 +4450,10 @@ static void drawerDestroy(WDock *drawer)
|
||||
static void removeDrawerCallback(WMenu *menu, WMenuEntry *entry)
|
||||
{
|
||||
WDock *dock = ((WAppIcon*)entry->clientdata)->dock;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
assert(dock != NULL);
|
||||
|
||||
if (dock->icon_count > 2) {
|
||||
|
||||
@@ -250,6 +250,10 @@ static void shutdownCommand(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);
|
||||
Restart((char *)entry->clientdata, False);
|
||||
Restart(NULL, True);
|
||||
@@ -257,26 +261,41 @@ static void restartCommand(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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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)
|
||||
wSessionSaveState(menu->frame->screen_ptr);
|
||||
|
||||
@@ -285,17 +304,26 @@ static void saveSessionCommand(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();
|
||||
wScreenSaveState(menu->frame->screen_ptr);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ static void focusWindow(WMenu * menu, WMenuEntry * entry)
|
||||
WScreen *scr;
|
||||
int x, y, move = 0;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
wwin = (WWindow *) entry->clientdata;
|
||||
scr = wwin->screen_ptr;
|
||||
|
||||
|
||||
@@ -75,6 +75,9 @@ static void execWindowOptionCommand(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
WWindow *wwin = (WWindow *) entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
switch (entry->order) {
|
||||
case WO_KEEP_ON_TOP:
|
||||
if (wwin->frame->core->stacking->window_level != WMFloatingLevel)
|
||||
@@ -180,6 +183,9 @@ static void switchWSCommand(WMenu * menu, WMenuEntry * entry)
|
||||
{
|
||||
WWindow *wwin = (WWindow *) entry->clientdata;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) menu;
|
||||
|
||||
wSelectWindow(wwin, False);
|
||||
wWindowChangeWorkspace(wwin, entry->order);
|
||||
}
|
||||
@@ -190,6 +196,9 @@ static void makeShortcutCommand(WMenu *menu, WMenuEntry *entry)
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
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]) {
|
||||
WMFreeArray(w_global.shortcut.windows[index]);
|
||||
w_global.shortcut.windows[index] = NULL;
|
||||
|
||||
@@ -640,11 +640,17 @@ static void switchWSCommand(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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -652,6 +658,9 @@ static void newWSCommand(WMenu *menu, WMenuEntry *foo)
|
||||
{
|
||||
int ws;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) foo;
|
||||
|
||||
ws = wWorkspaceNew(menu->frame->screen_ptr);
|
||||
|
||||
/* autochange workspace */
|
||||
|
||||
Reference in New Issue
Block a user