summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2014-12-26 23:16:54 -0500
committerRyan C. Gordon <icculus@icculus.org>2014-12-26 23:16:54 -0500
commit2bdda97c7710d327a1993a521530c1a4f5cbba32 (patch)
tree833b78bb4a78cfd2003c203f282a9c4740449b94 /src
parent3557a421920fb5c7108ae38866a91c014be9ad29 (diff)
Cleaned up some compiler warnings.
Diffstat (limited to 'src')
-rw-r--r--src/cpuinfo/SDL_cpuinfo.c10
-rw-r--r--src/joystick/emscripten/SDL_sysjoystick.c2
-rw-r--r--src/test/SDL_test_common.c4
-rw-r--r--src/video/emscripten/SDL_emscriptenframebuffer.c2
-rw-r--r--src/video/emscripten/SDL_emscriptenvideo.c2
5 files changed, 9 insertions, 11 deletions
diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index f4e4e93af4..48e8001f3a 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -458,10 +458,11 @@ SDL_GetCPUType(void)
if (!SDL_CPUType[0]) {
int i = 0;
- int a, b, c, d;
if (CPU_haveCPUID()) {
+ int a, b, c, d;
cpuid(0x00000000, a, b, c, d);
+ (void) a;
SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
@@ -563,15 +564,12 @@ int
SDL_GetCPUCacheLineSize(void)
{
const char *cpuType = SDL_GetCPUType();
-
+ int a, b, c, d;
+ (void) a; (void) b; (void) c; (void) d;
if (SDL_strcmp(cpuType, "GenuineIntel") == 0) {
- int a, b, c, d;
-
cpuid(0x00000001, a, b, c, d);
return (((b >> 8) & 0xff) * 8);
} else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) {
- int a, b, c, d;
-
cpuid(0x80000005, a, b, c, d);
return (c & 0xff);
} else {
diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c
index 5a948e7d86..62283c9f6f 100644
--- a/src/joystick/emscripten/SDL_sysjoystick.c
+++ b/src/joystick/emscripten/SDL_sysjoystick.c
@@ -281,7 +281,7 @@ SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int index)
SDL_joylist_item *item = JoystickByIndex(index);
if (item == NULL) {
SDL_SetError("Joystick with index %d not found", index);
- return NULL;
+ return 0;
}
return item->device_instance;
diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index c95f8142a1..4022d20df4 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -1204,10 +1204,10 @@ SDLTest_PrintEvent(SDL_Event * event)
event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure);
break;
case SDL_DOLLARGESTURE:
- SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, event->dgesture.gestureId);
+ SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, (long long) event->dgesture.gestureId);
break;
case SDL_DOLLARRECORD:
- SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, event->dgesture.gestureId);
+ SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, (long long) event->dgesture.gestureId);
break;
case SDL_MULTIGESTURE:
SDL_Log("SDL_EVENT: Multi gesture fingers: %d", event->mgesture.numFingers);
diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c
index 19f8c289ff..1c76923dd5 100644
--- a/src/video/emscripten/SDL_emscriptenframebuffer.c
+++ b/src/video/emscripten/SDL_emscriptenframebuffer.c
@@ -58,7 +58,6 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * form
int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
{
- static int frame_number;
SDL_Surface *surface;
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
@@ -115,6 +114,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec
}, surface->w, surface->h, surface->pixels);
/*if (SDL_getenv("SDL_VIDEO_Emscripten_SAVE_FRAMES")) {
+ static int frame_number = 0;
char file[128];
SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
SDL_GetWindowID(window), ++frame_number);
diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c
index 67142e9ad2..5da4292719 100644
--- a/src/video/emscripten/SDL_emscriptenvideo.c
+++ b/src/video/emscripten/SDL_emscriptenvideo.c
@@ -227,7 +227,7 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window)
return -1;
}
}
- wdata->egl_surface = SDL_EGL_CreateSurface(_this, NULL);
+ wdata->egl_surface = SDL_EGL_CreateSurface(_this, 0);
if (wdata->egl_surface == EGL_NO_SURFACE) {
return SDL_SetError("Could not create GLES window surface");