diff --git a/Makefile.ps3 b/Makefile.ps3 index e4c96fca7a..f3f29d18de 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -63,7 +63,7 @@ endif PPU_SRCS = griffin/griffin.c -DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT +DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD ifeq ($(DEX_BUILD), 1) DEFINES += -DDEX_BUILD diff --git a/dynamic.c b/dynamic.c index 972b85b97b..4795c22011 100644 --- a/dynamic.c +++ b/dynamic.c @@ -922,25 +922,27 @@ static bool dynamic_request_hw_context(enum retro_hw_context_type type, break; #endif - case RETRO_HW_CONTEXT_DIRECT3D: - switch(major) - { +#if defined(HAVE_D3D9) || defined(HAVE_D3D11) + case RETRO_HW_CONTEXT_DIRECT3D: + switch (major) + { #ifdef HAVE_D3D9 - case 9: - RARCH_LOG("Requesting D3D9 context.\n"); - break; + case 9: + RARCH_LOG("Requesting D3D9 context.\n"); + break; #endif #ifdef HAVE_D3D11 - case 11: - RARCH_LOG("Requesting D3D11 context.\n"); - break; + case 11: + RARCH_LOG("Requesting D3D11 context.\n"); + break; +#endif + default: + RARCH_LOG("Requesting unknown context.\n"); + return false; + } + break; #endif - default: - goto unknown; - } - break; -unknown: default: RARCH_LOG("Requesting unknown context.\n"); return false; diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index 3b25f340d9..caa6e56c93 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -138,7 +138,6 @@ void net_http_urlencode_full(char *dest, char *tmp = NULL; char url_domain[PATH_MAX_LENGTH] = {0}; char url_path[PATH_MAX_LENGTH] = {0}; - char url_encoded[PATH_MAX_LENGTH] = {0}; int count = 0; strlcpy (url_path, source, sizeof(url_path)); diff --git a/runahead/run_ahead.c b/runahead/run_ahead.c index e03eb23571..d8111ff1fb 100644 --- a/runahead/run_ahead.c +++ b/runahead/run_ahead.c @@ -28,6 +28,7 @@ static void unset_fast_savestate(void); static void set_hard_disable_audio(void); static void unset_hard_disable_audio(void); +/* TODO/FIXME - shouldn't this be signed size_t? */ static size_t runahead_save_state_size = -1; /* Save State List for Run Ahead */ @@ -197,19 +198,18 @@ static void runahead_check_for_gui(void) runahead_last_frame_count = frame_count; } -void run_ahead(int runAheadCount, bool useSecondary) +void run_ahead(int runahead_count, bool useSecondary) { - int frameNumber; - bool okay; - bool lastFrame; - bool suspendedFrame; + int frame_number = 0; + bool last_frame = false; + bool suspended_frame = false; #if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB) - const bool haveDynamic = true; + const bool have_dynamic = true; #else - const bool haveDynamic = false; + const bool have_dynamic = false; #endif - if (runAheadCount <= 0 || !runahead_available) + if (runahead_count <= 0 || !runahead_available) { core_run(); runahead_force_input_dirty = true; @@ -220,7 +220,8 @@ void run_ahead(int runAheadCount, bool useSecondary) { if (!runahead_create()) { - /* RunAhead has been disabled because the core does not support savestates. */ + /* RunAhead has been disabled because the core + * does not support savestates. */ core_run(); runahead_force_input_dirty = true; return; @@ -229,41 +230,44 @@ void run_ahead(int runAheadCount, bool useSecondary) runahead_check_for_gui(); - if (!useSecondary || !haveDynamic || !runahead_secondary_core_available) + if (!useSecondary || !have_dynamic || !runahead_secondary_core_available) { - /* TODO: multiple savestates for higher performance when not using secondary core */ - for (frameNumber = 0; frameNumber <= runAheadCount; frameNumber++) + /* TODO: multiple savestates for higher performance + * when not using secondary core */ + for (frame_number = 0; frame_number <= runahead_count; frame_number++) { - lastFrame = frameNumber == runAheadCount; - suspendedFrame = !lastFrame; + last_frame = frame_number == runahead_count; + suspended_frame = !last_frame; - if (suspendedFrame) + if (suspended_frame) { runahead_suspend_audio(); runahead_suspend_video(); } - if (frameNumber == 0) + if (frame_number == 0) core_run(); else core_run_no_input_polling(); - if (suspendedFrame) + if (suspended_frame) { runahead_resume_video(); runahead_resume_audio(); } - if (frameNumber == 0) + if (frame_number == 0) { - /* RunAhead has been disabled due to save state failure */ + /* RunAhead has been disabled due + * to save state failure */ if (!runahead_save_state()) return; } - if (lastFrame) + if (last_frame) { - /* RunAhead has been disabled due to load state failure */ + /* RunAhead has been disabled due + * to load state failure */ if (!runahead_load_state()) return; } @@ -272,6 +276,8 @@ void run_ahead(int runAheadCount, bool useSecondary) else { #if HAVE_DYNAMIC + bool okay = false; + /* run main core with video suspended */ runahead_suspend_video(); core_run(); @@ -291,7 +297,8 @@ void run_ahead(int runAheadCount, bool useSecondary) if (!runahead_load_state_secondary()) return; - for (frame_count = 0; frame_count < (unsigned)(runAheadCount - 1); frame_count++) + for (frame_count = 0; frame_count < + (unsigned)(runahead_count - 1); frame_count++) { runahead_suspend_video(); runahead_suspend_audio(); @@ -353,9 +360,9 @@ static bool runahead_create(void) static bool runahead_save_state(void) { + bool okay = false; retro_ctx_serialize_info_t *serialize_info = (retro_ctx_serialize_info_t*)runahead_save_state_list->data[0]; - bool okay; set_fast_savestate(); okay = core_serialize(serialize_info); unset_fast_savestate(); diff --git a/runahead/secondary_core.c b/runahead/secondary_core.c index efdd338463..768d29c5de 100644 --- a/runahead/secondary_core.c +++ b/runahead/secondary_core.c @@ -87,7 +87,6 @@ char* get_temp_directory_alloc(void) char* copy_core_to_temp_file(void) { - bool okay = false; char *tempDirectory = NULL; char *retroarchTempPath = NULL; char *tempDllPath = NULL; @@ -146,7 +145,6 @@ bool write_file_with_random_name(char **tempDllPath, { unsigned i; char numberBuf[32]; - bool okay = false; const char *prefix = "tmp"; time_t timeValue = time(NULL); unsigned int numberValue = (unsigned int)timeValue; @@ -298,8 +296,7 @@ bool secondary_core_run_no_input_polling(void) { if (!secondary_module) { - bool okay = secondary_core_create(); - if (!okay) + if (!secondary_core_create()) return false; } secondary_core.retro_run(); @@ -310,8 +307,7 @@ bool secondary_core_deserialize(const void *buffer, int size) { if (!secondary_module) { - bool okay = secondary_core_create(); - if (!okay) + if (!secondary_core_create()) { secondary_core_destroy(); return false;