diff --git a/Source/Core/Common/Src/ChunkFile.h b/Source/Core/Common/Src/ChunkFile.h index 38e1b2176c..cc893cc8e7 100644 --- a/Source/Core/Common/Src/ChunkFile.h +++ b/Source/Core/Common/Src/ChunkFile.h @@ -63,13 +63,13 @@ public: Mode GetMode() const {return mode;} u8 **GetPPtr() {return ptr;} - void DoVoid(void *data, int size) + void DoVoid(void *data, size_t size) { switch (mode) { case MODE_READ: memcpy(data, *ptr, size); break; case MODE_WRITE: memcpy(*ptr, data, size); break; case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything - case MODE_VERIFY: for(int i = 0; i < size; i++) _dbg_assert_msg_(COMMON, ((u8*)data)[i] == (*ptr)[i], "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); break; + case MODE_VERIFY: for(size_t i = 0; i < size; i++) _dbg_assert_msg_(COMMON, ((u8*)data)[i] == (*ptr)[i], "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); break; default: break; // throw an error? } (*ptr) += size; @@ -78,7 +78,7 @@ public: template void Do(std::map &x) { - unsigned int number = (unsigned int)x.size(); + size_t number = x.size(); Do(number); switch (mode) { case MODE_READ: @@ -126,18 +126,17 @@ public: template void Do(std::deque &x) { - u32 deq_size = (u32)x.size(); + size_t deq_size = x.size(); Do(deq_size); x.resize(deq_size); - u32 i; - for(i = 0; i < deq_size; i++) + for(size_t i = 0; i < deq_size; i++) DoVoid(&x[i],sizeof(T)); } // Store strings. void Do(std::string &x) { - int stringLen = (int)x.length() + 1; + size_t stringLen = (x.length() + 1); Do(stringLen); switch (mode) { @@ -151,7 +150,7 @@ public: void Do(std::wstring &x) { - int stringLen = sizeof(wchar_t)*((int)x.length() + 1); + size_t stringLen = sizeof(wchar_t)*(x.length() + 1); Do(stringLen); switch (mode) { @@ -164,7 +163,7 @@ public: } template - void DoArray(T *x, int count) { + void DoArray(T *x, size_t count) { DoVoid((void *)x, sizeof(T) * count); }