diff options
author | Max Horn | 2009-11-23 22:29:39 +0000 |
---|---|---|
committer | Max Horn | 2009-11-23 22:29:39 +0000 |
commit | 3d342bec3c099039efe2452b08ea525002eac7b2 (patch) | |
tree | ac14cb008910caf655ab310d5e930880daaeafa2 | |
parent | f3c6e07feb97d6d7946ebaab0d27407722ca30af (diff) | |
download | scummvm-rg350-3d342bec3c099039efe2452b08ea525002eac7b2.tar.gz scummvm-rg350-3d342bec3c099039efe2452b08ea525002eac7b2.tar.bz2 scummvm-rg350-3d342bec3c099039efe2452b08ea525002eac7b2.zip |
PS2 & NDS: Remove ps2_fprintf and some useless typedefs and #defines; use fputs instead of fprintf
svn-id: r46107
-rw-r--r-- | backends/fs/ds/ds-fs.cpp | 6 | ||||
-rw-r--r-- | backends/fs/stdiostream.cpp | 1 | ||||
-rw-r--r-- | backends/platform/ps2/fileio.cpp | 16 | ||||
-rw-r--r-- | backends/platform/ps2/fileio.h | 1 | ||||
-rw-r--r-- | common/debug.cpp | 11 | ||||
-rw-r--r-- | common/util.cpp | 15 |
6 files changed, 6 insertions, 44 deletions
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index 0d1d005b9e..6fc2894925 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -769,10 +769,4 @@ void std_clearerr(FILE* handle) { // consolePrintf("clearerr "); } -void std_fprintf(FILE* handle, const char* fmt, ...) { - //FIXME: not implemented properly - consolePrintf("%s", fmt); -} - - } // namespace DS diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp index a33d79b08a..b18403a18b 100644 --- a/backends/fs/stdiostream.cpp +++ b/backends/fs/stdiostream.cpp @@ -39,7 +39,6 @@ #define fread(a, b, c, d) ps2_fread(a, b, c, d) #define fwrite(a, b, c, d) ps2_fwrite(a, b, c, d) - #define fprintf ps2_fprintf // used in common/util.cpp #define fflush(a) ps2_fflush(a) // used in common/util.cpp #define ferror(a) ps2_ferror(a) #define clearerr(a) ps2_clearerr(a) diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp index b0c3ce68e4..047992b13d 100644 --- a/backends/platform/ps2/fileio.cpp +++ b/backends/platform/ps2/fileio.cpp @@ -508,22 +508,6 @@ int ps2_fputs(const char *s, FILE *stream) { return EOF; } -int ps2_fprintf(FILE *pOut, const char *zFormat, ...) { - va_list ap; - char resStr[2048]; - - va_start(ap,zFormat); - int res = vsnprintf(resStr, 2048, zFormat, ap); - va_end(ap); - if ((pOut == stderr) || (pOut == stdout)) { - printf("%s", resStr); - sioprintf("%s", resStr); - } else - res = ps2_fwrite(resStr, 1, res, pOut); - - return res; -} - int ps2_fflush(FILE *stream) { // printf("fflush not implemented\n"); return 0; diff --git a/backends/platform/ps2/fileio.h b/backends/platform/ps2/fileio.h index e3b1a98db9..ce470cebd1 100644 --- a/backends/platform/ps2/fileio.h +++ b/backends/platform/ps2/fileio.h @@ -97,7 +97,6 @@ char *ps2_fgets(char *buf, int n, FILE *stream); size_t ps2_fwrite(const void *buf, size_t r, size_t n, FILE *stream); int ps2_fputc(int c, FILE *stream); int ps2_fputs(const char *s, FILE *stream); -int ps2_fprintf(FILE *pOut, const char *zFormat, ...); int ps2_ferror(FILE *stream); void ps2_clearerr(FILE *stream); diff --git a/common/debug.cpp b/common/debug.cpp index ff17959cbf..cbd1db5f45 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -33,11 +33,8 @@ #ifdef __PLAYSTATION2__ // for those replaced fopen/fread/etc functions - typedef unsigned long uint64; - typedef signed long int64; #include "backends/platform/ps2/fileio.h" - #define fprintf ps2_fprintf #define fputs(str, file) ps2_fputs(str, file) #define fflush(a) ps2_fflush(a) #endif @@ -45,12 +42,8 @@ #ifdef __DS__ #include "backends/fs/ds/ds-fs.h" - void std_fprintf(FILE* handle, const char* fmt, ...); - void std_fflush(FILE* handle); - - #define fprintf(file, fmt, ...) do { char str[128]; sprintf(str, fmt, ##__VA_ARGS__); DS::std_fwrite(str, strlen(str), 1, file); } while(0) - #define fputs(str, file) DS::std_fwrite(str, strlen(str), 1, file) - #define fflush(file) DS::std_fflush(file) + #define fputs(str, file) DS::std_fwrite(str, strlen(str), 1, file) + #define fflush(file) DS::std_fflush(file) #endif diff --git a/common/util.cpp b/common/util.cpp index c16e774e43..5e4ee2b2c7 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -37,24 +37,15 @@ extern bool isSmartphone(); #ifdef __PLAYSTATION2__ // for those replaced fopen/fread/etc functions - typedef unsigned long uint64; - typedef signed long int64; #include "backends/platform/ps2/fileio.h" - #define fprintf ps2_fprintf #define fputs(str, file) ps2_fputs(str, file) - #define fflush(a) ps2_fflush(a) #endif #ifdef __DS__ #include "backends/fs/ds/ds-fs.h" - void std_fprintf(FILE* handle, const char* fmt, ...); - void std_fflush(FILE* handle); - - #define fprintf(file, fmt, ...) do { char str[128]; sprintf(str, fmt, ##__VA_ARGS__); DS::std_fwrite(str, strlen(str), 1, file); } while(0) - #define fputs(str, file) DS::std_fwrite(str, strlen(str), 1, file) - #define fflush(file) DS::std_fflush(file) + #define fputs(str, file) DS::std_fwrite(str, strlen(str), 1, file) #endif @@ -444,7 +435,9 @@ void warning(const char *s, ...) { va_end(va); #if !defined (__SYMBIAN32__) - fprintf(stderr, "WARNING: %s!\n", buf); + fputs("WARNING: ", stderr); + fputs(buf, stderr); + fputs("!\n", stderr); #endif #if defined( USE_WINDBG ) |