From ab1ab62a6d6b17fb0a6e4c18b79c33f2c553f695 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 5 Sep 2014 19:43:28 -0400 Subject: [PATCH] Fix some printf specifiers to the correct signed-ness --- audio/alsa_qsa.c | 2 +- audio/opensl.c | 2 +- audio/sdl_audio.c | 2 +- audio/xaudio.c | 2 +- dynamic.c | 2 +- frontend/menu/backend/menu_common_backend.c | 6 +++--- gfx/context/androidegl_ctx.c | 2 +- gfx/d3d9/d3d.cpp | 2 +- gfx/exynos_gfx.c | 2 +- gfx/gfx_common.c | 4 ++-- gfx/omap_gfx.c | 2 +- input/android_input.c | 4 ++-- input/input_common.c | 2 +- ps3/gcmgl/src/rgl_ps3_cg.cpp | 4 ++-- record/ffmpeg.c | 2 +- retroarch.c | 8 ++++---- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/audio/alsa_qsa.c b/audio/alsa_qsa.c index e011e4a3ac..a5e2d0d731 100644 --- a/audio/alsa_qsa.c +++ b/audio/alsa_qsa.c @@ -123,7 +123,7 @@ static void *alsa_qsa_init(const char *device, unsigned rate, unsigned latency) else alsa->buf_size = next_pow2(32 * latency); - RARCH_LOG("[ALSA QSA]: buffer size: %d bytes\n", alsa->buf_size); + RARCH_LOG("[ALSA QSA]: buffer size: %u bytes\n", alsa->buf_size); alsa->buf_count = (latency * 4 * rate + 500) / 1000; alsa->buf_count = (alsa->buf_count + alsa->buf_size / 2) / alsa->buf_size; diff --git a/audio/opensl.c b/audio/opensl.c index 4c2d17e81c..12f43e3f3d 100644 --- a/audio/opensl.c +++ b/audio/opensl.c @@ -116,7 +116,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency) if (!sl) goto error; - RARCH_LOG("[SLES]: Requested audio latency: %d ms.", latency); + RARCH_LOG("[SLES]: Requested audio latency: %u ms.", latency); GOTO_IF_FAIL(slCreateEngine(&sl->engine_object, 0, NULL, 0, NULL, NULL)); GOTO_IF_FAIL(SLObjectItf_Realize(sl->engine_object, SL_BOOLEAN_FALSE)); diff --git a/audio/sdl_audio.c b/audio/sdl_audio.c index db9107e99f..4e5391b247 100644 --- a/audio/sdl_audio.c +++ b/audio/sdl_audio.c @@ -96,7 +96,7 @@ static void *sdl_audio_init(const char *device, unsigned rate, unsigned latency) sdl->lock = slock_new(); sdl->cond = scond_new(); - RARCH_LOG("SDL audio: Requested %d ms latency, got %d ms\n", latency, (int)(out.samples * 4 * 1000 / g_settings.audio.out_rate)); + RARCH_LOG("SDL audio: Requested %u ms latency, got %d ms\n", latency, (int)(out.samples * 4 * 1000 / g_settings.audio.out_rate)); // Create a buffer twice as big as needed and prefill the buffer. size_t bufsize = out.samples * 4 * sizeof(int16_t); diff --git a/audio/xaudio.c b/audio/xaudio.c index 9793da7290..2014b9b9ef 100644 --- a/audio/xaudio.c +++ b/audio/xaudio.c @@ -37,7 +37,7 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency) size_t bufsize = latency * rate / 1000; - RARCH_LOG("XAudio2: Requesting %d ms latency, using %d ms latency.\n", + RARCH_LOG("XAudio2: Requesting %u ms latency, using %d ms latency.\n", latency, (int)bufsize * 1000 / rate); xa->bufsize = bufsize * 2 * sizeof(float); diff --git a/dynamic.c b/dynamic.c index e87e80969c..287690b73a 100644 --- a/dynamic.c +++ b/dynamic.c @@ -619,7 +619,7 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_GET_LANGUAGE: *(unsigned *)data = g_settings.user_language; - RARCH_LOG("Environ GET_LANGUAGE: \"%d\".\n", + RARCH_LOG("Environ GET_LANGUAGE: \"%u\".\n", g_settings.user_language); break; diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index f4f9c926bb..e085337024 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -2170,7 +2170,7 @@ static void menu_common_setting_set_label(char *type_str, unsigned height = gfx_ctx_get_resolution_height( g_extern.console.screen.resolutions.list [g_extern.console.screen.resolutions.current.idx]); - snprintf(type_str, type_str_size, "%dx%d", width, height); + snprintf(type_str, type_str_size, "%ux%u", width, height); } break; #endif @@ -2180,7 +2180,7 @@ static void menu_common_setting_set_label(char *type_str, strlcpy(type_str, "...", type_str_size); break; case MENU_SETTINGS_BIND_PLAYER: - snprintf(type_str, type_str_size, "#%d", + snprintf(type_str, type_str_size, "#%u", driver.menu->current_pad + 1); break; case MENU_SETTINGS_BIND_DEVICE: @@ -2196,7 +2196,7 @@ static void menu_common_setting_set_label(char *type_str, strlcpy(type_str, device_name, type_str_size); else snprintf(type_str, type_str_size, - "N/A (port #%u)", map); + "N/A (port #%d)", map); } else strlcpy(type_str, "Disabled", type_str_size); diff --git a/gfx/context/androidegl_ctx.c b/gfx/context/androidegl_ctx.c index 6c9db9f7b4..cfc25afea5 100644 --- a/gfx/context/androidegl_ctx.c +++ b/gfx/context/androidegl_ctx.c @@ -42,7 +42,7 @@ static bool g_es3; static void gfx_ctx_set_swap_interval(void *data, unsigned interval) { (void)data; - RARCH_LOG("gfx_ctx_set_swap_interval(%d).\n", interval); + RARCH_LOG("gfx_ctx_set_swap_interval(%u).\n", interval); eglSwapInterval(g_egl_dpy, interval); } diff --git a/gfx/d3d9/d3d.cpp b/gfx/d3d9/d3d.cpp index 3bf71d81ff..9f14ae1427 100644 --- a/gfx/d3d9/d3d.cpp +++ b/gfx/d3d9/d3d.cpp @@ -251,7 +251,7 @@ static bool d3d_init_multipass(d3d_video_t *d3d) gfx_shader_resolve_relative(&d3d->shader, d3d->cg_shader.c_str()); - RARCH_LOG("[D3D9 Meta-Cg] Found %d shaders.\n", d3d->shader.passes); + RARCH_LOG("[D3D9 Meta-Cg] Found %u shaders.\n", d3d->shader.passes); for (unsigned i = 0; i < d3d->shader.passes; i++) { diff --git a/gfx/exynos_gfx.c b/gfx/exynos_gfx.c index 3d685b275e..0d7fde6283 100644 --- a/gfx/exynos_gfx.c +++ b/gfx/exynos_gfx.c @@ -654,7 +654,7 @@ static int exynos_init(struct exynos_data *pdata, unsigned bpp) { } if (drm->mode == NULL) { - RARCH_ERR("video_exynos: requested resolution (%dx%d) not available\n", + RARCH_ERR("video_exynos: requested resolution (%ux%u) not available\n", g_settings.video.fullscreen_x, g_settings.video.fullscreen_y); goto fail; } diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index f6c338f7c6..6791622a5e 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -45,12 +45,12 @@ bool gfx_get_fps(char *buf, size_t size, char *buf_fps, size_t size_fps) last_fps = time_to_fps(time, new_time, FPS_UPDATE_INTERVAL); time = new_time; - snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count); + snprintf(buf, size, "%s || FPS: %6.1f || Frames: %u", g_extern.title_buf, last_fps, g_extern.frame_count); ret = true; } if (buf_fps) - snprintf(buf_fps, size_fps, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count); + snprintf(buf_fps, size_fps, "FPS: %6.1f || Frames: %u", last_fps, g_extern.frame_count); } else { diff --git a/gfx/omap_gfx.c b/gfx/omap_gfx.c index c00bc54389..f730782b2d 100644 --- a/gfx/omap_gfx.c +++ b/gfx/omap_gfx.c @@ -371,7 +371,7 @@ static int omapfb_alloc_mem(omapfb_data_t *pdata) { mi.size = mem_size; if (ioctl(pdata->fd, OMAPFB_SETUP_MEM, &mi) != 0) { - RARCH_ERR("video_omap: allocation of %d bytes of VRAM failed\n", mem_size); + RARCH_ERR("video_omap: allocation of %u bytes of VRAM failed\n", mem_size); return -1; } diff --git a/input/android_input.c b/input/android_input.c index 9aeb15728e..315553466f 100644 --- a/input/android_input.c +++ b/input/android_input.c @@ -358,12 +358,12 @@ static void handle_hotplug(android_input_t *android, { if (zeus_id < 0) { - RARCH_LOG("zeus_pad 1 detected: %d\n", id); + RARCH_LOG("zeus_pad 1 detected: %u\n", id); zeus_id = id; } else { - RARCH_LOG("zeus_pad 2 detected: %d\n", id); + RARCH_LOG("zeus_pad 2 detected: %u\n", id); zeus_second_id = id; } strlcpy(name_buf, "Xperia Play", sizeof(name_buf)); diff --git a/input/input_common.c b/input/input_common.c index dcbf7f7d02..171bcdf5c9 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -1387,7 +1387,7 @@ static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf, config_get_array(conf, "input_device", ident, sizeof(ident)); config_get_array(conf, "input_driver", input_driver, sizeof(input_driver)); - snprintf(ident_idx, sizeof(ident_idx), "%s_p%d", ident, index); + snprintf(ident_idx, sizeof(ident_idx), "%s_p%u", ident, index); //RARCH_LOG("ident_idx: %s\n", ident_idx); diff --git a/ps3/gcmgl/src/rgl_ps3_cg.cpp b/ps3/gcmgl/src/rgl_ps3_cg.cpp index b63d6a1949..d42147271e 100644 --- a/ps3/gcmgl/src/rgl_ps3_cg.cpp +++ b/ps3/gcmgl/src/rgl_ps3_cg.cpp @@ -2458,7 +2458,7 @@ void PopulateDataForParamArray( CgParameterEntry* paramEntry, CgParameterEntry* *nvParamStrings += prefixLengthIn; } // rest of array name for array and index - sprintf( *nvParamStrings, "%s[%d]", ( strtab->data + paramEntry->nameOffset ), element ); + sprintf( *nvParamStrings, "%s[%u]", ( strtab->data + paramEntry->nameOffset ), element ); if (!prefix) prefix = *nvParamStrings; @@ -2499,7 +2499,7 @@ void PopulateDataForParamArray( CgParameterEntry* paramEntry, CgParameterEntry* *nvParamStrings += prefixLengthIn; } // rest of array name for array and index - sprintf( *nvParamStrings, "%s[%d]", ( strtab->data + paramEntry->nameOffset ), element ); + sprintf( *nvParamStrings, "%s[%u]", ( strtab->data + paramEntry->nameOffset ), element ); *nvParamStrings += strlen( *nvParamStrings ); prefixLength = strlen( prefix ); diff --git a/record/ffmpeg.c b/record/ffmpeg.c index 4fbeb9fa27..fc5729b9b3 100644 --- a/record/ffmpeg.c +++ b/record/ffmpeg.c @@ -264,7 +264,7 @@ static void ffmpeg_audio_resolve_sample_rate(ffmpeg_t *handle, } params->sample_rate = best_rate; - RARCH_LOG("[FFmpeg]: Using output sampling rate: %u.\n", best_rate); + RARCH_LOG("[FFmpeg]: Using output sampling rate: %d.\n", best_rate); } } diff --git a/retroarch.c b/retroarch.c index eedbc9ab7e..21a88174e2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1934,7 +1934,7 @@ static void set_savestate_auto_index(void) dir_list_free(dir_list); g_settings.state_slot = max_index; - RARCH_LOG("Found last state slot: #%u\n", g_settings.state_slot); + RARCH_LOG("Found last state slot: #%d\n", g_settings.state_slot); } static void deinit_savefiles(void) @@ -2118,7 +2118,7 @@ static void rarch_save_state(const char *path, "Saved state to slot #-1 (auto)."); else snprintf(msg, sizeof_msg, - "Saved state to slot #%u.", g_settings.state_slot); + "Saved state to slot #%d.", g_settings.state_slot); } else snprintf(msg, sizeof_msg, @@ -2213,7 +2213,7 @@ static void state_slot(void) if (g_extern.msg_queue) msg_queue_clear(g_extern.msg_queue); - snprintf(msg, sizeof(msg), "State slot: %u", + snprintf(msg, sizeof(msg), "State slot: %d", g_settings.state_slot); if (g_extern.msg_queue) @@ -2378,7 +2378,7 @@ static void check_movie_record(bool pressed) if (g_settings.state_slot > 0) { - snprintf(path, sizeof(path), "%s%u.bsv", + snprintf(path, sizeof(path), "%s%d.bsv", g_extern.bsv.movie_path, g_settings.state_slot); } else