From a788009e7c9cf1cac6feee1710e74630609d12ec Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 13 Feb 2014 15:12:31 +0100 Subject: [PATCH] How nice - geom->base_width and geom->base_height are const, so we have to put them in local copies first --- gfx/gfx_common.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index 7facb4ca10..14736b73be 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -252,12 +252,16 @@ void gfx_set_config_viewport(void) aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; else { + unsigned base_width, base_height; + base_width = geom->base_width; + base_height = geom->base_height; + // Get around division by zero errors - if (geom->base_width == 0) - geom->base_width = 1; - if (geom->base_height == 0) - geom->base_height = 1; - aspectratio_lut[ASPECT_RATIO_CONFIG].value = (float)geom->base_width / geom->base_height; // 1:1 PAR. + if (base_width == 0) + base_width = 1; + if (base_height == 0) + base_height = 1; + aspectratio_lut[ASPECT_RATIO_CONFIG].value = (float)base_width / base_height; // 1:1 PAR. } } else