fixed Windows build; fixed compilation warnings
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 29 Aug 2016 08:11:29 +0000 (11:11 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 29 Aug 2016 08:11:29 +0000 (11:11 +0300)
src/agent/core/nxagentd.vcproj
src/db/dbdrv/informix/informix.cpp
src/db/dbdrv/sqlite/sqlite.cpp
src/libnetxms/log.cpp
src/libnetxms/table.cpp
src/server/core/radius.cpp
src/server/tools/nxdbmgr/nxdbmgr.cpp

index d5dc2a7..2d2affa 100644 (file)
                                RelativePath=".\sysinfo.cpp"
                                >
                        </File>
+                       <File
+                               RelativePath=".\syslog.cpp"
+                               >
+                       </File>
                        <File
                                RelativePath=".\tools.cpp"
                                >
index 66f29d7..3da2674 100644 (file)
@@ -327,7 +327,7 @@ extern "C" void EXPORT DrvBind(INFORMIX_STATEMENT *statement, int pos, int sqlTy
          {
             sqlBuffer = WideStringFromUTF8String((char *)buffer);
             statement->buffers->add(sqlBuffer);
-            length = strlen((char *)sqlBuffer) + 1;
+            length = (int)strlen((char *)sqlBuffer) + 1;
          }
          else
          {
@@ -339,7 +339,7 @@ extern "C" void EXPORT DrvBind(INFORMIX_STATEMENT *statement, int pos, int sqlTy
          {
             sqlBuffer = WideStringFromUTF8String((char *)buffer);
             free(buffer);
-            length = strlen((char *)sqlBuffer) + 1;
+            length = (int)strlen((char *)sqlBuffer) + 1;
          }
          else
          {
@@ -351,7 +351,7 @@ extern "C" void EXPORT DrvBind(INFORMIX_STATEMENT *statement, int pos, int sqlTy
          if (cType == DB_CTYPE_UTF8_STRING)
          {
             sqlBuffer = WideStringFromUTF8String((char *)buffer);
-            length = strlen((char *)sqlBuffer) + 1;
+            length = (int)strlen((char *)sqlBuffer) + 1;
          }
          else
          {
index b28a39f..0e2f91b 100644 (file)
@@ -226,7 +226,7 @@ extern "C" void EXPORT DrvBind(sqlite3_stmt *stmt, int pos, int sqlType, int cTy
 #endif
                        break;
       case DB_CTYPE_UTF8_STRING:
-         sqlite3_bind_text(stmt, pos, (char *)buffer, strlen((char *)buffer),
+         sqlite3_bind_text(stmt, pos, (char *)buffer, (int)strlen((char *)buffer),
             (allocType == DB_BIND_STATIC) ? SQLITE_STATIC : ((allocType == DB_BIND_DYNAMIC) ? free : SQLITE_TRANSIENT));
          break;
                case DB_CTYPE_INT32:
index 856e448..95ad211 100644 (file)
@@ -330,7 +330,7 @@ static THREAD_RESULT THREAD_CALL BackgroundWriterThread(void *arg)
              {
                 NX_STAT_STRUCT st;
                      NX_FSTAT(fileno(m_logFileHandle), &st);
-                     if (st.st_size >= s_maxLogSize)
+                     if ((UINT64)st.st_size >= s_maxLogSize)
                              RotateLog(FALSE);
              }
       }
@@ -501,7 +501,7 @@ static void WriteLogToFile(TCHAR *message, const WORD wType)
           {
              NX_STAT_STRUCT st;
                   NX_FSTAT(fileno(m_logFileHandle), &st);
-                  if (st.st_size >= s_maxLogSize)
+                  if ((UINT64)st.st_size >= s_maxLogSize)
                           RotateLog(FALSE);
           }
 
index aacf41a..2c84dcd 100644 (file)
@@ -323,7 +323,7 @@ Table *Table::createFromPackedXML(const char *packedXml)
    size_t xmlSize = (size_t)ntohl(*((UINT32 *)compressedXml));
    char *xml = (char *)malloc(xmlSize + 1);
    uLongf uncompSize = (uLongf)xmlSize;
-   if (uncompress((BYTE *)xml, &uncompSize, (BYTE *)&compressedXml[4], compressedSize - 4) != Z_OK)
+   if (uncompress((BYTE *)xml, &uncompSize, (BYTE *)&compressedXml[4], (uLong)compressedSize - 4) != Z_OK)
    {
       free(xml);
       return NULL;
@@ -399,9 +399,9 @@ char *Table::createPackedXML()
    char *utf8xml = UTF8StringFromTString(xml);
    free(xml);
    size_t len = strlen(utf8xml);
-   uLongf buflen = compressBound(len);
+   uLongf buflen = compressBound((uLong)len);
    BYTE *buffer = (BYTE *)malloc(buflen + 4);
-   if (compress(&buffer[4], &buflen, (BYTE *)utf8xml, len) != Z_OK)
+   if (compress(&buffer[4], &buflen, (BYTE *)utf8xml, (uLong)len) != Z_OK)
    {
       free(utf8xml);
       free(buffer);
index f1ae1d3..af3714e 100644 (file)
@@ -619,7 +619,6 @@ static int DoRadiusAuth(const char *cLogin, const char *cPasswd, bool useSeconda
        VALUE_PAIR *req, *vp;
        struct timeval          tv;
        fd_set readfds;
-       socklen_t salen;
        int port, result = 0, length, i;
        int nRetries, nTimeout;
        SOCKET sockfd;
index 43677d7..9d969a7 100644 (file)
@@ -805,7 +805,6 @@ stop_search:
       return 3;
    }
 
-       TCHAR errorText[DBDRV_MAX_ERROR_TEXT];
    g_hCoreDB = ConnectToDatabase();
    if (g_hCoreDB == NULL)
    {