From 4ca5d31f9b59c98d23751735913052a82280ead1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Sep 2015 18:12:02 +0200 Subject: [PATCH] Some more static code analysis nits when ran with enable=all --- audio/audio_utils.c | 4 ++-- audio/drivers/ctr_audio.c | 6 +++-- configuration.c | 21 ++++++++--------- core_options.c | 3 ++- cores/ffmpeg_core.c | 1 + gfx/d3d/d3d_wrapper.cpp | 6 ++--- gfx/drivers/dispmanx_gfx.c | 1 - gfx/drivers/gl.c | 3 ++- gfx/drivers/sunxi_gfx.c | 34 +++++++++++++-------------- gfx/drivers/vita2d_gfx.c | 9 ++++--- gfx/video_driver.c | 8 ++++--- gfx/video_viewport.c | 5 +++- input/drivers/android_input.c | 3 ++- input/drivers/qnx_input.c | 2 +- input/drivers/sdl_input.c | 10 ++++---- libretro-common/file/file_list.c | 3 +-- libretro-common/file/retro_file.c | 2 +- libretro-common/formats/tga/rtga.c | 2 +- libretro-common/gfx/scaler/pixconv.c | 35 +++++++++++++--------------- rewind.c | 3 ++- runloop.c | 2 ++ screenshot.c | 2 +- tasks/task_file_transfer.c | 5 ++-- 23 files changed, 89 insertions(+), 81 deletions(-) diff --git a/audio/audio_utils.c b/audio/audio_utils.c index 4863b587ca..316ae057ac 100644 --- a/audio/audio_utils.c +++ b/audio/audio_utils.c @@ -427,9 +427,9 @@ void audio_convert_init_simd(void) (void)cpu; #if defined(__ARM_NEON__) && !defined(VITA) - audio_convert_s16_to_float_arm = cpu & RETRO_SIMD_NEON ? + audio_convert_s16_to_float_arm = (cpu & RETRO_SIMD_NEON) ? audio_convert_s16_to_float_neon : audio_convert_s16_to_float_C; - audio_convert_float_to_s16_arm = cpu & RETRO_SIMD_NEON ? + audio_convert_float_to_s16_arm = (cpu & RETRO_SIMD_NEON) ? audio_convert_float_to_s16_neon : audio_convert_float_to_s16_C; #endif } diff --git a/audio/drivers/ctr_audio.c b/audio/drivers/ctr_audio.c index 299d11904d..55d0c148d6 100644 --- a/audio/drivers/ctr_audio.c +++ b/audio/drivers/ctr_audio.c @@ -157,14 +157,16 @@ static void ctr_audio_free(void *data) static ssize_t ctr_audio_write(void *data, const void *buf, size_t size) { int i; - uint32_t samples_played; - uint64_t current_tick; + uint32_t samples_played = 0; + uint64_t current_tick = 0; static struct retro_perf_counter ctraudio_f = {0}; const uint16_t *src = buf; ctr_audio_t *ctr = (ctr_audio_t*)data; (void)data; (void)buf; + (void)samples_played; + (void)current_tick; rarch_perf_init(&ctraudio_f, "ctraudio_f"); retro_perf_start(&ctraudio_f); diff --git a/configuration.c b/configuration.c index a2abc4c361..64a23d1f36 100644 --- a/configuration.c +++ b/configuration.c @@ -1215,9 +1215,10 @@ static bool config_load_file(const char *path, bool set_defaults) while (extra_path) { - bool ret = false; + bool ret = config_append_file(conf, extra_path); + RARCH_LOG("Config: appending config \"%s\"\n", extra_path); - ret = config_append_file(conf, extra_path); + if (!ret) RARCH_ERR("Config: failed to append config \"%s\"\n", extra_path); extra_path = strtok_r(NULL, "|", &save); @@ -1834,6 +1835,12 @@ bool config_load_override(void) settings_t *settings = config_get_ptr(); rarch_system_info_t *info = rarch_system_info_get_ptr(); + if (!global || !settings ) + { + RARCH_ERR("Could not obtain global pointer or configuration file pointer to retrieve path of retroarch.cfg.\n"); + return false; + } + /* Early return in case a library isn't loaded */ if (!info->info.library_name || !strcmp(info->info.library_name,"No Core")) return false; @@ -1841,12 +1848,6 @@ bool config_load_override(void) RARCH_LOG("Overrides: core name: %s\n", info->info.library_name); RARCH_LOG("Overrides: game name: %s\n", global->name.base); - if (!global || !settings ) - { - RARCH_ERR("Could not obtain global pointer or configuration file pointer to retrieve path of retroarch.cfg.\n"); - return false; - } - /* Config directory: config_directory. * Try config directory setting first, * fallback to the location of the current configuration file. */ @@ -2065,8 +2066,6 @@ bool config_load_remap(void) input_remapping_set_defaults(); } - new_conf = NULL; - /* Create a new config file from core_path */ new_conf = config_file_new(core_path); @@ -2200,7 +2199,6 @@ static void save_keybind_axis(config_file_t *conf, const char *prefix, const char *base, const struct retro_keybind *bind, bool save_empty) { char key[64] = {0}; - char config[16] = {0}; unsigned axis = 0; char dir = '\0'; @@ -2225,6 +2223,7 @@ static void save_keybind_axis(config_file_t *conf, const char *prefix, if (dir) { + char config[16]; snprintf(config, sizeof(config), "%c%u", dir, axis); config_set_string(conf, key, config); } diff --git a/core_options.c b/core_options.c index abf3a9c2e9..9df1aea179 100644 --- a/core_options.c +++ b/core_options.c @@ -92,7 +92,6 @@ void core_option_get(core_option_manager_t *opt, struct retro_variable *var) static bool parse_variable(core_option_manager_t *opt, size_t idx, const struct retro_variable *var) { - size_t i; const char *val_start = NULL; char *value = NULL; char *desc_end = NULL; @@ -126,6 +125,8 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx, if (config_get_string(opt->conf, option->key, &config_val)) { + size_t i; + for (i = 0; i < option->vals->size; i++) { if (!strcmp(option->vals->elems[i].data, config_val)) diff --git a/cores/ffmpeg_core.c b/cores/ffmpeg_core.c index 51570d7f5b..8c7828f0a2 100644 --- a/cores/ffmpeg_core.c +++ b/cores/ffmpeg_core.c @@ -310,6 +310,7 @@ static void check_variables(void) (void)var; (void)fft_var; + (void)fft_ms_var; #ifdef HAVE_OPENGL var.key = "ffmpeg_temporal_interp"; diff --git a/gfx/d3d/d3d_wrapper.cpp b/gfx/d3d/d3d_wrapper.cpp index 1bbc22ba7c..ccc69791f8 100644 --- a/gfx/d3d/d3d_wrapper.cpp +++ b/gfx/d3d/d3d_wrapper.cpp @@ -333,10 +333,6 @@ void d3d_texture_blit(unsigned pixel_size, LPDIRECT3DTEXTURE tex, D3DLOCKED_RECT *lr, const void *frame, unsigned width, unsigned height, unsigned pitch) { - unsigned y; - - (void)y; - #ifdef _XBOX D3DTexture_LockRect(tex, 0, lr, NULL, D3DLOCK_NOSYSLOCK); #if defined(_XBOX360) @@ -345,6 +341,7 @@ void d3d_texture_blit(unsigned pixel_size, XGCopySurface(lr->pBits, lr->Pitch, width, height, desc.Format, NULL, frame, pitch, desc.Format, NULL, 0, 0); #elif defined(_XBOX1) + unsigned y; for (y = 0; y < height; y++) { const uint8_t *in = (const uint8_t*)frame + y * pitch; @@ -356,6 +353,7 @@ void d3d_texture_blit(unsigned pixel_size, #else if (SUCCEEDED(tex->LockRect(0, lr, NULL, D3DLOCK_NOSYSLOCK))) { + unsigned y; for (y = 0; y < height; y++) { const uint8_t *in = (const uint8_t*)frame + y * pitch; diff --git a/gfx/drivers/dispmanx_gfx.c b/gfx/drivers/dispmanx_gfx.c index 88e0f3ffd5..c7bf4b897e 100644 --- a/gfx/drivers/dispmanx_gfx.c +++ b/gfx/drivers/dispmanx_gfx.c @@ -621,7 +621,6 @@ static void dispmanx_gfx_get_poke_interface(void *data, static void dispmanx_gfx_free(void *data) { struct dispmanx_video *_dispvars = data; - int i; dispmanx_surface_free(_dispvars, &_dispvars->main_surface); dispmanx_surface_free(_dispvars, &_dispvars->back_surface); if (_dispvars->menu_surface != NULL) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index bbb7d253b0..eb9c2397e8 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -865,7 +865,6 @@ static void gl_set_viewport(void *data, unsigned viewport_width, } else if (gl->keep_aspect && !force_full) { - float delta; float desired_aspect = video_driver_get_aspect_ratio(); #if defined(HAVE_MENU) @@ -882,6 +881,8 @@ static void gl_set_viewport(void *data, unsigned viewport_width, else #endif { + float delta; + if (fabsf(device_aspect - desired_aspect) < 0.0001f) { /* If the aspect ratios of screen and desired aspect diff --git a/gfx/drivers/sunxi_gfx.c b/gfx/drivers/sunxi_gfx.c index a57abda817..758d52c108 100644 --- a/gfx/drivers/sunxi_gfx.c +++ b/gfx/drivers/sunxi_gfx.c @@ -724,7 +724,6 @@ static void sunxi_setup_scale (void *data, unsigned width, unsigned height, unsigned pitch) { int i; - float aspect; unsigned int xpos, visible_width; struct sunxi_video *_dispvars = (struct sunxi_video*)data; settings_t *settings = config_get_ptr(); @@ -879,12 +878,11 @@ static void sunxi_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha) { struct sunxi_video *_dispvars = (struct sunxi_video*)data; - - if (_dispvars->menu_active) { - uint16_t src_pix; - uint32_t R, G, B, dst_pix; + + if (_dispvars->menu_active) + { unsigned int i, j; - + /* We have to go on a pixel format conversion adventure for now, until we can * convince RGUI to output in an 8888 format. */ unsigned int src_pitch = width * 2; @@ -898,22 +896,22 @@ static void sunxi_set_texture_frame(void *data, const void *frame, bool rgb32, for (i = 0; i < height; i++) { - for (j = 0; j < src_pitch / 2; j++) - { - src_pix = *((uint16_t*)frame + (src_pitch / 2 * i) + j); - /* The hex AND is for keeping only the part we need for each component. */ - R = (src_pix << 8) & 0x00FF0000; - G = (src_pix << 4) & 0x0000FF00; - B = (src_pix << 0) & 0x000000FF; - line[j] = (0 | R | G | B); - } - memcpy(dst_base_addr + (dst_pitch * i), (char*)line, dst_pitch); + for (j = 0; j < src_pitch / 2; j++) + { + uint16_t src_pix = *((uint16_t*)frame + (src_pitch / 2 * i) + j); + /* The hex AND is for keeping only the part we need for each component. */ + uint32_t R = (src_pix << 8) & 0x00FF0000; + uint32_t G = (src_pix << 4) & 0x0000FF00; + uint32_t B = (src_pix << 0) & 0x000000FF; + line[j] = (0 | R | G | B); + } + memcpy(dst_base_addr + (dst_pitch * i), (char*)line, dst_pitch); } /* Issue pageflip. Will flip on next vsync. */ sunxi_layer_set_rgb_input_buffer(_dispvars->sunxi_disp, - _dispvars->sunxi_disp->bits_per_pixel, - _dispvars->pages[0].offset, width, height, _dispvars->sunxi_disp->xres); + _dispvars->sunxi_disp->bits_per_pixel, + _dispvars->pages[0].offset, width, height, _dispvars->sunxi_disp->xres); } } diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index 6ae2d33117..062e599189 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -117,9 +117,8 @@ static bool vita2d_gfx_frame(void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg) { - int i, j; + int i; void *tex_p; - unsigned int stride; vita_video_t *vita = (vita_video_t *)data; (void)frame; @@ -130,6 +129,9 @@ static bool vita2d_gfx_frame(void *data, const void *frame, if (frame) { + unsigned j; + unsigned int stride; + if ((width != vita->width || height != vita->height) && vita->texture) { vita2d_free_texture(vita->texture); @@ -316,7 +318,6 @@ static void vita2d_gfx_update_viewport(vita_video_t* vita) } else if (vita->keep_aspect) { - float delta; float desired_aspect = video_driver_get_aspect_ratio(); if (vita->rotation == ORIENTATION_VERTICAL || vita->rotation == ORIENTATION_FLIPPED_ROTATED){ @@ -340,6 +341,8 @@ static void vita2d_gfx_update_viewport(vita_video_t* vita) else #endif { + float delta; + if ((fabsf(device_aspect - desired_aspect) < 0.0001f)) { /* If the aspect ratios of screen and desired aspect diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 384a6c57ea..fb2bf665c0 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -931,8 +931,10 @@ void video_monitor_adjust_system_rates(void) settings_t *settings = config_get_ptr(); rarch_system_info_t *system = rarch_system_info_get_ptr(); - if (system) - system->force_nonblock = false; + if (!system) + return; + + system->force_nonblock = false; if (av_info) info = (const struct retro_system_timing*)&av_info->timing; @@ -1093,7 +1095,6 @@ bool video_monitor_fps_statistics(double *refresh_rate, bool video_monitor_get_fps(char *buf, size_t size, char *buf_fps, size_t size_fps) { - static float last_fps; retro_time_t new_time; static retro_time_t curr_time; static retro_time_t fps_time; @@ -1105,6 +1106,7 @@ bool video_monitor_get_fps(char *buf, size_t size, if (video_frame_count) { + static float last_fps; bool ret = false; unsigned write_index = video_state.frame_time_samples_count++ & (MEASURE_FRAME_TIME_SAMPLES_COUNT - 1); diff --git a/gfx/video_viewport.c b/gfx/video_viewport.c index 282e8902bf..9fa7c8f669 100644 --- a/gfx/video_viewport.c +++ b/gfx/video_viewport.c @@ -120,7 +120,10 @@ void video_viewport_set_config(void) { struct retro_game_geometry *geom = &av_info->geometry; - if (geom && geom->aspect_ratio > 0.0f && settings->video.aspect_ratio_auto) + if (!geom) + return; + + if (geom->aspect_ratio > 0.0f && settings->video.aspect_ratio_auto) aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; else { diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 36ed23c5e8..cc356d46db 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -738,7 +738,7 @@ static void handle_hotplug(android_input_t *android, if (settings->input.autodetect_enable) { - bool autoconfigured = false; + bool autoconfigured; autoconfig_params_t params = {{0}}; RARCH_LOG("Port %d: %s VID/PID: %d/%d\n", *port, name_buf, params.vid, params.pid); @@ -752,6 +752,7 @@ static void handle_hotplug(android_input_t *android, strlcpy(params.driver, android_joypad.ident, sizeof(params.driver)); autoconfigured = input_config_autoconfigure_joypad(¶ms); + if (autoconfigured) { if (settings->input.autoconf_binds[*port][RARCH_MENU_TOGGLE].joykey != 0) diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index 483e7e8c9f..8a8d0d4685 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -149,7 +149,7 @@ static void qnx_process_gamepad_event( *state_cur = 0; for (i = 0; i < 20; i++) - *state_cur |= (controller->buttons & (1 << i) ? (1 << i) : 0); + *state_cur |= ((controller->buttons & (1 << i)) ? (1 << i) : 0); if (controller->analogCount > 0) screen_get_event_property_iv(screen_event, diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 53b527f3fb..02e491f500 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -491,12 +491,12 @@ static void sdl_poll_mouse(sdl_input_t *sdl) SDL_GetMouseState(&sdl->mouse_abs_x, &sdl->mouse_abs_y); - sdl->mouse_l = SDL_BUTTON(SDL_BUTTON_LEFT) & btn ? 1 : 0; - sdl->mouse_r = SDL_BUTTON(SDL_BUTTON_RIGHT) & btn ? 1 : 0; - sdl->mouse_m = SDL_BUTTON(SDL_BUTTON_MIDDLE) & btn ? 1 : 0; + sdl->mouse_l = (SDL_BUTTON(SDL_BUTTON_LEFT) & btn) ? 1 : 0; + sdl->mouse_r = (SDL_BUTTON(SDL_BUTTON_RIGHT) & btn) ? 1 : 0; + sdl->mouse_m = (SDL_BUTTON(SDL_BUTTON_MIDDLE) & btn) ? 1 : 0; #ifndef HAVE_SDL2 - sdl->mouse_wu = SDL_BUTTON(SDL_BUTTON_WHEELUP) & btn ? 1 : 0; - sdl->mouse_wd = SDL_BUTTON(SDL_BUTTON_WHEELDOWN) & btn ? 1 : 0; + sdl->mouse_wu = (SDL_BUTTON(SDL_BUTTON_WHEELUP) & btn) ? 1 : 0; + sdl->mouse_wd = (SDL_BUTTON(SDL_BUTTON_WHEELDOWN) & btn) ? 1 : 0; #endif } diff --git a/libretro-common/file/file_list.c b/libretro-common/file/file_list.c index 49853aee80..5279bf2651 100644 --- a/libretro-common/file/file_list.c +++ b/libretro-common/file/file_list.c @@ -131,8 +131,7 @@ void file_list_free(file_list_t *list) if (list->list) free(list->list); list->list = NULL; - if (list) - free(list); + free(list); } void file_list_clear(file_list_t *list) diff --git a/libretro-common/file/retro_file.c b/libretro-common/file/retro_file.c index 470e0f76ae..f07959f7fe 100644 --- a/libretro-common/file/retro_file.c +++ b/libretro-common/file/retro_file.c @@ -238,7 +238,7 @@ void retro_frewind(RFILE *stream) ssize_t retro_fread(RFILE *stream, void *s, size_t len) { - if (!stream) + if (!stream || !s) return -1; #if defined(VITA) || defined(PSP) return sceIoRead(stream->fd, s, len); diff --git a/libretro-common/formats/tga/rtga.c b/libretro-common/formats/tga/rtga.c index fc0348e781..958b5c6e03 100644 --- a/libretro-common/formats/tga/rtga.c +++ b/libretro-common/formats/tga/rtga.c @@ -33,7 +33,7 @@ bool rtga_image_load_shift(uint8_t *buf, const uint8_t *tmp = NULL; struct texture_image *out_img = (struct texture_image*)data; - if (buf[2] != 2) + if (!buf || buf[2] != 2) { fprintf(stderr, "TGA image is not uncompressed RGB.\n"); goto error; diff --git a/libretro-common/gfx/scaler/pixconv.c b/libretro-common/gfx/scaler/pixconv.c index 59d35a2cb3..1d9465af79 100644 --- a/libretro-common/gfx/scaler/pixconv.c +++ b/libretro-common/gfx/scaler/pixconv.c @@ -41,7 +41,7 @@ void conv_rgb565_0rgb1555(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint16_t *output = (uint16_t*)output_; @@ -55,7 +55,7 @@ void conv_rgb565_0rgb1555(void *output_, const void *input_, for (h = 0; h < height; h++, output += out_stride >> 1, input += in_stride >> 1) { - w = 0; + unsigned w = 0; #if defined(__SSE2_) for (; w < max_width; w += 8) { @@ -80,7 +80,7 @@ void conv_0rgb1555_rgb565(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint16_t *output = (uint16_t*)output_; @@ -96,7 +96,7 @@ void conv_0rgb1555_rgb565(void *output_, const void *input_, for (h = 0; h < height; h++, output += out_stride >> 1, input += in_stride >> 1) { - w = 0; + unsigned w = 0; #if defined(__SSE2__) for (; w < max_width; w += 8) { @@ -124,7 +124,7 @@ void conv_0rgb1555_argb8888(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint32_t *output = (uint32_t*)output_; @@ -141,7 +141,7 @@ void conv_0rgb1555_argb8888(void *output_, const void *input_, for (h = 0; h < height; h++, output += out_stride >> 2, input += in_stride >> 1) { - w = 0; + unsigned w = 0; #ifdef __SSE2__ for (; w < max_width; w += 8) { @@ -191,7 +191,7 @@ void conv_rgb565_argb8888(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint32_t *output = (uint32_t*)output_; @@ -210,7 +210,7 @@ void conv_rgb565_argb8888(void *output_, const void *input_, for (h = 0; h < height; h++, output += out_stride >> 2, input += in_stride >> 1) { - w = 0; + unsigned w = 0; #if defined(__SSE2__) for (; w < max_width; w += 8) { @@ -385,7 +385,7 @@ void conv_0rgb1555_bgr24(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint8_t *output = (uint8_t*)output_; @@ -403,8 +403,8 @@ void conv_0rgb1555_bgr24(void *output_, const void *input_, h++, output += out_stride, input += in_stride >> 1) { uint8_t *out = output; + unsigned w = 0; - w = 0; #if defined(__SSE2__) for (; w < max_width; w += 16, out += 48) { @@ -471,7 +471,7 @@ void conv_rgb565_bgr24(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint16_t *input = (const uint16_t*)input_; uint8_t *output = (uint8_t*)output_; @@ -490,8 +490,7 @@ void conv_rgb565_bgr24(void *output_, const void *input_, for (h = 0; h < height; h++, output += out_stride, input += in_stride >> 1) { uint8_t *out = output; - - w = 0; + unsigned w = 0; #if defined(__SSE2__) for (; w < max_width; w += 16, out += 48) { @@ -601,7 +600,7 @@ void conv_argb8888_bgr24(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint32_t *input = (const uint32_t*)input_; uint8_t *output = (uint8_t*)output_; @@ -613,8 +612,7 @@ void conv_argb8888_bgr24(void *output_, const void *input_, h++, output += out_stride, input += in_stride >> 2) { uint8_t *out = output; - - w = 0; + unsigned w = 0; #if defined(__SSE2__) for (; w < max_width; w += 16, out += 48) { @@ -668,7 +666,7 @@ void conv_yuyv_argb8888(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) { - int h, w; + int h; const uint8_t *input = (const uint8_t*)input_; uint32_t *output = (uint32_t*)output_; @@ -692,8 +690,7 @@ void conv_yuyv_argb8888(void *output_, const void *input_, { const uint8_t *src = input; uint32_t *dst = output; - - w = 0; + unsigned w = 0; #if defined(__SSE2__) /* Each loop processes 16 pixels. */ diff --git a/rewind.c b/rewind.c index 8436d3157c..66fc948b6e 100644 --- a/rewind.c +++ b/rewind.c @@ -321,11 +321,12 @@ void state_manager_raw_decompress(const void *patch, for (;;) { - uint16_t i; uint16_t numchanged = *(patch16++); if (numchanged) { + uint16_t i; + out16 += *patch16++; /* We could do memcpy, but it seems that memcpy has a diff --git a/runloop.c b/runloop.c index b097c6d10f..523def566e 100644 --- a/runloop.c +++ b/runloop.c @@ -1038,7 +1038,9 @@ int rarch_main_iterate(unsigned *sleep_ms) unlock_autosave(); #endif +#ifdef HAVE_MENU end: +#endif if (!settings->fastforward_ratio) return 0; diff --git a/screenshot.c b/screenshot.c index bb5259eb16..42b41e127e 100644 --- a/screenshot.c +++ b/screenshot.c @@ -56,12 +56,12 @@ static bool screenshot_dump(const char *folder, const void *frame, unsigned width, unsigned height, int pitch, bool bgr24) { + bool ret; char filename[PATH_MAX_LENGTH] = {0}; char shotname[PATH_MAX_LENGTH] = {0}; struct scaler_ctx scaler = {0}; RFILE *file = NULL; uint8_t *out_buffer = NULL; - bool ret = false; driver_t *driver = driver_get_ptr(); (void)file; diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c index 77c617556e..29eabdc913 100644 --- a/tasks/task_file_transfer.c +++ b/tasks/task_file_transfer.c @@ -598,13 +598,14 @@ static int rarch_main_data_nbio_iterate_parse_free(nbio_handle_t *nbio) static int rarch_main_data_nbio_iterate_parse(nbio_handle_t *nbio) { - int len = 0; - if (!nbio) return -1; if (nbio->cb) + { + int len = 0; nbio->cb(nbio, len); + } return 0; }