DC: Fix compilation

This commit is contained in:
Eugene Sandulenko 2016-08-04 13:08:25 +02:00
parent a4d39b2385
commit cb195a813b

View File

@ -269,16 +269,16 @@ public:
class OutVMSave : public Common::OutSaveFile {
private:
char *buffer;
int pos, size, committed;
int _pos, size, committed;
char filename[16];
bool iofailed;
public:
uint32 write(const void *buf, uint32 cnt);
virtual int32 pos() const { return pos; }
virtual int32 pos() const { return _pos; }
OutVMSave(const char *_filename)
: pos(0), committed(-1), iofailed(false)
: _pos(0), committed(-1), iofailed(false)
{
strncpy(filename, _filename, 16);
buffer = new char[size = MAX_SAVE_SIZE];
@ -321,14 +321,14 @@ void OutVMSave::finalize()
extern const char *gGameName;
extern Icon icon;
if (committed >= pos)
if (committed >= _pos)
return;
char *data = buffer;
int len = pos;
int len = _pos;
vmsaveResult r = writeSaveGame(gGameName, data, len, filename, icon);
committed = pos;
committed = _pos;
if (r != VMSAVE_OK)
iofailed = true;
displaySaveResult(r);
@ -387,13 +387,13 @@ bool InVMSave::seek(int32 offs, int whence)
uint32 OutVMSave::write(const void *buf, uint32 cnt)
{
int nbyt = cnt;
if (pos + nbyt > size) {
cnt = (size - pos);
if (_pos + nbyt > size) {
cnt = (size - _pos);
nbyt = cnt;
}
if (nbyt)
memcpy(buffer + pos, buf, nbyt);
pos += nbyt;
memcpy(buffer + _pos, buf, nbyt);
_pos += nbyt;
return cnt;
}