1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 14:24:14 +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

@@ -47,7 +47,7 @@ typedef struct StringBuffer {
int size;
} StringBuffer;
static unsigned hashPropList(WMPropList * plist);
static unsigned hashPropList(const void *param);
static WMPropList *getPLString(PLData * pldata);
static WMPropList *getPLQString(PLData * pldata);
static WMPropList *getPLData(PLData * pldata);
@@ -55,16 +55,13 @@ static WMPropList *getPLArray(PLData * pldata);
static WMPropList *getPLDictionary(PLData * pldata);
static WMPropList *getPropList(PLData * pldata);
typedef unsigned (*hashFunc) (const void *);
typedef Bool(*isEqualFunc) (const void *, const void *);
typedef void *(*retainFunc) (const void *);
typedef void (*releaseFunc) (const void *);
static const WMHashTableCallbacks WMPropListHashCallbacks = {
(hashFunc) hashPropList,
hashPropList,
(isEqualFunc) WMIsPropListEqualTo,
(retainFunc) NULL,
(releaseFunc) NULL
NULL,
NULL
};
static Bool caseSensitive = True;
@@ -102,8 +99,9 @@ static Bool caseSensitive = True;
#define MaxHashLength 64
static unsigned hashPropList(WMPropList * plist)
static unsigned hashPropList(const void *param)
{
WMPropList *plist= (WMPropList *) param;
unsigned ret = 0;
unsigned ctr = 0;
const char *key;