mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmaker: Removed explicit callback type conversion
It is dangerous to use a function that does not use the same prototype as expected by the callback, because that mean there is conversion performed for the arguments, on which the compiler has no possibility to report problems. It is safer to create the function with the strict argument list, and insert an explicit type conversion for which the compiler will be able to perform compatibility checks, and include optional code when needed. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
298343f5ad
commit
bd77216edf
@@ -2899,8 +2899,10 @@ static int setFrameSelectedBorderColor(WScreen * scr, WDefaultEntry * entry, voi
|
|||||||
return REFRESH_FRAME_BORDER;
|
return REFRESH_FRAME_BORDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trackDeadProcess(pid_t pid, unsigned char status, WScreen * scr)
|
static void trackDeadProcess(pid_t pid, unsigned int status, void *client_data)
|
||||||
{
|
{
|
||||||
|
WScreen *scr = (WScreen *) client_data;
|
||||||
|
|
||||||
close(scr->helper_fd);
|
close(scr->helper_fd);
|
||||||
scr->helper_fd = 0;
|
scr->helper_fd = 0;
|
||||||
scr->helper_pid = 0;
|
scr->helper_pid = 0;
|
||||||
@@ -2978,7 +2980,7 @@ static int setWorkspaceSpecificBack(WScreen * scr, WDefaultEntry * entry, void *
|
|||||||
scr->helper_pid = pid;
|
scr->helper_pid = pid;
|
||||||
scr->flags.backimage_helper_launched = 1;
|
scr->flags.backimage_helper_launched = 1;
|
||||||
|
|
||||||
wAddDeathHandler(pid, (WDeathHandler *) trackDeadProcess, scr);
|
wAddDeathHandler(pid, trackDeadProcess, scr);
|
||||||
|
|
||||||
SendHelperMessage(scr, 'P', -1, wPreferences.pixmap_path);
|
SendHelperMessage(scr, 'P', -1, wPreferences.pixmap_path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,8 +261,10 @@ typedef struct {
|
|||||||
char *command;
|
char *command;
|
||||||
} _tuple;
|
} _tuple;
|
||||||
|
|
||||||
static void shellCommandHandler(pid_t pid, unsigned char status, _tuple * data)
|
static void shellCommandHandler(pid_t pid, unsigned int status, void *client_data)
|
||||||
{
|
{
|
||||||
|
_tuple *data = (_tuple *) client_data;
|
||||||
|
|
||||||
if (status == 127) {
|
if (status == 127) {
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
|
||||||
@@ -317,7 +319,7 @@ void ExecuteShellCommand(WScreen *scr, const char *command)
|
|||||||
data->scr = scr;
|
data->scr = scr;
|
||||||
data->command = wstrdup(command);
|
data->command = wstrdup(command);
|
||||||
|
|
||||||
wAddDeathHandler(pid, (WDeathHandler *) shellCommandHandler, data);
|
wAddDeathHandler(pid, shellCommandHandler, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +378,7 @@ Bool RelaunchWindow(WWindow *wwin)
|
|||||||
data->command = wtokenjoin(argv, argc);
|
data->command = wtokenjoin(argv, argc);
|
||||||
|
|
||||||
/* not actually a shell command */
|
/* not actually a shell command */
|
||||||
wAddDeathHandler(pid, (WDeathHandler *) shellCommandHandler, data);
|
wAddDeathHandler(pid, shellCommandHandler, data);
|
||||||
|
|
||||||
XFreeStringList(argv);
|
XFreeStringList(argv);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user