aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9/source/gbampsave.cpp
diff options
context:
space:
mode:
authorMax Horn2010-07-05 19:10:20 +0000
committerMax Horn2010-07-05 19:10:20 +0000
commit68d620ccab1be965c8b0f7373cb1280e11244139 (patch)
tree8482080884fce3f4636d14e5d0da8d41d79f1ba0 /backends/platform/ds/arm9/source/gbampsave.cpp
parent776c3a1d519838910732ab31b81b11cc5d122c88 (diff)
downloadscummvm-rg350-68d620ccab1be965c8b0f7373cb1280e11244139.tar.gz
scummvm-rg350-68d620ccab1be965c8b0f7373cb1280e11244139.tar.bz2
scummvm-rg350-68d620ccab1be965c8b0f7373cb1280e11244139.zip
DS: Fix warnings, make some vars static, cleanup
svn-id: r50701
Diffstat (limited to 'backends/platform/ds/arm9/source/gbampsave.cpp')
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index dbcc310fa3..d0fb8fff3b 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -47,10 +47,10 @@ GBAMPSaveFile::~GBAMPSaveFile() {
// consolePrintf("Closed file\n");
}
-uint32 GBAMPSaveFile::read(void *buf, uint32 size) {
- saveSize += size;
-// consolePrintf("Read %d %d ", size, saveSize);
- return DS::std_fread(buf, 1, size, handle);
+uint32 GBAMPSaveFile::read(void *buf, uint32 length) {
+ saveSize += length;
+// consolePrintf("Read %d %d ", length, saveSize);
+ return DS::std_fread(buf, 1, length, handle);
}
bool GBAMPSaveFile::eos() const {
@@ -77,27 +77,27 @@ int32 GBAMPSaveFile::pos() const {
int32 GBAMPSaveFile::size() const {
int position = pos();
DS::std_fseek(handle, 0, SEEK_END);
- int size = DS::std_ftell(handle);
+ int length = DS::std_ftell(handle);
DS::std_fseek(handle, position, SEEK_SET);
- return size;
+ return length;
}
-bool GBAMPSaveFile::seek(int32 pos, int whence) {
- return DS::std_fseek(handle, pos, whence) == 0;
+bool GBAMPSaveFile::seek(int32 newPos, int whence) {
+ return DS::std_fseek(handle, newPos, whence) == 0;
}
-uint32 GBAMPSaveFile::write(const void *buf, uint32 size) {
- if (bufferPos + size > SAVE_BUFFER_SIZE) {
+uint32 GBAMPSaveFile::write(const void *buf, uint32 length) {
+ if (bufferPos + length > SAVE_BUFFER_SIZE) {
flushSaveBuffer();
- saveSize += size;
-// consolePrintf("Writing %d bytes from %x", size, buf);
-// DS::std_fwrite(buf, 1, size, handle);
+ saveSize += length;
+// consolePrintf("Writing %d bytes from %x", length, buf);
+// DS::std_fwrite(buf, 1, length, handle);
- memcpy(buffer + bufferPos, buf, size);
- bufferPos += size;
+ memcpy(buffer + bufferPos, buf, length);
+ bufferPos += length;
- saveSize += size;
+ saveSize += length;
/* int pos = 0;
@@ -107,31 +107,31 @@ uint32 GBAMPSaveFile::write(const void *buf, uint32 size) {
bufferPos = 512;
pos += rest;
flushSaveBuffer();
- size -= rest;
+ length -= rest;
// consolePrintf("First section: %d\n", rest);
- while (size >= 512) {
+ while (length >= 512) {
DS::std_fwrite(((char *) (buf)) + pos, 1, 512, handle);
- size -= 512;
+ length -= 512;
pos += 512;
-// consolePrintf("Full chunk, %d left ", size);
+// consolePrintf("Full chunk, %d left ", length);
}
bufferPos = 0;
- memcpy(buffer + bufferPos, ((char *) (buf)) + pos, size);
- bufferPos += size;
+ memcpy(buffer + bufferPos, ((char *) (buf)) + pos, length);
+ bufferPos += length;
// consolePrintf("%d left in buffer ", bufferPos);*/
} else {
- memcpy(buffer + bufferPos, buf, size);
- bufferPos += size;
+ memcpy(buffer + bufferPos, buf, length);
+ bufferPos += length;
- saveSize += size;
+ saveSize += length;
}
-// if ((size > 100) || (size <= 0)) consolePrintf("Write %d bytes\n", size);
- return size;
+// if ((length > 100) || (length <= 0)) consolePrintf("Write %d bytes\n", length);
+ return length;
}