1. Anthony Tuininga
  2. cx_Logging

Commits

Anthony Tuininga  committed dd5d176

Small tweaks to eliminate warnings with the MSVC compiler.

  • Participants
  • Parent commits 236606c
  • Branches default

Comments (0)

Files changed (1)

File cx_Logging.c

View file
 static int CheckForLogFileFull(
     LoggingState *state)                // state to use for writing
 {
-    long position;
+    unsigned long position;
 
     if (state->rotateFiles && state->maxFiles > 1) {
         if (state->fp) {
     const char *prefix,                 // prefix to print in front of it
     const IID *iid)                     // interface to print
 {
-    int strLength, result = 0;
     OLECHAR str[128];
     char outstr[128];
+    size_t strLength;
+    int result = 0;
 
     ACQUIRE_LOCK(gLoggingStateLock);
     if (gLoggingState && level >= gLoggingState->level) {
                     prefix);
         } else {
             strLength = wcslen(str) + 1;
-            if (WideCharToMultiByte(CP_ACP, 0, str, strLength, outstr,
-                    strLength, NULL, NULL) == 0) {
+            if (WideCharToMultiByte(CP_ACP, 0, str, (int) strLength, outstr,
+                    (int) strLength, NULL, NULL) == 0) {
                 result = LogMessageV(LOG_LEVEL_ERROR,
                         "%s: huh? can't convert string?", prefix);
             } else result = LogMessageV(level, "%s: %s", prefix, outstr);
     ExceptionInfo *exceptionInfo)       // exception information (OUT)
 {
     char *tempFileName, *tempPrefix;
-    unsigned size;
+    size_t size;
 
     size = wcslen(fileName) + 1;
     tempFileName = alloca(size);
     const OLECHAR *message)             // message to log
 {
     char *tempMessage;
-    unsigned size;
+    size_t size;
 
     size = wcslen(message) + 1;
     tempMessage = alloca(size);