From 6c8d4b2ff0d25cf3fcfd8577c80ddb993840bfbe Mon Sep 17 00:00:00 2001 From: yabause Date: Mon, 10 Nov 2008 22:18:54 +0000 Subject: [PATCH] Patch by Magliocchetti Riccardo: fix shadowing of size variable, renamed the offender sz --- desmume/src/saves.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index 393db0080..a26c80731 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -514,35 +514,35 @@ static bool ReadStateChunk(std::istream* is, SFORMAT *sf, int size) while(is->tellg()read(toa,4); if(is->fail()) return false; - if(!read32le(&size,is)) return false; + if(!read32le(&sz,is)) return false; if(!read32le(&count,is)) return false; - if((tmp=CheckS(sf,size,count,toa))) + if((tmp=CheckS(sf,sz,count,toa))) { - if(size == 1) { + if(sz == 1) { //special case: read a huge byte array is->read((char *)tmp->v,count); } else { for(unsigned int i=0;iread((char *)tmp->v + i*size,size); + is->read((char *)tmp->v + i*sz,sz); #ifndef LOCAL_LE if(rlsb) - FlipByteOrder((u8*)tmp->v + i*size,size); + FlipByteOrder((u8*)tmp->v + i*sz,sz); #endif } } } else - is->seekg(size*count,std::ios::cur); + is->seekg(sz*count,std::ios::cur); } // while(...) return true; }