diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-20 11:09:36 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-20 11:09:36 +0000 |
commit | 5245e666a09df5f401c1329bf5ee1fc1b09b1d16 (patch) | |
tree | dcf032743e890fddd400b268b75a0868976b0a0b /src/common/showmsg.c | |
parent | d23c508bcc38520970156e5e25f14b03714878eb (diff) | |
download | hercules-5245e666a09df5f401c1329bf5ee1fc1b09b1d16.tar.gz hercules-5245e666a09df5f401c1329bf5ee1fc1b09b1d16.tar.bz2 hercules-5245e666a09df5f401c1329bf5ee1fc1b09b1d16.tar.xz hercules-5245e666a09df5f401c1329bf5ee1fc1b09b1d16.zip |
* Merged the tmpsql branch:
- Abstraction for the sql code (sql.c/h).
- New configure script and makefiles.
- Restored txt zeny logging code. (r10814)
- Rewrote mapserver's sql code - itemdb, mobdb, mapreg, logs. (r10814)
- Fixed a precedence issue (&& and ) in char_sql/char.c. (r10833)
- Improved db reading code a bit for consistency. (r11077)
- Added separate atcommand for mail deletion. (r11077)
- Corrected a few messages that said "new" instead of "unread". (r11077)
- Broadcast (*) messages now use "*" as the target's name (not ""). (r11077)
- Moved StringBuf code from utils.c/h to strlib.c/h. (r11084 r11117)
- Some misc login server cleanups (reformatting etc). (r11136)
- Corrected/modified some header entries. (r11141 r11147 11148)
- Adjusted VS project files. (r11147)
- Adjusted the way the sql charserver does item saving. (r11192)
- Corrected usage of reserved keyword 'friend' in mmo.h. (r11192)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r-- | src/common/showmsg.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 615b52914..6fb8a2e6c 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -2,7 +2,7 @@ // For more information, see LICENCE in the main folder #include "../common/cbasetypes.h" -#include "../common/utils.h" +#include "../common/strlib.h" // StringBuf #include "showmsg.h" #include <stdio.h> @@ -59,7 +59,7 @@ int msg_silent = 0; //Specifies how silent the console is. #define NEWBUF(buf) \ struct { \ char s_[SBUF_SIZE]; \ - struct StringBuf *d_; \ + StringBuf *d_; \ char *v_; \ int l_; \ } buf ={"",NULL,NULL,0}; \ @@ -198,7 +198,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) */ ///////////////////////////////////////////////////////////////// - unsigned long written; + DWORD written; char *p, *q; NEWBUF(tempbuf); // temporary buffer @@ -218,8 +218,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) p = BUFVAL(tempbuf); while ((q = strchr(p, 0x1b)) != NULL) { // find the escape character - if( 0==WriteConsole(handle, p, q-p, &written, 0) ) // write up to the escape - WriteFile(handle, p, q-p, &written, 0); + if( 0==WriteConsole(handle, p, (DWORD)(q-p), &written, 0) ) // write up to the escape + WriteFile(handle, p, (DWORD)(q-p), &written, 0); if( q[1]!='[' ) { // write the escape char (whatever purpose it has) @@ -240,7 +240,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) // skip escape and bracket q=q+2; - while(1) + for(;;) { if( ISDIGIT(*q) ) { // add number to number array, only accept 2digits, shift out the rest @@ -501,8 +501,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) } } if (*p) // write the rest of the buffer - if( 0==WriteConsole(handle, p, strlen(p), &written, 0) ) - WriteFile(handle,p, strlen(p), &written, 0); + if( 0==WriteConsole(handle, p, (DWORD)strlen(p), &written, 0) ) + WriteFile(handle, p, (DWORD)strlen(p), &written, 0); FREEBUF(tempbuf); return 0; } @@ -689,7 +689,10 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap) ShowError("Empty string passed to _vShowMessage().\n"); return 1; } - if ((flag == MSG_DEBUG && !SHOW_DEBUG_MSG) || + if ( +#if !defined(SHOW_DEBUG_MSG) + (flag == MSG_DEBUG) || +#endif (flag == MSG_INFORMATION && msg_silent&1) || (flag == MSG_STATUS && msg_silent&2) || (flag == MSG_NOTICE && msg_silent&4) || |