Remove some undeeded warning/error messages.

This commit is contained in:
Themaister 2011-01-27 23:05:20 +01:00
parent 2459793f9c
commit 5bcde44684
4 changed files with 4 additions and 19 deletions

10
file.c
View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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