From 8a1cab9b744a5b85c5a27c6034d95ac464e65b2a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 14 Feb 2019 07:13:47 +0100 Subject: [PATCH] C89_BUILD buildfix --- gfx/video_crt_switch.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 085dfd8cd7..4092e1be1c 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -240,26 +240,24 @@ void crt_video_restore(void) int crt_compute_dynamic_width(int width) { - p_clock = 15000000; - - int min_height = 261; - int dynamic_width = 0; - #if defined(HAVE_VIDEOCORE) - p_clock = 32000000; - #endif - - - for (int i =0; i < 10; i++) - + unsigned i; + int dynamic_width = 0; + unsigned min_height = 261; +#if defined(HAVE_VIDEOCORE) + p_clock = 32000000; +#else + p_clock = 15000000; +#endif + for (i = 0; i < 10; i++) { dynamic_width = (width*1.5)*i; if ((dynamic_width * min_height * ra_core_hz) > p_clock) break; } - return dynamic_width; + return dynamic_width; } #if defined(HAVE_VIDEOCORE) @@ -373,19 +371,19 @@ static void crt_rpi_switch(int width, int height, float hz) width, hfp, hsp, hbp, height, vfp,vsp, vbp, hz, ip_flag, pixel_clock); - vcos_init (); + vcos_init(); - vchi_initialise (&vchi_instance); + vchi_initialise(&vchi_instance); - vchi_connect (NULL, 0, vchi_instance); + vchi_connect(NULL, 0, vchi_instance); - vc_vchi_gencmd_init (vchi_instance, &vchi_connection, 1); + vc_vchi_gencmd_init(vchi_instance, &vchi_connection, 1); - vc_gencmd (buffer, sizeof (buffer), set_hdmi_timing); + vc_gencmd(buffer, sizeof(buffer), set_hdmi_timing); - vc_gencmd_stop (); + vc_gencmd_stop(); - vchi_disconnect (vchi_instance); + vchi_disconnect(vchi_instance); snprintf(output1, sizeof(output1), "tvservice -e \"DMT 87\" > /dev/null");