summaryrefslogtreecommitdiff
path: root/plugins/ConnectionNotify/src/debug.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-25 10:00:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-25 10:00:22 +0000
commit77cc30f66c53cd638eb73bb92340c9144114e07a (patch)
treea5462767042dd144390a08ba49be1e7ebfce22ea /plugins/ConnectionNotify/src/debug.cpp
parent66fe24c1af7b15aaf749413bf2aacc1d030610e2 (diff)
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6223 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ConnectionNotify/src/debug.cpp')
-rw-r--r--plugins/ConnectionNotify/src/debug.cpp112
1 files changed, 52 insertions, 60 deletions
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp
index 0400b3a673..2af13f218c 100644
--- a/plugins/ConnectionNotify/src/debug.cpp
+++ b/plugins/ConnectionNotify/src/debug.cpp
@@ -2,71 +2,63 @@
void _OutputDebugString(TCHAR* lpOutputString, ... )
{
- TCHAR OutMsg[MAX_LENGTH];
- TCHAR format[MAX_LENGTH];
+ TCHAR OutMsg[MAX_LENGTH];
+ TCHAR format[MAX_LENGTH];
int i,j;
- va_list argptr;
-
- va_start( argptr, lpOutputString );
-
+ va_list argptr;
-
- for(i=0,j=0;lpOutputString[i] != '\0';i++)
- {
- format[j++] = lpOutputString[i];
+ va_start( argptr, lpOutputString );
+
+
+
+ for(i=0,j=0;lpOutputString[i] != '\0';i++)
+ {
+ format[j++] = lpOutputString[i];
+ format[j] = '\0';
+
+ if (lpOutputString[i] != '%')
+ continue;
+
+ format[j++] = lpOutputString[++i];
format[j] = '\0';
- // If escape character
- //if(lpOutputString[i] == '\\')
- //{
- // i++;
- // continue;
- //}
- // if not a substitutal character
- if(lpOutputString[i] != '%')
- continue;
-
- format[j++] = lpOutputString[++i];
- format[j] = '\0';
- switch(lpOutputString[i])
- {
- // string
- case 's':
- {
- TCHAR* s = va_arg( argptr, TCHAR * );
- mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, s);
- _tcsncpy(format,OutMsg,_countof(OutMsg));
- j = _tcslen(format);
- _tcscat(format,_T(" "));
- break;
- }
- // character
- case 'c':
- {
- char c = (char) va_arg( argptr, int );
- mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, c);
- _tcsncpy(format,OutMsg,_countof(OutMsg));
- j = _tcslen(format);
- _tcscat(format,_T(" "));
- break;
- }
- // integer
- case 'd':
- {
- int d = va_arg( argptr, int );
- mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, d);
- _tcsncpy(format,OutMsg,_countof(OutMsg));
- j = _tcslen(format);
- _tcscat(format,_T(" "));
- break;
- }
- }
+ switch(lpOutputString[i])
+ {
+ // string
+ case 's':
+ {
+ TCHAR* s = va_arg( argptr, TCHAR * );
+ mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, s);
+ _tcsncpy(format,OutMsg,_countof(OutMsg));
+ j = (int)_tcslen(format);
+ _tcscat(format,_T(" "));
+ break;
+ }
+ // character
+ case 'c':
+ {
+ char c = (char) va_arg( argptr, int );
+ mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, c);
+ _tcsncpy(format,OutMsg,_countof(OutMsg));
+ j = (int)_tcslen(format);
+ _tcscat(format,_T(" "));
+ break;
+ }
+ // integer
+ case 'd':
+ {
+ int d = va_arg( argptr, int );
+ mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, d);
+ _tcsncpy(format,OutMsg,_countof(OutMsg));
+ j = (int)_tcslen(format);
+ _tcscat(format,_T(" "));
+ break;
+ }
+ }
format[j+1] = '\0';
- }
+ }
_tcscat(format,_T("\n"));
- OutputDebugString(format);
+ OutputDebugString(format);
- va_end( argptr );
+ va_end( argptr );
}
-
-