1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-28 10:55:48 +01:00

WINGs: Removed cast to change function prototype

When a function is used as a call-back, it is dangerous to have
arguments with a type different than what is expected by the
call-back definition.

This patch sets the argument list to match what is expected by
the call-back prototype and inserts an explicit type conversion
at the beginning of the function.
This commit is contained in:
Christophe CURIS
2013-05-12 00:24:46 +02:00
committed by Carlos R. Mafra
parent bab90b2168
commit e2d816c7a2
5 changed files with 26 additions and 21 deletions

View File

@@ -635,7 +635,10 @@ static void handleEvents(XEvent * event, void *data)
static int matchTitle(const void *item, const void *title)
{
return (strcmp(((WMListItem *) item)->text, (const char *)title) == 0 ? 1 : 0);
const WMListItem *wl_item = item;
const char *s_title = title;
return (strcmp(wl_item->text, s_title) == 0 ? 1 : 0);
}
int WMFindRowOfListItemWithTitle(WMList * lPtr, const char *title)