diff options
author | Max Horn | 2010-11-01 16:03:02 +0000 |
---|---|---|
committer | Max Horn | 2010-11-01 16:03:02 +0000 |
commit | 2af270442144faec859114bcdce7e5659ac7f24b (patch) | |
tree | b65ce8a6e22beb2de13874a1265b810ed9bcee2c /gui | |
parent | 06876671e51df44a5f28ea2c2798d7607b4f2d43 (diff) | |
download | scummvm-rg350-2af270442144faec859114bcdce7e5659ac7f24b.tar.gz scummvm-rg350-2af270442144faec859114bcdce7e5659ac7f24b.tar.bz2 scummvm-rg350-2af270442144faec859114bcdce7e5659ac7f24b.zip |
GUI: Rename ConsolDialog methods (v)printf, putchar
svn-id: r54006
Diffstat (limited to 'gui')
-rw-r--r-- | gui/console.cpp | 27 | ||||
-rw-r--r-- | gui/console.h | 10 | ||||
-rw-r--r-- | gui/debugger.cpp | 2 |
3 files changed, 17 insertions, 22 deletions
diff --git a/gui/console.cpp b/gui/console.cpp index a53e97888b..ca3726c857 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -487,7 +487,7 @@ void ConsoleDialog::defaultKeyDownHandler(Common::KeyState &state) { for (int i = _promptEndPos - 1; i >= _currentPos; i--) buffer(i + 1) = buffer(i); _promptEndPos++; - putchar((byte)state.ascii); + printChar((byte)state.ascii); scrollToCurrent(); } } @@ -498,7 +498,7 @@ void ConsoleDialog::insertIntoPrompt(const char* str) { buffer(i + l) = buffer(i); for (unsigned int j = 0; j < l; ++j) { _promptEndPos++; - putcharIntern(str[j]); + printCharIntern(str[j]); } } @@ -620,7 +620,7 @@ void ConsoleDialog::historyScroll(int direction) { else idx = _historyIndex; for (int i = 0; i < kLineBufferSize && _history[idx][i] != '\0'; i++) - putcharIntern(_history[idx][i]); + printCharIntern(_history[idx][i]); _promptEndPos = _currentPos; // Ensure once more the caret is visible (in case of very long history entries) @@ -659,38 +659,33 @@ void ConsoleDialog::updateScrollBuffer() { _scrollBar->recalc(); } -int ConsoleDialog::printf(const char *format, ...) { +int ConsoleDialog::printFormat(int dummy, const char *format, ...) { va_list argptr; va_start(argptr, format); - int count = this->vprintf(format, argptr); + int count = this->vprintFormat(dummy, format, argptr); va_end (argptr); return count; } -int ConsoleDialog::vprintf(const char *format, va_list argptr) { +int ConsoleDialog::vprintFormat(int dummy, const char *format, va_list argptr) { char buf[2048]; -#if defined(WIN32) - int count = _vsnprintf(buf, sizeof(buf), format, argptr); -#elif defined(__SYMBIAN32__) - int count = vsprintf(buf, format, argptr); -#else int count = vsnprintf(buf, sizeof(buf), format, argptr); -#endif + buf[sizeof(buf)-1] = 0; // ensure termination print(buf); return count; } -void ConsoleDialog::putchar(int c) { +void ConsoleDialog::printChar(int c) { if (_caretVisible) drawCaret(true); - putcharIntern(c); + printCharIntern(c); drawLine(pos2line(_currentPos)); } -void ConsoleDialog::putcharIntern(int c) { +void ConsoleDialog::printCharIntern(int c) { if (c == '\n') nextLine(); else { @@ -708,7 +703,7 @@ void ConsoleDialog::print(const char *str) { drawCaret(true); while (*str) - putcharIntern(*str++); + printCharIntern(*str++); draw(); } diff --git a/gui/console.h b/gui/console.h index bf44bdbe17..52762b065f 100644 --- a/gui/console.h +++ b/gui/console.h @@ -143,10 +143,10 @@ public: void handleKeyDown(Common::KeyState state); void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); - int printf(const char *format, ...) GCC_PRINTF(2, 3); - int vprintf(const char *format, va_list argptr); -#undef putchar - void putchar(int c); + int printFormat(int dummy, const char *format, ...) GCC_PRINTF(3, 4); + int vprintFormat(int dummy, const char *format, va_list argptr); + + void printChar(int c); void setInputCallback(InputCallbackProc proc, void *refCon) { _callbackProc = proc; @@ -172,7 +172,7 @@ protected: void drawLine(int line, bool restoreBg = true); void drawCaret(bool erase); - void putcharIntern(int c); + void printCharIntern(int c); void insertIntoPrompt(const char *str); void print(const char *str); void updateScrollBuffer(); diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 9bd3b35915..b9d2c4a9b0 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -78,7 +78,7 @@ int Debugger::DebugPrintf(const char *format, ...) { va_start(argptr, format); int count; #ifndef USE_TEXT_CONSOLE - count = _debuggerDialog->vprintf(format, argptr); + count = _debuggerDialog->vprintFormat(1, format, argptr); #else count = ::vprintf(format, argptr); #endif |