fixed Visual Studio compilation warnings
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 29 Jun 2016 13:28:47 +0000 (16:28 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 29 Jun 2016 13:28:47 +0000 (16:28 +0300)
src/client/nxevent/nxevent.vcproj
src/server/core/cluster.cpp
src/server/core/netmap.cpp
src/server/core/netobj.cpp
src/server/core/node.cpp
src/server/libnxsrv/agent.cpp

index 155acea..14fc320 100644 (file)
@@ -50,7 +50,7 @@
                                RuntimeLibrary="3"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
-                               Detect64BitPortabilityProblems="true"
+                               Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="4"
                        />
                        <Tool
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
-                               Detect64BitPortabilityProblems="true"
+                               Detect64BitPortabilityProblems="false"
                                DebugInformationFormat="3"
                        />
                        <Tool
index e55d9f7..0b20841 100644 (file)
@@ -489,7 +489,7 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
    if (IsShutdownInProgress())
       return;
 
-       UINT32 i, j, k, dwPollListSize;
+       int i, pollListSize;
        InterfaceList *pIfList;
        BOOL bModified = FALSE, bAllDown;
        BYTE *pbResourceFound;
@@ -498,7 +498,7 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
    // Create polling list
    ppPollList = (NetObj **)malloc(sizeof(NetObj *) * m_childList->size());
    lockChildList(false);
-   for(i = 0, dwPollListSize = 0; i < m_childList->size(); i++)
+   for(i = 0, pollListSize = 0; i < m_childList->size(); i++)
    {
       NetObj *object = m_childList->get(i);
       if ((object->getStatus() != STATUS_UNMANAGED) &&
@@ -506,14 +506,14 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
       {
          object->incRefCount();
                        ((Node *)object)->lockForStatusPoll();
-         ppPollList[dwPollListSize++] = object;
+         ppPollList[pollListSize++] = object;
       }
    }
    unlockChildList();
 
        // Perform status poll on all member nodes
        DbgPrintf(6, _T("CLUSTER STATUS POLL [%s]: Polling member nodes"), m_name);
-       for(i = 0, bAllDown = TRUE; i < dwPollListSize; i++)
+       for(i = 0, bAllDown = TRUE; i < pollListSize; i++)
        {
                ((Node *)ppPollList[i])->statusPoll(pSession, dwRqId, poller);
                if (!((Node *)ppPollList[i])->isDown())
@@ -544,15 +544,15 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
                memset(pbResourceFound, 0, m_dwNumResources);
 
                DbgPrintf(6, _T("CLUSTER STATUS POLL [%s]: Polling resources"), m_name);
-               for(i = 0; i < dwPollListSize; i++)
+               for(i = 0; i < pollListSize; i++)
                {
                        pIfList = ((Node *)ppPollList[i])->getInterfaceList();
                        if (pIfList != NULL)
                        {
                                lockProperties();
-                               for(j = 0; j < (UINT32)pIfList->size(); j++)
+                               for(int j = 0; j < pIfList->size(); j++)
                                {
-                                       for(k = 0; k < m_dwNumResources; k++)
+                                       for(UINT32 k = 0; k < m_dwNumResources; k++)
                                        {
                   if (pIfList->get(j)->hasAddress(m_pResourceList[k].ipAddr))
                                                {
@@ -600,7 +600,7 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
 
                // Check for missing virtual addresses
                lockProperties();
-               for(i = 0; i < m_dwNumResources; i++)
+               for(i = 0; i < (int)m_dwNumResources; i++)
                {
                        if ((!pbResourceFound[i]) && (m_pResourceList[i].dwCurrOwner != 0))
                        {
@@ -620,7 +620,7 @@ void Cluster::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *pol
        }
 
        // Cleanup
-       for(i = 0; i < dwPollListSize; i++)
+       for(i = 0; i < pollListSize; i++)
        {
                ppPollList[i]->decRefCount();
        }
@@ -666,7 +666,7 @@ UINT32 Cluster::collectAggregatedData(DCItem *item, TCHAR *buffer)
    lockChildList(true);
    ItemValue **values = (ItemValue **)malloc(sizeof(ItemValue *) * m_childList->size());
    int valueCount = 0;
-   for(UINT32 i = 0; i < m_childList->size(); i++)
+   for(int i = 0; i < m_childList->size(); i++)
    {
       if (m_childList->get(i)->getObjectClass() != OBJECT_NODE)
          continue;
index c3185e9..70619e2 100644 (file)
@@ -204,7 +204,7 @@ void NetworkMap::calculateCompoundStatus(BOOL bForcedRecalc)
          if ((iOldStatus != m_status) || bForcedRecalc)
          {
             lockParentList(false);
-            for(UINT32 i = 0; i < m_parentList->size(); i++)
+            for(int i = 0; i < m_parentList->size(); i++)
                m_parentList->get(i)->calculateCompoundStatus();
             unlockParentList();
             lockProperties();
@@ -219,7 +219,7 @@ void NetworkMap::calculateCompoundStatus(BOOL bForcedRecalc)
       {
          m_status = STATUS_NORMAL;
          lockParentList(false);
-         for(UINT32 i = 0; i < m_parentList->size(); i++)
+         for(int i = 0; i < m_parentList->size(); i++)
             m_parentList->get(i)->calculateCompoundStatus();
          unlockParentList();
          lockProperties();
index 6439f7e..ed103b1 100644 (file)
@@ -615,7 +615,7 @@ void NetObj::deleteObject(NetObj *initiator)
    DbgPrintf(5, _T("NetObj::deleteObject(): clearing child list for object %d"), m_id);
    ObjectArray<NetObj> *deleteList = NULL;
    lockChildList(true);
-   for(UINT32 i = 0; i < m_childList->size(); i++)
+   for(int i = 0; i < m_childList->size(); i++)
    {
       NetObj *o = m_childList->get(i);
       if (o->getParentCount() == 1)
index 9cec2f4..23b1dce 100644 (file)
@@ -716,14 +716,11 @@ void Node::addVrrpInterfaces(InterfaceList *ifList)
  */
 Interface *Node::findInterfaceByIndex(UINT32 ifIndex)
 {
-   UINT32 i;
-   Interface *pInterface;
-
    lockChildList(false);
-   for(i = 0; i < m_childList->size(); i++)
+   for(int i = 0; i < m_childList->size(); i++)
       if (m_childList->get(i)->getObjectClass() == OBJECT_INTERFACE)
       {
-         pInterface = (Interface *)m_childList->get(i);
+         Interface *pInterface = (Interface *)m_childList->get(i);
                        if (pInterface->getIfIndex() == ifIndex)
          {
             unlockChildList();
@@ -746,7 +743,7 @@ Interface *Node::findInterfaceByName(const TCHAR *name)
    Interface *pInterface;
 
    lockChildList(false);
-   for(UINT32 i = 0; i < m_childList->size(); i++)
+   for(int i = 0; i < m_childList->size(); i++)
       if (m_childList->get(i)->getObjectClass() == OBJECT_INTERFACE)
       {
          pInterface = (Interface *)m_childList->get(i);
@@ -766,14 +763,11 @@ Interface *Node::findInterfaceByName(const TCHAR *name)
  */
 Interface *Node::findInterfaceBySlotAndPort(UINT32 slot, UINT32 port)
 {
-   UINT32 i;
-   Interface *pInterface;
-
    lockChildList(false);
-   for(i = 0; i < m_childList->size(); i++)
+   for(int i = 0; i < m_childList->size(); i++)
       if (m_childList->get(i)->getObjectClass() == OBJECT_INTERFACE)
       {
-         pInterface = (Interface *)m_childList->get(i);
+         Interface *pInterface = (Interface *)m_childList->get(i);
                        if (pInterface->isPhysicalPort() && (pInterface->getSlotNumber() == slot) && (pInterface->getPortNumber() == port))
          {
             unlockChildList();
@@ -1244,7 +1238,7 @@ void Node::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *poller
        if (IsShutdownInProgress())
           return;
 
-   UINT32 i, dwPollListSize, dwOldFlags = m_dwFlags;
+   UINT32 dwOldFlags = m_dwFlags;
    NetObj *pPollerNode = NULL, **ppPollList;
        SNMP_Transport *pTransport;
        Cluster *pCluster;
@@ -1445,13 +1439,14 @@ restart_agent_check:
    // Create polling list
    ppPollList = (NetObj **)malloc(sizeof(NetObj *) * m_childList->size());
    lockChildList(false);
-   for(i = 0, dwPollListSize = 0; i < m_childList->size(); i++)
+   int pollListSize = 0;
+   for(int i = 0; i < m_childList->size(); i++)
    {
       NetObj *curr = m_childList->get(i);
       if (curr->getStatus() != STATUS_UNMANAGED)
       {
          curr->incRefCount();
-         ppPollList[dwPollListSize++] = curr;
+         ppPollList[pollListSize++] = curr;
       }
    }
    unlockChildList();
@@ -1461,7 +1456,7 @@ restart_agent_check:
    DbgPrintf(7, _T("StatusPoll(%s): starting child object poll"), m_name);
        pCluster = getMyCluster();
        pTransport = createSnmpTransport();
-   for(i = 0; i < dwPollListSize; i++)
+   for(int i = 0; i < pollListSize; i++)
    {
       switch(ppPollList[i]->getObjectClass())
       {
@@ -1493,7 +1488,7 @@ restart_agent_check:
        {
           bool allDown = true;
                lockChildList(false);
-      for(i = 0; i < m_childList->size(); i++)
+      for(int i = 0; i < m_childList->size(); i++)
       {
          NetObj *curr = m_childList->get(i);
          if ((curr->getObjectClass() == OBJECT_INTERFACE) &&
@@ -1529,7 +1524,7 @@ restart_agent_check:
 
                                        // Set interfaces and network services to UNKNOWN state
                                        lockChildList(false);
-                                       for(i = 0; i < m_childList->size(); i++)
+                                       for(int i = 0; i < m_childList->size(); i++)
                                        {
                                 NetObj *curr = m_childList->get(i);
                                                if (((curr->getObjectClass() == OBJECT_INTERFACE) || (curr->getObjectClass() == OBJECT_NETWORKSERVICE)) &&
@@ -5396,17 +5391,16 @@ void Node::setFileUpdateConnection(AgentConnection *conn)
  */
 UINT32 Node::getInterfaceCount(Interface **ppInterface)
 {
-   UINT32 i, dwCount;
-
    lockChildList(false);
-   for(i = 0, dwCount = 0; i < m_childList->size(); i++)
+   UINT32 count = 0;
+   for(int i = 0; i < m_childList->size(); i++)
       if (m_childList->get(i)->getObjectClass() == OBJECT_INTERFACE)
       {
-         dwCount++;
+         count++;
          *ppInterface = (Interface *)m_childList->get(i);
       }
    unlockChildList();
-   return dwCount;
+   return count;
 }
 
 /**
@@ -5731,11 +5725,10 @@ void Node::checkInterfaceNames(InterfaceList *pIfList)
  */
 Cluster *Node::getMyCluster()
 {
-       UINT32 i;
        Cluster *pCluster = NULL;
 
        lockParentList(false);
-       for(i = 0; i < m_parentList->size(); i++)
+       for(int i = 0; i < m_parentList->size(); i++)
                if (m_parentList->get(i)->getObjectClass() == OBJECT_CLUSTER)
                {
                        pCluster = (Cluster *)m_parentList->get(i);
@@ -6781,7 +6774,7 @@ NXSL_Array *Node::getParentsForNXSL()
        int index = 0;
 
        lockParentList(FALSE);
-       for(UINT32 i = 0; i < m_parentList->size(); i++)
+       for(int i = 0; i < m_parentList->size(); i++)
        {
           NetObj *object = m_parentList->get(i);
                if (((object->getObjectClass() == OBJECT_CONTAINER) ||
index 4cf46e9..f873181 100644 (file)
@@ -1546,9 +1546,6 @@ UINT32 AgentConnection::getConfigFile(TCHAR **ppszConfig, UINT32 *pdwSize)
 {
    UINT32 i, dwRqId, dwResult;
    NXCPMessage msg(m_nProtocolVersion), *pResponse;
-#ifdef UNICODE
-   BYTE *pBuffer;
-#endif
 
    *ppszConfig = NULL;
    *pdwSize = 0;