From 4b027ed97563038d37b85a64a6b063130a8848ce Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 14 Feb 2015 06:09:45 +0100 Subject: [PATCH] (MSVC) Build fixes --- database_info.c | 4 +--- gfx/d3d/d3d.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/database_info.c b/database_info.c index 825220469b..cc700e586b 100644 --- a/database_info.c +++ b/database_info.c @@ -121,12 +121,10 @@ int database_info_write_rdl(const char *dir) static char *bin_to_hex_alloc(const uint8_t *data, size_t len) { size_t i; - char *ret=malloc(len*2+1); + char *ret= (char*)malloc(len*2+1); for (i = 0; i < len; i++) - { snprintf(ret+i*2, 3, "%02X", data[i]); - } return ret; } diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index 9f3622ebb4..c6c9220035 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -359,12 +359,12 @@ static void d3d_calculate_rect(d3d_video_t *d3d, { if (g_settings.video.aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - const video_viewport_t &custom = - g_extern.console.screen.viewports.custom_vp; + const video_viewport_t *custom = + &g_extern.console.screen.viewports.custom_vp; - if (custom) - d3d_set_viewport(d3d, custom.x, custom.y, - custom.width, custom.height); + if (custom) + d3d_set_viewport(d3d, custom->x, custom->y, + custom->width, custom->height); } else {