From 3c0e5eed83ed40db5728b0a2f5d39c4d6d2e01c9 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 6 Feb 2006 13:10:18 +0100 Subject: [PATCH] A few fixes for pointer qualifiers (const, volatile) warnings. --- include/winbase.h | 4 ++-- libs/unicode/cptable.c | 2 +- tools/wmc/mcy.y | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/winbase.h b/include/winbase.h index 9a864909d4b..aeee6a019ce 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2284,7 +2284,7 @@ static inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID volatile *de : "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" ); return ret; #else - return (PVOID)InterlockedCompareExchange( (PLONG)dest, (LONG)xchg, (LONG)compare ); + return (PVOID)InterlockedCompareExchange( (LONG volatile*)dest, (LONG)xchg, (LONG)compare ); #endif } @@ -2296,7 +2296,7 @@ static inline PVOID WINAPI InterlockedExchangePointer( PVOID volatile *dest, PVO : "=r" (ret) :"r" (dest), "0" (val) : "memory" ); return ret; #else - return (PVOID)InterlockedExchange( (PLONG)dest, (LONG)val ); + return (PVOID)InterlockedExchange( (LONG volatile*)dest, (LONG)val ); #endif } diff --git a/libs/unicode/cptable.c b/libs/unicode/cptable.c index 74f7312b5f3..4d40c2f0d19 100644 --- a/libs/unicode/cptable.c +++ b/libs/unicode/cptable.c @@ -156,7 +156,7 @@ static const union cptable * const cptables[60] = static int cmp_codepage( const void *codepage, const void *entry ) { - return *(unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage; + return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage; } diff --git a/tools/wmc/mcy.y b/tools/wmc/mcy.y index 3b99e347110..557509a9336 100644 --- a/tools/wmc/mcy.y +++ b/tools/wmc/mcy.y @@ -465,7 +465,7 @@ static msg_t *add_lanmsg(msg_t *msg, lanmsg_t *lanmsg) static int sort_lanmsg(const void *p1, const void *p2) { - return (*(lanmsg_t **)p1)->lan - (*(lanmsg_t **)p2)->lan; + return (*(const lanmsg_t * const *)p1)->lan - (*(const lanmsg_t * const*)p2)->lan; } static msg_t *complete_msg(msg_t *mp, int id) @@ -563,7 +563,7 @@ static int check_languages(node_t *head) return nm; } -#define MSGRID(x) ((*(msg_t **)(x))->realid) +#define MSGRID(x) ((*(const msg_t * const*)(x))->realid) static int sort_msg(const void *p1, const void *p2) { return MSGRID(p1) > MSGRID(p2) ? 1 : (MSGRID(p1) == MSGRID(p2) ? 0 : -1); @@ -653,7 +653,7 @@ static lan_blk_t *block_messages(node_t *head) static int sc_xlat(const void *p1, const void *p2) { - return ((cp_xlat_t *)p1)->lan - ((cp_xlat_t *)p2)->lan; + return ((const cp_xlat_t *)p1)->lan - ((const cp_xlat_t *)p2)->lan; } static void add_cpxlat(int lan, int cpin, int cpout)