Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Made it possible to compile this in VC++ 2008 Express.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugetab committed May 21, 2010
1 parent e773422 commit 0eabceb
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 82 deletions.
50 changes: 25 additions & 25 deletions mednafen/src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ bool MDFNFILE::ApplyIPS(MDFNFILE *ips)
uint8 header[5];
uint32 count = 0;

//MDFN_printf(_("Applying IPS file \"%s\"...\n"), path);
//MDFN_printf("Applying IPS file \"%s\"...\n", path);

MDFN_indent(1);
if(ips->fread(header, 1, 5) != 5 || memcmp(header, "PATCH", 5))
{
MDFN_PrintError(_("IPS file \"%s\" is not valid!"), /*path*/ ""); // FIXME
MDFN_PrintError("IPS file \"%s\" is not valid!", /*path*/ ""); // FIXME
MDFN_indent(-1);
return(0);
}
Expand Down Expand Up @@ -120,7 +120,7 @@ bool MDFNFILE::ApplyIPS(MDFNFILE *ips)

if(!memcmp(header, "EOF", 3))
{
MDFN_printf(_("IPS EOF: Did %d patches\n\n"),count);
MDFN_printf("IPS EOF: Did %d patches\n\n",count);
MDFN_indent(-1);
return(1);
}
Expand All @@ -147,7 +147,7 @@ bool MDFNFILE::ApplyIPS(MDFNFILE *ips)

if((offset + patch_size) > MaxROMImageSize)
{
MDFN_PrintError(_("ROM image will be too large after IPS patch; maximum size allowed is %llu bytes."), (unsigned long long)MaxROMImageSize);
MDFN_PrintError("ROM image will be too large after IPS patch; maximum size allowed is %llu bytes.", (unsigned long long)MaxROMImageSize);
return(0);
}

Expand Down Expand Up @@ -195,8 +195,8 @@ bool MDFNFILE::ApplyIPS(MDFNFILE *ips)
count++;
}

MDFN_printf(_("Warning: IPS ended without an EOF chunk.\n"));
MDFN_printf(_("IPS EOF: Did %d patches\n\n"), count);
MDFN_printf("Warning: IPS ended without an EOF chunk.\n");
MDFN_printf("IPS EOF: Did %d patches\n\n", count);

MDFN_indent(-1);

Expand All @@ -222,7 +222,7 @@ bool MDFNFILE::MakeMemWrap(void *tz, int type)

if(size > MaxROMImageSize)
{
MDFN_PrintError(_("ROM image is too large; maximum size allowed is %llu bytes."), (unsigned long long)MaxROMImageSize);
MDFN_PrintError("ROM image is too large; maximum size allowed is %llu bytes.", (unsigned long long)MaxROMImageSize);
goto doret;
}

Expand All @@ -241,7 +241,7 @@ bool MDFNFILE::MakeMemWrap(void *tz, int type)
else
{
#endif
if(!(f_data = (uint8*)MDFN_malloc(size, _("file read buffer"))))
if(!(f_data = (uint8*)MDFN_malloc(size, "file read buffer")))
{
goto doret;
}
Expand All @@ -260,7 +260,7 @@ bool MDFNFILE::MakeMemWrap(void *tz, int type)
uint32_t cur_alloced = 65536;
int howmany;

if(!(f_data = (uint8*)MDFN_malloc(cur_alloced, _("file read buffer"))))
if(!(f_data = (uint8*)MDFN_malloc(cur_alloced, "file read buffer")))
{
goto doret;
}
Expand All @@ -269,13 +269,13 @@ bool MDFNFILE::MakeMemWrap(void *tz, int type)
{
cur_size += howmany;
cur_alloced <<= 1;
if(!(f_data = (uint8 *)MDFN_realloc(f_data, cur_alloced, _("file read buffer"))))
if(!(f_data = (uint8 *)MDFN_realloc(f_data, cur_alloced, "file read buffer")))
{
goto doret;
}
}

if(!(f_data = (uint8 *)MDFN_realloc(f_data, cur_size, _("file read buffer"))))
if(!(f_data = (uint8 *)MDFN_realloc(f_data, cur_size, "file read buffer")))
{
goto doret;
}
Expand All @@ -291,11 +291,11 @@ bool MDFNFILE::MakeMemWrap(void *tz, int type)

if(size > MaxROMImageSize)
{
MDFN_PrintError(_("ROM image is too large; maximum size allowed is %llu bytes."), (unsigned long long)MaxROMImageSize);
MDFN_PrintError("ROM image is too large; maximum size allowed is %llu bytes.", (unsigned long long)MaxROMImageSize);
goto doret;
}

if(!(f_data=(uint8 *)MDFN_malloc(ufo.uncompressed_size, _("file read buffer"))))
if(!(f_data=(uint8 *)MDFN_malloc(ufo.uncompressed_size, "file read buffer")))
{
goto doret;
}
Expand Down Expand Up @@ -360,7 +360,7 @@ bool MDFNFILE::Open(const char *path, const FileExtensionSpecStruct *known_ext,

if((errcode = unzGoToFirstFile(tz)) != UNZ_OK)
{
MDFN_PrintError(_("Could not seek to first file in ZIP archive: %s"), unzErrorString(errcode));
MDFN_PrintError("Could not seek to first file in ZIP archive: %s", unzErrorString(errcode));
unzClose(tz);

return(NULL);
Expand All @@ -376,7 +376,7 @@ bool MDFNFILE::Open(const char *path, const FileExtensionSpecStruct *known_ext,

if((errcode = unzGetCurrentFileInfo(tz, 0, tempu, 1024, 0, 0, 0, 0)) != UNZ_OK)
{
MDFN_PrintError(_("Could not get file information in ZIP archive: %s"), unzErrorString(errcode));
MDFN_PrintError("Could not get file information in ZIP archive: %s", unzErrorString(errcode));
unzClose(tz);

return(NULL);
Expand All @@ -403,14 +403,14 @@ bool MDFNFILE::Open(const char *path, const FileExtensionSpecStruct *known_ext,
{
if(errcode != UNZ_END_OF_LIST_OF_FILE)
{
MDFN_PrintError(_("Error seeking to next file in ZIP archive: %s"), unzErrorString(errcode));
MDFN_PrintError("Error seeking to next file in ZIP archive: %s", unzErrorString(errcode));
unzClose(tz);
return(NULL);
}

if((errcode = unzGoToFirstFile(tz)) != UNZ_OK)
{
MDFN_PrintError(_("Could not seek to first file in ZIP archive: %s"), unzErrorString(errcode));
MDFN_PrintError("Could not seek to first file in ZIP archive: %s", unzErrorString(errcode));
unzClose(tz);
return(NULL);
}
Expand All @@ -422,7 +422,7 @@ bool MDFNFILE::Open(const char *path, const FileExtensionSpecStruct *known_ext,

if((errcode = unzOpenCurrentFile(tz)) != UNZ_OK)
{
MDFN_PrintError(_("Could not open file in ZIP archive: %s"), unzErrorString(errcode));
MDFN_PrintError("Could not open file in ZIP archive: %s", unzErrorString(errcode));
unzClose(tz);
return(NULL);
}
Expand All @@ -448,7 +448,7 @@ bool MDFNFILE::Open(const char *path, const FileExtensionSpecStruct *known_ext,
}

if(ene.Errno() != ENOENT || !suppress_notfound_pe)
MDFN_PrintError(_("Error opening \"%s\": %s"), path, ene.StrError());
MDFN_PrintError("Error opening \"%s\": %s", path, ene.StrError());

return(0);
}
Expand Down Expand Up @@ -644,7 +644,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const
{
ErrnoHolder ene(errno);

MDFN_PrintError(_("Error opening \"%s\": %s"), filename, ene.StrError());
MDFN_PrintError("Error opening \"%s\": %s", filename, ene.StrError());
return(0);
}

Expand All @@ -657,15 +657,15 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const
{
int errnum;

MDFN_PrintError(_("Error writing to \"%s\": %s"), filename, gzerror(gp, &errnum));
MDFN_PrintError("Error writing to \"%s\": %s", filename, gzerror(gp, &errnum));
gzclose(gp);
return(0);
}
}

if(gzclose(gp) != Z_OK) // FIXME: Huhm, how should we handle this?
{
MDFN_PrintError(_("Error closing \"%s\""), filename);
MDFN_PrintError("Error closing \"%s\"", filename);
return(0);
}
}
Expand All @@ -676,7 +676,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const
{
ErrnoHolder ene(errno);

MDFN_PrintError(_("Error opening \"%s\": %s"), filename, ene.StrError());
MDFN_PrintError("Error opening \"%s\": %s", filename, ene.StrError());
return(0);
}

Expand All @@ -689,7 +689,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const
{
ErrnoHolder ene(errno);

MDFN_PrintError(_("Error writing to \"%s\": %s"), filename, ene.StrError());
MDFN_PrintError("Error writing to \"%s\": %s", filename, ene.StrError());
fclose(fp);
return(0);
}
Expand All @@ -699,7 +699,7 @@ static INLINE bool MDFN_DumpToFileReal(const char *filename, int compress, const
{
ErrnoHolder ene(errno);

MDFN_PrintError(_("Error closing \"%s\": %s"), filename, ene.StrError());
MDFN_PrintError("Error closing \"%s\": %s", filename, ene.StrError());
return(0);
}
}
Expand Down
8 changes: 4 additions & 4 deletions mednafen/src/mednafen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MDFNGI *MDFNI_LoadGame(const char *force_module, const char *name)

MDFNGameInfo = NULL;

MDFN_printf(_("Loading %s...\n"),name);
MDFN_printf("Loading %s...\n",name);

//MDFN_indent(1);

Expand Down Expand Up @@ -62,7 +62,7 @@ MDFNGI *MDFNI_LoadGame(const char *force_module, const char *name)
valid_iae.push_back(tmpext);
}
#endif
if(!GameFile.Open(name, NULL, _("game")))//&valid_iae[0]
if(!GameFile.Open(name, NULL, "game"))//&valid_iae[0]
{
MDFNGameInfo = NULL;
return 0;
Expand Down Expand Up @@ -118,13 +118,13 @@ extern MDFNGI EmulatedVB;
{
GameFile.Close();

MDFN_PrintError(_("Unrecognized file format. Sorry."));
MDFN_PrintError("Unrecognized file format. Sorry.");
// MDFN_indent(-1);
MDFNGameInfo = NULL;
return 0;
}

MDFN_printf(_("Using module: %s(%s)\n\n"), MDFNGameInfo->shortname, MDFNGameInfo->fullname);
MDFN_printf("Using module: %s(%s)\n\n", MDFNGameInfo->shortname, MDFNGameInfo->fullname);
//MDFN_indent(1);

assert(MDFNGameInfo->soundchan != 0);
Expand Down
6 changes: 3 additions & 3 deletions mednafen/src/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void *MDFN_calloc_real(uint32 nmemb, uint32 size, const char *purpose, const cha

if(!ret)
{
MDFN_PrintError(_("Error allocating(calloc) %u bytes for \"%s\" in %s(%d)!"), size, purpose, _file, _line);
MDFN_PrintError("Error allocating(calloc) %u bytes for \"%s\" in %s(%d)!", size, purpose, _file, _line);
return(0);
}
return ret;
Expand All @@ -48,7 +48,7 @@ void *MDFN_malloc_real(uint32 size, const char *purpose, const char *_file, cons

if(!ret)
{
MDFN_PrintError(_("Error allocating(malloc) %u bytes for \"%s\" in %s(%d)!"), size, purpose, _file, _line);
MDFN_PrintError("Error allocating(malloc) %u bytes for \"%s\" in %s(%d)!", size, purpose, _file, _line);
return(0);
}
return ret;
Expand All @@ -62,7 +62,7 @@ void *MDFN_realloc_real(void *ptr, uint32 size, const char *purpose, const char

if(!ret)
{
MDFN_PrintError(_("Error allocating(realloc) %u bytes for \"%s\" in %s(%d)!"), size, purpose, _file, _line);
MDFN_PrintError("Error allocating(realloc) %u bytes for \"%s\" in %s(%d)!", size, purpose, _file, _line);
return(0);
}
return ret;
Expand Down
10 changes: 5 additions & 5 deletions mednafen/src/mempatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void MDFNMP_RemoveReadPatches(void)

static void CheatMemErr(void)
{
MDFN_PrintError(_("Error allocating memory for cheat data."));
MDFN_PrintError("Error allocating memory for cheat data.");
}

/* This function doesn't allocate any memory for "name" */
Expand Down Expand Up @@ -228,14 +228,14 @@ void MDFN_LoadGameCheats(FILE *override)
std::string fn = MDFN_MakeFName(MDFNMKF_CHEAT,0,0).c_str();

MDFN_printf("\n");
MDFN_printf(_("Loading cheats from %s...\n"), fn.c_str());
MDFN_printf("Loading cheats from %s...\n", fn.c_str());
// MDFN_indent(1);

if(!(fp = fopen(fn.c_str(),"rb")))
{
// ErrnoHolder ene(errno);

// MDFN_printf(_("Error opening file: %s\n"), ene.StrError());
// MDFN_printf("Error opening file: %s\n", ene.StrError());
// MDFN_indent(-1);
return;
}
Expand All @@ -262,7 +262,7 @@ void MDFN_LoadGameCheats(FILE *override)

if(tbuf[0] != 'R' && tbuf[0] != 'C' && tbuf[0] != 'S')
{
MDFN_printf(_("Invalid cheat type: %c\n"), tbuf[0]);
MDFN_printf("Invalid cheat type: %c\n", tbuf[0]);
break;
}
type = tbuf[0];
Expand Down Expand Up @@ -310,7 +310,7 @@ void MDFN_LoadGameCheats(FILE *override)

if(!override)
{
MDFN_printf(_("%lu cheats loaded.\n"), (unsigned long)cheats.size());
MDFN_printf("%lu cheats loaded.\n", (unsigned long)cheats.size());
// MDFN_indent(-1);
fclose(fp);
}
Expand Down
Loading

0 comments on commit 0eabceb

Please sign in to comment.