From 5bcde44684eea5f6ddeeb12351590ae2a1758f24 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 27 Jan 2011 23:05:20 +0100 Subject: [PATCH] Remove some undeeded warning/error messages. --- file.c | 10 +++------- gfx/gl.c | 4 ---- input/sdl.c | 5 ----- settings.c | 4 +--- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/file.c b/file.c index 13e3f9bff1..e773a6fc1a 100644 --- a/file.c +++ b/file.c @@ -112,10 +112,7 @@ static ssize_t read_file(const char *path, void **buf) void *rom_buf = NULL; FILE *file = fopen(path, "rb"); if (!file) - { - SSNES_ERR("Couldn't open file: \"%s\"\n", path); goto error; - } fseek(file, 0, SEEK_END); long len = ftell(file); @@ -148,10 +145,7 @@ static bool dump_to_file(const char *path, const void *data, size_t size) { FILE *file = fopen(path, "wb"); if (!file) - { - SSNES_ERR("Couldn't dump to file %s\n", path); return false; - } else { fwrite(data, 1, size, file); @@ -178,6 +172,8 @@ bool save_state(const char* path) psnes_serialize(data, size); bool ret = dump_to_file(path, data, size); free(data); + if (!ret) + SSNES_ERR("Failed to save state to \"%s\".\n", path); return ret; } @@ -188,7 +184,7 @@ bool load_state(const char* path) ssize_t size = read_file(path, &buf); if (size < 0) { - SSNES_ERR("Failed to load state.\n"); + SSNES_ERR("Failed to load state from \"%s\".\n", path); return false; } else diff --git a/gfx/gl.c b/gfx/gl.c index cd34597675..92df4d59f9 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -424,14 +424,10 @@ static void gl_set_nonblock_state(void *data, bool state) SSNES_LOG("GL VSync => %s\n", state ? "off" : "on"); #ifdef _WIN32 static BOOL (APIENTRY *wgl_swap_interval)(int) = NULL; - if (!wgl_swap_interval) - SSNES_WARN("SDL VSync toggling seems to be broken, attempting to use WGL VSync call directly instead.\n"); if (!wgl_swap_interval) wgl_swap_interval = (BOOL (APIENTRY*)(int)) wglGetProcAddress("wglSwapIntervalEXT"); if (wgl_swap_interval) wgl_swap_interval(state ? 0 : 1); #else static int (*glx_swap_interval)(int) = NULL; - if (!glx_swap_interval) - SSNES_WARN("SDL VSync toggling seems to be broken, attempting to use GLX VSync call directly instead.\n"); if (!glx_swap_interval) glx_swap_interval = (int (*)(int))glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalSGI"); if (!glx_swap_interval) glx_swap_interval = (int (*)(int))glXGetProcAddressARB((const GLubyte*)"glXSwapIntervalMESA"); if (glx_swap_interval) glx_swap_interval(state ? 0 : 1); diff --git a/input/sdl.c b/input/sdl.c index 7823aaec03..66b9561193 100644 --- a/input/sdl.c +++ b/input/sdl.c @@ -59,11 +59,6 @@ static void* sdl_input_init(void) sdl->num_buttons[i] = SDL_JoystickNumButtons(sdl->joysticks[i]); sdl->num_hats[i] = SDL_JoystickNumHats(sdl->joysticks[i]); } - else - { - SSNES_WARN("Desired SDL joystick #%u on port %u, but SDL can only detect %u joysticks ...\n", - g_settings.input.joypad_map[i], i + 1, sdl->num_joysticks); - } } return sdl; diff --git a/settings.c b/settings.c index 4ddaabca52..dc0397b9c1 100644 --- a/settings.c +++ b/settings.c @@ -132,10 +132,8 @@ static void set_defaults(void) memcpy(g_settings.input.binds[4], snes_keybinds_5, sizeof(snes_keybinds_5)); g_settings.input.axis_threshold = AXIS_THRESHOLD; - for (int i = 0; i < 2; i++) + for (int i = 0; i < MAX_PLAYERS; i++) g_settings.input.joypad_map[i] = i; - for (int i = 2; i < MAX_PLAYERS; i++) - g_settings.input.joypad_map[i] = SSNES_NO_JOYPAD; } #ifdef HAVE_CONFIGFILE