From b6ffe99fc8b3cc4178bfed75a0c5aa721ccc9aa2 Mon Sep 17 00:00:00 2001 From: squall-leonhart Date: Sat, 8 Mar 2014 07:11:53 +0000 Subject: [PATCH] updates subwcrev and applies minor fixes patch 46 --- src/Util.cpp | 7 +++---- src/gb/gbGfx.cpp | 4 ++-- src/gba/elf.cpp | 2 +- src/sdl/SDL.cpp | 7 ++++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Util.cpp b/src/Util.cpp index ff5051fc..25f3df4b 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -455,11 +455,10 @@ IMAGE_TYPE utilFindType(const char *file, char (&buffer)[2048]) pwText = new wchar_t[dwNum]; if(!pwText) { - delete []pwText; + return IMAGE_UNKNOWN; } MultiByteToWideChar (CP_ACP, 0, file, -1, pwText, dwNum ); char* file_conv = fex_wide_to_path( pwText); - delete []pwText; // if ( !utilIsImage( file_conv ) ) // TODO: utilIsArchive() instead? // { fex_t* fe = scan_arc(file_conv,utilIsImage,buffer); @@ -503,7 +502,7 @@ u8 *utilLoad(const char *file, pwText = new wchar_t[dwNum]; if(!pwText) { - delete []pwText; + return NULL; } MultiByteToWideChar (CP_ACP, 0, file, -1, pwText, dwNum ); char* file_conv = fex_wide_to_path( pwText); @@ -720,4 +719,4 @@ bool utilFileExists( const char *filename ) fclose( f ); return true; } -} \ No newline at end of file +} diff --git a/src/gb/gbGfx.cpp b/src/gb/gbGfx.cpp index 19adeeae..67cef3fc 100644 --- a/src/gb/gbGfx.cpp +++ b/src/gb/gbGfx.cpp @@ -266,7 +266,7 @@ void gbRenderLine() //bx >>= ((gbSCXLine[0]+(((swx>1) && (swx != 7)) ? 1 : 0)) & 7); - if ((swx == 7)) + if (swx == 7) { //wx = 0; if ((gbWindowLine>0) || (wy == 0)) @@ -572,4 +572,4 @@ void gbDrawSprites(bool draw) } } return; -} \ No newline at end of file +} diff --git a/src/gba/elf.cpp b/src/gba/elf.cpp index 47744431..27331858 100644 --- a/src/gba/elf.cpp +++ b/src/gba/elf.cpp @@ -1058,7 +1058,7 @@ void elfParseCFA(u8 *top) if(id == 0xffffffff) { // skip version - (*data++); + (*data)++; ELFcie *cie = (ELFcie *)calloc(1, sizeof(ELFcie)); diff --git a/src/sdl/SDL.cpp b/src/sdl/SDL.cpp index 932cc680..910e93e6 100644 --- a/src/sdl/SDL.cpp +++ b/src/sdl/SDL.cpp @@ -125,6 +125,7 @@ int desktopHeight = 0; Filter filter = kStretch2x; u8 *delta = NULL; +static const int delta_size = 322*242*4; int filter_enlarge = 2; @@ -1395,7 +1396,7 @@ void sdlPollEvents() soundPause(); } - memset(delta,255,sizeof(delta)); + memset(delta,255,delta_size); } } break; @@ -2311,8 +2312,8 @@ int main(int argc, char **argv) utilUpdateSystemColorMaps(); if(delta == NULL) { - delta = (u8*)malloc(322*242*4); - memset(delta, 255, 322*242*4); + delta = (u8*)malloc(delta_size); + memset(delta, 255, delta_size); } ifbFunction = initIFBFilter(ifbType, systemColorDepth);