Emscripten: Deactivated and corrected debug log messages on joystick events.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 14 Feb 2015 15:16:41 +0100
changeset 9345 bf0874f4fd3a
parent 9344 83f4ab8fb0b8
child 9346 944aa9c47940
Emscripten: Deactivated and corrected debug log messages on joystick events.
src/joystick/emscripten/SDL_sysjoystick.c
--- a/src/joystick/emscripten/SDL_sysjoystick.c	Sat Feb 14 00:16:27 2015 +0100
+++ b/src/joystick/emscripten/SDL_sysjoystick.c	Sat Feb 14 15:16:41 2015 +0100
@@ -105,7 +105,9 @@
     }
 
     ++numjoysticks;
-    SDL_Log("%d",numjoysticks);
+#ifdef DEBUG_JOYSTICK
+    SDL_Log("Number of joysticks is %d", numjoysticks);
+#endif
 #if !SDL_EVENTS_DISABLED
     event.type = SDL_JOYDEVICEADDED;
 
@@ -118,7 +120,9 @@
     }
 #endif /* !SDL_EVENTS_DISABLED */
 
+#ifdef DEBUG_JOYSTICK
     SDL_Log("Added joystick with index %d", item->index);
+#endif
 
     return 1;
 }
@@ -144,7 +148,6 @@
         return 1;
     }
 
-    const int retval = item->device_instance;
     if (item->joystick) {
         item->joystick->hwdata = NULL;
     }
@@ -174,7 +177,9 @@
     }
 #endif /* !SDL_EVENTS_DISABLED */
 
-    SDL_Log("Removed joystick with index %d", retval);
+#ifdef DEBUG_JOYSTICK
+    SDL_Log("Removed joystick with id %d", item->device_instance);
+#endif
     SDL_free(item->name);
     SDL_free(item->mapping);
     SDL_free(item);