@@ -232,7 +232,7 @@ gfx_display_ctx_driver_t gfx_display_ctx_ctr = {
232232static void * ctr_font_init (void * data , const char * font_path ,
233233 float font_size , bool is_threaded )
234234{
235- int i , j ;
235+ unsigned int i , j ;
236236 ctr_scale_vector_t * vec_top = NULL ;
237237 ctr_scale_vector_t * vec_bottom = NULL ;
238238 const uint8_t * src = NULL ;
@@ -321,7 +321,7 @@ static void ctr_font_free(void* data, bool is_threaded)
321321static int ctr_font_get_message_width (void * data , const char * msg ,
322322 size_t msg_len , float scale )
323323{
324- int i ;
324+ size_t i ;
325325 int delta_x = 0 ;
326326 const struct font_glyph * glyph_q = NULL ;
327327 ctr_font_t * font = (ctr_font_t * )data ;
@@ -361,7 +361,7 @@ static void ctr_font_render_line(
361361 float pos_y ,
362362 unsigned width , unsigned height , unsigned text_align )
363363{
364- unsigned i ;
364+ unsigned int i ;
365365 const struct font_glyph * glyph_q = NULL ;
366366 ctr_vertex_t * v = NULL ;
367367 int delta_x = 0 ;
@@ -504,7 +504,7 @@ static void ctr_font_render_message(
504504 for (;;)
505505 {
506506 const char * delim = strchr (msg , '\n' );
507- size_t msg_len = delim ? (delim - msg ) : strlen (msg );
507+ size_t msg_len = delim ? (size_t )( delim - msg ) : strlen (msg );
508508
509509 /* Draw the line */
510510 ctr_font_render_line (ctr , font , msg , msg_len ,
@@ -729,7 +729,7 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr)
729729#ifdef HAVE_OVERLAY
730730static void ctr_free_overlay (ctr_video_t * ctr )
731731{
732- int i ;
732+ unsigned int i ;
733733
734734 for (i = 0 ; i < ctr -> overlays ; i ++ )
735735 {
@@ -818,8 +818,10 @@ static void ctr_update_state_date(void *data)
818818 ctr_video_t * ctr = (ctr_video_t * )data ;
819819 time_t now = time (NULL );
820820 struct tm * t = localtime (& now );
821- snprintf (ctr -> state_date , sizeof (ctr -> state_date ), "%02d/%02d/%d" ,
822- t -> tm_mon + 1 , t -> tm_mday , t -> tm_year + 1900 );
821+ snprintf (ctr -> state_date , sizeof (ctr -> state_date ), "%02u/%02u/%u" ,
822+ ((unsigned )t -> tm_mon + 1 ) % 100 ,
823+ (unsigned )t -> tm_mday % 100 ,
824+ ((unsigned )t -> tm_year + 1900 ) % 10000 );
823825}
824826
825827static bool ctr_update_state_date_from_file (void * data )
@@ -846,10 +848,11 @@ static bool ctr_update_state_date_from_file(void *data)
846848
847849 ft = mtime ;
848850 t = localtime (& ft );
849- snprintf (ctr -> state_date , sizeof (ctr -> state_date ), "%02d/%02d/%d" ,
850- t -> tm_mon + 1 , t -> tm_mday , t -> tm_year + 1900 );
851-
852- return true;
851+ snprintf (ctr -> state_date , sizeof (ctr -> state_date ), "%02u/%02u/%u" ,
852+ ((unsigned )t -> tm_mon + 1 ) % 100 ,
853+ (unsigned )t -> tm_mday % 100 ,
854+ ((unsigned )t -> tm_year + 1900 ) % 10000 );
855+ return true;
853856
854857error :
855858 ctr -> state_data_exist = false;
@@ -1052,6 +1055,8 @@ static void ctr_bottom_menu_control(void* data, bool lcd_bottom, uint32_t flags)
10521055
10531056 switch (ctr -> bottom_menu )
10541057 {
1058+ case CTR_BOTTOM_MENU_NOT_AVAILABLE :
1059+ return ;
10551060 case CTR_BOTTOM_MENU_DEFAULT :
10561061 BIT64_SET (lifecycle_state , RARCH_MENU_TOGGLE );
10571062 break ;
@@ -1142,8 +1147,7 @@ static void ctr_bottom_menu_control(void* data, bool lcd_bottom, uint32_t flags)
11421147 ctr -> refresh_bottom_menu = true;
11431148 }
11441149
1145- if ( ctr -> bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE
1146- || (!(flags & RUNLOOP_FLAG_CORE_RUNNING )))
1150+ if (!(flags & RUNLOOP_FLAG_CORE_RUNNING ))
11471151 return ;
11481152
11491153
@@ -1580,6 +1584,9 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
15801584 case APTHOOK_ONWAKEUP :
15811585 command_event (CMD_EVENT_AUDIO_START , NULL );
15821586 break ;
1587+ case APTHOOK_ONEXIT :
1588+ case APTHOOK_COUNT :
1589+ break ;
15831590 }
15841591}
15851592
@@ -1792,7 +1799,7 @@ static void* ctr_init(const video_info_t* video,
17921799 video -> is_threaded ,
17931800 FONT_DRIVER_RENDER_CTR );
17941801
1795- ctr -> msg_rendering_enabled = false ;
1802+ ctr -> msg_rendering_enabled = true ;
17961803 ctr -> menu_texture_frame_enable = false;
17971804 ctr -> menu_texture_enable = false;
17981805
@@ -2058,7 +2065,7 @@ static bool ctr_frame(void* data, const void* frame,
20582065 }
20592066 else
20602067 {
2061- int i ;
2068+ unsigned int i ;
20622069 uint8_t * dst = (uint8_t * )ctr -> texture_linear ;
20632070 const uint8_t * src = frame ;
20642071
@@ -2195,11 +2202,9 @@ static bool ctr_frame(void* data, const void* frame,
21952202 }
21962203 }
21972204
2198- ctr -> msg_rendering_enabled = true;
21992205#ifdef HAVE_MENU
22002206 menu_driver_frame (menu_is_alive , video_info );
22012207#endif
2202- ctr -> msg_rendering_enabled = false;
22032208 }
22042209 else if (statistics_show )
22052210 {
@@ -2463,7 +2468,7 @@ static void ctr_free(void* data)
24632468static void ctr_set_texture_frame (void * data , const void * frame , bool rgb32 ,
24642469 unsigned width , unsigned height , float alpha )
24652470{
2466- int i ;
2471+ unsigned int i ;
24672472 uint16_t * dst ;
24682473 const uint16_t * src ;
24692474 ctr_video_t * ctr = (ctr_video_t * )data ;
@@ -2563,10 +2568,10 @@ static uintptr_t ctr_load_texture(void *video_data, void *data,
25632568 ctr_texture_t * texture = NULL ;
25642569 ctr_video_t * ctr = (ctr_video_t * )video_data ;
25652570 struct texture_image * image = (struct texture_image * )data ;
2566- int size = image -> width
2571+ u32 size = image -> width
25672572 * image -> height * sizeof (uint32_t );
25682573
2569- if ((size * 3 ) > linearSpaceFree ())
2574+ if ((u64 ) size * 3 > linearSpaceFree ())
25702575 return 0 ;
25712576
25722577 if (!ctr || !image || image -> width > 2048 || image -> height > 2048 )
@@ -2591,7 +2596,7 @@ static uintptr_t ctr_load_texture(void *video_data, void *data,
25912596
25922597 if ((image -> width <= 32 ) || (image -> height <= 32 ))
25932598 {
2594- int i , j ;
2599+ unsigned int i , j ;
25952600 uint32_t * src = (uint32_t * )image -> pixels ;
25962601
25972602 for (j = 0 ; j < image -> height ; j ++ )
@@ -2610,7 +2615,7 @@ static uintptr_t ctr_load_texture(void *video_data, void *data,
26102615 }
26112616 else
26122617 {
2613- int i ;
2618+ unsigned int i ;
26142619 uint32_t * src = NULL ;
26152620 uint32_t * dst = NULL ;
26162621
@@ -2716,7 +2721,7 @@ static void ctr_overlay_vertex_geom(void *data,
27162721static bool ctr_overlay_load (void * data ,
27172722 const void * image_data , unsigned num_images )
27182723{
2719- int i , j ;
2724+ unsigned int i , j ;
27202725 void * tmpdata ;
27212726 ctr_texture_t * texture = NULL ;
27222727 ctr_video_t * ctr = (ctr_video_t * )data ;
@@ -2823,7 +2828,7 @@ static void ctr_overlay_set_alpha(void *data, unsigned image, float mod){ }
28232828
28242829static void ctr_render_overlay (ctr_video_t * ctr )
28252830{
2826- int i ;
2831+ unsigned int i ;
28272832
28282833 for (i = 0 ; i < ctr -> overlays ; i ++ )
28292834 {
@@ -2905,7 +2910,7 @@ static const video_poke_interface_t ctr_poke_interface = {
29052910 ctr_apply_state_changes ,
29062911 ctr_set_texture_frame ,
29072912 ctr_set_texture_enable ,
2908- font_driver_render_msg ,
2913+ ctr_set_osd_msg ,
29092914 NULL , /* show_mouse */
29102915 NULL , /* grab_mouse_toggle */
29112916 NULL , /* get_current_shader */
0 commit comments