Explicit typecasts to bool

This commit is contained in:
libretroadmin 2023-08-16 00:21:19 +02:00
parent bd7a0f7f0a
commit dadb5a6f41
2 changed files with 8 additions and 8 deletions

View File

@ -854,7 +854,7 @@ bool input_autoconfigure_disconnect(unsigned port, const char *name)
input_driver_state_t *input_st = input_state_get_ptr();
bool notification_show_autoconfig = settings ? settings->bools.notification_show_autoconfig : true;
bool pause_on_disconnect = settings ? settings->bools.pause_on_disconnect : true;
bool core_is_running = runloop_state_get_ptr()->flags & RUNLOOP_FLAG_CORE_RUNNING;
bool core_is_running = (runloop_state_get_ptr()->flags & RUNLOOP_FLAG_CORE_RUNNING) ? true : false;
if (port >= MAX_INPUT_DEVICES)
goto error;
@ -903,7 +903,7 @@ bool input_autoconfigure_disconnect(unsigned port, const char *name)
{
#ifdef HAVE_MENU
bool menu_pause_libretro = settings->bools.menu_pause_libretro;
bool menu_is_alive = menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE;
bool menu_is_alive = (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE) ? true : false;
if (menu_pause_libretro && !menu_is_alive)
command_event(CMD_EVENT_MENU_TOGGLE, NULL);

View File

@ -156,14 +156,14 @@ static void handle_translation_cb(
#ifdef HAVE_ACCESSIBILITY
input_driver_state_t *input_st = input_state_get_ptr();
#endif
video_driver_state_t
video_driver_state_t
*video_st = video_state_get_ptr();
const enum retro_pixel_format
video_driver_pix_fmt = video_st->pix_fmt;
access_state_t *access_st = access_state_get_ptr();
#ifdef HAVE_GFX_WIDGETS
bool gfx_widgets_paused = video_st->flags &
VIDEO_FLAG_WIDGETS_PAUSED;
bool gfx_widgets_paused = (video_st->flags &
VIDEO_FLAG_WIDGETS_PAUSED) ? true : false;
dispgfx_widget_t *p_dispwidget = dispwidget_get_ptr();
#endif
#ifdef HAVE_ACCESSIBILITY
@ -345,7 +345,7 @@ static void handle_translation_cb(
/* Write to video buffer directly (software cores only) */
/* This is a BMP file coming back. */
if ( raw_image_file_data[0] == 'B'
if ( raw_image_file_data[0] == 'B'
&& raw_image_file_data[1] == 'M')
{
/* Get image data (24 bit), and convert to the emulated pixel format */
@ -366,7 +366,7 @@ static void handle_translation_cb(
image_width * image_height * 3 * sizeof(uint8_t));
}
/* PNG coming back from the url */
else if (raw_image_file_data[1] == 'P'
else if (raw_image_file_data[1] == 'P'
&& raw_image_file_data[2] == 'N'
&& raw_image_file_data[3] == 'G')
{
@ -1155,7 +1155,7 @@ bool is_narrator_running(bool accessibility_enable)
accessibility_enable,
access_st->enabled))
{
frontend_ctx_driver_t *frontend =
frontend_ctx_driver_t *frontend =
frontend_state_get_ptr()->current_frontend_ctx;
if (frontend && frontend->is_narrator_running)
return frontend->is_narrator_running();