Browse Source

Fixes for compiler warnings

seanpaultaylor 11 years ago
parent
commit
adbdae9cf9

+ 2 - 0
CHANGES.md

@@ -5,6 +5,8 @@
 - Adds updates to FBX SDK 2015.1.
 - Adds support for Bullet Physics 2.82
 - Adds gameplay-encoder support for Visual Studio 2013.
+- Adds support for C++11.
+- Fixes Android to build with arm instead of thumb.
 
 ## v2.0.0
 

+ 1 - 1
gameplay/android/jni/Android.mk

@@ -284,7 +284,7 @@ LOCAL_SRC_FILES := \
     lua/lua_VertexFormatUsage.cpp \
     lua/lua_VerticalLayout.cpp
 
-LOCAL_CPPFLAGS += -std=c++11
+LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_CFLAGS := -D__ANDROID__ -I"../../external-deps/lua/include" -I"../../external-deps/bullet/include" -I"../../external-deps/png/include" -I"../../external-deps/ogg/include" -I"../../external-deps/vorbis/include" -I"../../external-deps/openal/include"
 LOCAL_STATIC_LIBRARIES := android_native_app_glue

+ 1 - 1
gameplay/src/PhysicsCollisionShape.cpp

@@ -154,7 +154,7 @@ PhysicsCollisionShape::Definition PhysicsCollisionShape::Definition::create(Node
     // Load the defined properties.
     properties->rewind();
     const char* name;
-    while (name = properties->getNextProperty())
+    while ((name = properties->getNextProperty()))
     {
         if (strcmp(name, "shape") == 0)
         {

+ 6 - 5
gameplay/src/PlatformAndroid.cpp

@@ -973,8 +973,8 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
 											scale = ((float) currentDistancePointer0) / ((float) lastDistancePointer0);
 										else
 											scale = ((float) currentDistancePointer1) / ((float) lastDistancePointer1);
-										if (currentDistancePointer0 >= lastDistancePointer0 && currentDistancePointer1 >= lastDistancePointer1 ||
-											currentDistancePointer0 <= lastDistancePointer0 && currentDistancePointer1 <= lastDistancePointer1)
+										if (((currentDistancePointer0 >= lastDistancePointer0) && (currentDistancePointer1 >= lastDistancePointer1)) ||
+											((currentDistancePointer0 <= lastDistancePointer0) && (currentDistancePointer1 <= lastDistancePointer1)))
 										{
 											gameplay::Platform::gesturePinchEventInternal(__gesturePinchCentroid.first, __gesturePinchCentroid.second, scale);	
 											gestureDetected = true;
@@ -993,9 +993,9 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
                             		int delta = sqrt(pow(static_cast<float>(x - __pointer0.x), 2) +
 													pow(static_cast<float>(y - __pointer0.y), 2));
                             
-                            		if (__gestureDraging || __gestureEventsProcessed.test(Gesture::GESTURE_DRAG) && 
-                                 		gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_DRAG_START_DURATION_MIN &&
-                                		delta >= GESTURE_DRAG_DISTANCE_MIN)
+                            		if ((__gestureDraging || __gestureEventsProcessed.test(Gesture::GESTURE_DRAG)) &&
+                                 		(gameplay::Game::getInstance()->getAbsoluteTime() - __pointer0.time >= GESTURE_DRAG_START_DURATION_MIN) &&
+                                		(delta >= GESTURE_DRAG_DISTANCE_MIN))
                             		{
                                 		gameplay::Platform::gestureDragEventInternal(x, y);
                                 		__gestureDraging = true;
@@ -1277,6 +1277,7 @@ int Platform::enterMessagePump()
         // Display the keyboard.
         gameplay::displayKeyboard(__state, __displayKeyboard);
     }
+    return 0;
 }
 
 void Platform::signalShutdown() 

+ 1 - 1
gameplay/src/Properties.cpp

@@ -688,7 +688,7 @@ Properties::Type Properties::getType(const char* name) const
     // Parse the value to determine the format
     unsigned int commaCount = 0;
     char* valuePtr = const_cast<char*>(value);
-    while (valuePtr = strchr(valuePtr, ','))
+    while ((valuePtr = strchr(valuePtr, ',')))
     {
         valuePtr++;
         commaCount++;

+ 1 - 1
gameplay/src/Texture.cpp

@@ -854,7 +854,7 @@ void Texture::generateMipmaps()
     {
         GL_ASSERT( glBindTexture(GL_TEXTURE_2D, _handle) );
         GL_ASSERT( glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST) );
-        if (glGenerateMipmap)
+        if (std::addressof(glGenerateMipmap))
             GL_ASSERT( glGenerateMipmap(GL_TEXTURE_2D) );
 
         _mipmapped = true;