diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m index 512a7b300..e91c93eeb 100644 --- a/src/Core/Entities/PlayerEntityControls.m +++ b/src/Core/Entities/PlayerEntityControls.m @@ -124,8 +124,10 @@ static BOOL gammaControlPressed; #endif static BOOL fovControlPressed; +#if OOLITE_WINDOWS static BOOL hdrMaxBrightnessControlPressed; static BOOL hdrPaperWhiteControlPressed; +#endif static BOOL colorblindModeControlPressed; static BOOL shaderSelectKeyPressed; static BOOL selectPressed; diff --git a/src/Core/OOMatrix.h b/src/Core/OOMatrix.h index f0901f764..8500e5877 100644 --- a/src/Core/OOMatrix.h +++ b/src/Core/OOMatrix.h @@ -345,8 +345,6 @@ OOINLINE bool OOMatrixIsIdentity(OOMatrix m) OOINLINE void OOMatrixGetBasisVectors(OOMatrix m, Vector *outRight, Vector *outUp, Vector *outForward) { - assert(outRight != NULL && outUp != NULL && outForward != NULL); - *outRight = make_vector(m.m[0][0], m.m[1][0], m.m[2][0]); *outUp = make_vector(m.m[0][1], m.m[1][1], m.m[2][1]); *outForward = make_vector(m.m[0][2], m.m[1][2], m.m[2][2]); diff --git a/src/Core/OOOpenGLStateManager.m b/src/Core/OOOpenGLStateManager.m index 551785ef0..09addf914 100644 --- a/src/Core/OOOpenGLStateManager.m +++ b/src/Core/OOOpenGLStateManager.m @@ -308,8 +308,6 @@ static void GetCurrentOpenGLState(OOOpenGLState *state) static bool StatesEqual(const OOOpenGLState *a, const OOOpenGLState *b) { - NSCParameterAssert(a != NULL && b != NULL); - #define ITEM_STATEFLAG(NAME) do { if (a->NAME != b->NAME && a->NAME != kStateMaybe && b->NAME != kStateMaybe) return false; } while (0) #define ITEM_CLIENTSTATEFLAG(NAME) do { if (a->NAME != b->NAME) return false; } while (0) #define ITEM_SPECIAL(NAME, _, __) do { if (a->NAME != b->NAME) return false; } while (0) @@ -403,7 +401,6 @@ void OOSetOpenGLState(OOOpenGLStateID state) static void SwitchOpenGLStateInternal(const OOOpenGLState *sourceState, const OOOpenGLState *targetState) { - NSCParameterAssert(sourceState != NULL && targetState != NULL); OO_ENTER_OPENGL(); #define ITEM_STATEFLAG(NAME) \ diff --git a/src/Core/OOPolygonSprite.m b/src/Core/OOPolygonSprite.m index 5ada443ea..7857166b7 100644 --- a/src/Core/OOPolygonSprite.m +++ b/src/Core/OOPolygonSprite.m @@ -283,11 +283,11 @@ - (BOOL) loadPolygons:(NSArray *)dataArray outlineWidth:(float)outlineWidth dataArray = DataArrayToPoints(&polygonData, dataArray); /*** Tesselate polygon fill ***/ - gluTessCallback(tesselator, GLU_TESS_BEGIN_DATA, TessBeginCallback); - gluTessCallback(tesselator, GLU_TESS_VERTEX_DATA, TessVertexCallback); - gluTessCallback(tesselator, GLU_TESS_END_DATA, TessEndCallback); - gluTessCallback(tesselator, GLU_TESS_ERROR_DATA, ErrorCallback); - gluTessCallback(tesselator, GLU_TESS_COMBINE_DATA, TessCombineCallback); + gluTessCallback(tesselator, GLU_TESS_BEGIN_DATA, (_GLUfuncptr) TessBeginCallback); + gluTessCallback(tesselator, GLU_TESS_VERTEX_DATA, (_GLUfuncptr) TessVertexCallback); + gluTessCallback(tesselator, GLU_TESS_END_DATA, (_GLUfuncptr) TessEndCallback); + gluTessCallback(tesselator, GLU_TESS_ERROR_DATA, (_GLUfuncptr) ErrorCallback); + gluTessCallback(tesselator, GLU_TESS_COMBINE_DATA, (_GLUfuncptr) TessCombineCallback); gluTessBeginPolygon(tesselator, &polygonData); SVGDumpBeginGroup(&polygonData, @"Fill"); @@ -351,11 +351,11 @@ - (BOOL) loadPolygons:(NSArray *)dataArray outlineWidth:(float)outlineWidth polygonData.generatingOutline = YES; #endif - gluTessCallback(tesselator, GLU_TESS_BEGIN_DATA, TessBeginCallback); - gluTessCallback(tesselator, GLU_TESS_VERTEX_DATA, TessVertexCallback); - gluTessCallback(tesselator, GLU_TESS_END_DATA, TessEndCallback); - gluTessCallback(tesselator, GLU_TESS_ERROR_DATA, ErrorCallback); - gluTessCallback(tesselator, GLU_TESS_COMBINE_DATA, TessCombineCallback); + gluTessCallback(tesselator, GLU_TESS_BEGIN_DATA, (_GLUfuncptr) TessBeginCallback); + gluTessCallback(tesselator, GLU_TESS_VERTEX_DATA, (_GLUfuncptr) TessVertexCallback); + gluTessCallback(tesselator, GLU_TESS_END_DATA, (_GLUfuncptr) TessEndCallback); + gluTessCallback(tesselator, GLU_TESS_ERROR_DATA, (_GLUfuncptr) ErrorCallback); + gluTessCallback(tesselator, GLU_TESS_COMBINE_DATA, (_GLUfuncptr) TessCombineCallback); gluTessProperty(tesselator, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE); gluTessBeginPolygon(tesselator, &polygonData); diff --git a/src/Core/OXPVerifier/OOOXPVerifier.m b/src/Core/OXPVerifier/OOOXPVerifier.m index 632f7613c..86176ac48 100644 --- a/src/Core/OXPVerifier/OOOXPVerifier.m +++ b/src/Core/OXPVerifier/OOOXPVerifier.m @@ -43,7 +43,7 @@ of this software and associated documentation files (the "Software"), to deal static void SwitchLogFile(NSString *name); static void NoteVerificationStage(NSString *displayName, NSString *stage); -static void OpenLogFile(NSString *name); +static bool OpenLogFile(NSString *name); @interface OOOXPVerifier (OOPrivate) @@ -717,29 +717,23 @@ static void NoteVerificationStage(NSString *displayName, NSString *stage) } -static void OpenLogFile(NSString *name) +static bool OpenLogFile(NSString *name) { // Open log file in appropriate application / provide feedback. if ([[NSUserDefaults standardUserDefaults] oo_boolForKey:@"oxp-verifier-open-log" defaultValue:YES]) { #if OOLITE_MAC_OS_X - [[NSWorkspace sharedWorkspace] openFile:OOLogHandlerGetLogPath()]; + return [[NSWorkspace sharedWorkspace] openFile:OOLogHandlerGetLogPath()]; #elif OOLITE_WINDOWS // start wordpad (for historical reasons wordpad is called write from the command prompt) - system([[NSString stringWithFormat:@"write \"Logs\\%@.log\"", name] UTF8String]); + return system([[NSString stringWithFormat:@"write \"Logs\\%@.log\"", name] UTF8String]); #elif OOLITE_LINUX - // MKW - needed to suppress 'ignoring return value' warning for system() call - // int ret; - // CIM - and now the compiler complains about that too... casting return - // value to void seems to keep it quiet for now - // Nothing to do here, since we dump to stdout instead of to a file. //OOLogOutputHandlerStopLoggingToStdout(); - (void) system([[NSString stringWithFormat:@"cat \"%@\"", OOLogHandlerGetLogPath()] UTF8String]); -#else - do {} while (0); + return system([[NSString stringWithFormat:@"cat \"%@\"", OOLogHandlerGetLogPath()] UTF8String]); #endif } + return true; } diff --git a/src/Core/Octree.m b/src/Core/Octree.m index 255b7719d..f3f61bc48 100644 --- a/src/Core/Octree.m +++ b/src/Core/Octree.m @@ -966,8 +966,13 @@ these ivars are unused (but may be used by categories, which they are). */ - (BOOL) suppressClangStuff { - return &_stateStack && 0; +/* This define exists purely to suppress gcc warnings that &_stateStack is + always true +*/ +#define RETVAL &_stateStack && 0 + return RETVAL; } +#undef RETVAL #endif @end diff --git a/src/SDL/main.m b/src/SDL/main.m index ca066a52c..6005a629a 100644 --- a/src/SDL/main.m +++ b/src/SDL/main.m @@ -46,7 +46,7 @@ #ifndef NDEBUG -uint32_t gDebugFlags = 0; +NSUInteger gDebugFlags = 0; #endif