Skip to content

Commit

Permalink
Fix "variable set but not used" when HAVE_PATCH is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
schellingb authored and LibretroAdmin committed Jun 19, 2023
1 parent 4518b11 commit 2c9bc8d
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions tasks/task_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,6 @@ bool task_push_load_content_from_playlist_from_menu(

bool task_push_start_current_core(content_ctx_info_t *content_info)
{
uint16_t rarch_flags;
content_information_ctx_t content_ctx;
bool ret = true;
content_state_t *p_content = content_state_get_ptr();
Expand All @@ -2159,20 +2158,22 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
if (!content_info)
return false;

rarch_flags = retroarch_get_flags();
content_ctx.flags = 0;

if (check_firmware_before_loading)
content_ctx.flags |= CONTENT_INFO_FLAG_CHECK_FW_BEFORE_LOADING;
#ifdef HAVE_PATCH
if (rarch_flags & RARCH_FLAGS_IPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_IPS_PREF;
if (rarch_flags & RARCH_FLAGS_BPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_BPS_PREF;
if (rarch_flags & RARCH_FLAGS_UPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_UPS_PREF;
if (runloop_st->flags & RUNLOOP_FLAG_PATCH_BLOCKED)
content_ctx.flags |= CONTENT_INFO_FLAG_PATCH_IS_BLOCKED;
{
uint16_t rarch_flags = retroarch_get_flags();
if (rarch_flags & RARCH_FLAGS_IPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_IPS_PREF;
if (rarch_flags & RARCH_FLAGS_BPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_BPS_PREF;
if (rarch_flags & RARCH_FLAGS_UPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_UPS_PREF;
if (runloop_st->flags & RUNLOOP_FLAG_PATCH_BLOCKED)
content_ctx.flags |= CONTENT_INFO_FLAG_PATCH_IS_BLOCKED;
}
#endif
if (runloop_st->missing_bios)
content_ctx.flags |= CONTENT_INFO_FLAG_BIOS_IS_MISSING;
Expand Down Expand Up @@ -2370,7 +2371,6 @@ bool task_push_load_content_with_new_core_from_menu(
retro_task_callback_t cb,
void *user_data)
{
uint16_t rarch_flags;
content_information_ctx_t content_ctx;
content_state_t *p_content = content_state_get_ptr();
bool ret = true;
Expand All @@ -2392,20 +2392,22 @@ bool task_push_load_content_with_new_core_from_menu(
type, cb, user_data);
#endif

rarch_flags = retroarch_get_flags();
content_ctx.flags = 0;

if (check_firmware_before_loading)
content_ctx.flags |= CONTENT_INFO_FLAG_CHECK_FW_BEFORE_LOADING;
#ifdef HAVE_PATCH
if (rarch_flags & RARCH_FLAGS_IPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_IPS_PREF;
if (rarch_flags & RARCH_FLAGS_BPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_BPS_PREF;
if (rarch_flags & RARCH_FLAGS_UPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_UPS_PREF;
if (runloop_st->flags & RUNLOOP_FLAG_PATCH_BLOCKED)
content_ctx.flags |= CONTENT_INFO_FLAG_PATCH_IS_BLOCKED;
{
uint16_t rarch_flags = retroarch_get_flags();
if (rarch_flags & RARCH_FLAGS_IPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_IPS_PREF;
if (rarch_flags & RARCH_FLAGS_BPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_BPS_PREF;
if (rarch_flags & RARCH_FLAGS_UPS_PREF)
content_ctx.flags |= CONTENT_INFO_FLAG_IS_UPS_PREF;
if (runloop_st->flags & RUNLOOP_FLAG_PATCH_BLOCKED)
content_ctx.flags |= CONTENT_INFO_FLAG_PATCH_IS_BLOCKED;
}
#endif
if (runloop_st->missing_bios)
content_ctx.flags |= CONTENT_INFO_FLAG_BIOS_IS_MISSING;
Expand Down

0 comments on commit 2c9bc8d

Please sign in to comment.