From 4d473b2f68d4136abc9adb672ea7a50eecc652c5 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Sun, 26 Feb 2012 15:24:19 +0000 Subject: [PATCH] Some missing fixes from IOQ3 --- reaction/code/client/libmumblelink.c | 2 +- reaction/code/qcommon/common.c | 5 +---- reaction/code/qcommon/q_shared.c | 3 ++- reaction/code/qcommon/q_shared.h | 6 ++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/reaction/code/client/libmumblelink.c b/reaction/code/client/libmumblelink.c index 40d1eb1b..c6d6acb0 100644 --- a/reaction/code/client/libmumblelink.c +++ b/reaction/code/client/libmumblelink.c @@ -115,7 +115,7 @@ int mumble_link(const char* name) close(shmfd); #endif memset(lm, 0, sizeof(LinkedMem)); - mbstowcs(lm->name, name, sizeof(lm->name)); + mbstowcs(lm->name, name, sizeof(lm->name) / sizeof(wchar_t)); return 0; } diff --git a/reaction/code/qcommon/common.c b/reaction/code/qcommon/common.c index 7bc0102e..7f3bca45 100644 --- a/reaction/code/qcommon/common.c +++ b/reaction/code/qcommon/common.c @@ -2296,10 +2296,7 @@ A way to force a bus error for development reasons ================= */ static void Com_Crash_f( void ) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnull-dereference" - * ( int * ) 0 = 0x12345678; -#pragma clang diagnostic pop + * ( volatile int * ) 0 = 0x12345678; } /* diff --git a/reaction/code/qcommon/q_shared.c b/reaction/code/qcommon/q_shared.c index 213f1c89..31d87f65 100644 --- a/reaction/code/qcommon/q_shared.c +++ b/reaction/code/qcommon/q_shared.c @@ -706,11 +706,12 @@ int Q_isalpha( int c ) qboolean Q_isanumber( const char *s ) { char *p; + double UNUSED_VAR d; if( *s == '\0' ) return qfalse; - strtod( s, &p ); + d = strtod( s, &p ); return *p == '\0'; } diff --git a/reaction/code/qcommon/q_shared.h b/reaction/code/qcommon/q_shared.h index 0418fafd..86b7293f 100644 --- a/reaction/code/qcommon/q_shared.h +++ b/reaction/code/qcommon/q_shared.h @@ -96,6 +96,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #endif #endif +#ifdef __GNUC__ +#define UNUSED_VAR __attribute__((unused)) +#else +#define UNUSED_VAR +#endif + #if (defined _MSC_VER) #define Q_EXPORT __declspec(dllexport) #elif (defined __SUNPRO_C)