]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
Fixed compile error because of missed type casting in certain compiler (http://www...
authoretisserant <etisserant>
Fri, 8 Jun 2007 12:41:17 +0000 (12:41 +0000)
committeretisserant <etisserant>
Fri, 8 Jun 2007 12:41:17 +0000 (12:41 +0000)
src/pdo.c
src/sdo.c
src/sync.c

index 6f54a1b1b1214ff2953eb60cea1d22046b8dc2dc..c033ff7b3941d20c0d14c5cedaa58d1c6ca1093a 100644 (file)
--- a/src/pdo.c
+++ b/src/pdo.c
@@ -194,7 +194,7 @@ UNS8 sendPDOrequest( CO_Data* d, UNS32 cobId )
   if (offset)
     while (offset <= lastIndex) {
       /* get the CobId*/
-      pwCobId = d->objdict[offset].pSubindex[1].pObject;
+      pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject;
 
       if ( *pwCobId  == cobId ) {
         s_PDO pdo;
@@ -269,7 +269,7 @@ UNS8 proceedPDO(CO_Data* d, Message *m)
         case state2:
           /* get CobId of the dictionary correspondant to the received
              PDO */
-          pwCobId = d->objdict[offsetObjdict].pSubindex[1].pObject;
+          pwCobId = (UNS32*) d->objdict[offsetObjdict].pSubindex[1].pObject;
           /* check the CobId coherance */
           /*pwCobId is the cobId read in the dictionary at the state 3
             */
@@ -293,12 +293,12 @@ UNS8 proceedPDO(CO_Data* d, Message *m)
                  dictionnary. */
                offsetObjdict = d->firstIndex->PDO_RCV_MAP;
              lastIndex = d->lastIndex->PDO_RCV_MAP;
-             pMappingCount = (d->objdict + offsetObjdict + numPdo)->pSubindex[0].pObject;
+             pMappingCount = (UNS8*) (d->objdict + offsetObjdict + numPdo)->pSubindex[0].pObject;
              numMap = 0;
              while (numMap < *pMappingCount) {
                UNS8 tmp[]= {0,0,0,0,0,0,0,0};
                UNS8 ByteSize;
-               pMappingParameter = (d->objdict + offsetObjdict + numPdo)->pSubindex[numMap + 1].pObject;
+               pMappingParameter = (UNS32*) (d->objdict + offsetObjdict + numPdo)->pSubindex[numMap + 1].pObject;
                if (pMappingParameter == NULL) {
                  MSG_ERR(0x1937, "Couldn't get mapping parameter : ", numMap + 1);
                  return 0xFF;
@@ -357,7 +357,7 @@ UNS8 proceedPDO(CO_Data* d, Message *m)
       case state1:/* check the CobId */
         /* get CobId of the dictionary which match to the received PDO
          */
-        pwCobId = (d->objdict + offsetObjdict)->pSubindex[1].pObject;
+        pwCobId = (UNS32*) (d->objdict + offsetObjdict)->pSubindex[1].pObject;
         if ( *pwCobId == (*m).cob_id.w ) {
           status = state4;
           break;
@@ -371,7 +371,7 @@ UNS8 proceedPDO(CO_Data* d, Message *m)
 
 
       case state4:/* check transmission type (after request?) */
-        pTransmissionType = d->objdict[offsetObjdict].pSubindex[2].pObject;
+        pTransmissionType = (UNS8*) d->objdict[offsetObjdict].pSubindex[2].pObject;
         if ( (*pTransmissionType == TRANS_RTR) || (*pTransmissionType == TRANS_RTR_SYNC ) || (*pTransmissionType == TRANS_EVENT) ) {
           status = state5;
           break;
@@ -386,10 +386,10 @@ UNS8 proceedPDO(CO_Data* d, Message *m)
       case state5:/* get mapped objects number */
         offsetObjdict = d->firstIndex->PDO_TRS_MAP;
         lastIndex = d->lastIndex->PDO_TRS_MAP;
-        pMappingCount = (d->objdict + offsetObjdict + numPdo)->pSubindex[0].pObject;
+        pMappingCount = (UNS8*) (d->objdict + offsetObjdict + numPdo)->pSubindex[0].pObject;
         numMap = 0;
         while (numMap < *pMappingCount) {
-          pMappingParameter = (d->objdict + offsetObjdict + numPdo)->pSubindex[numMap + 1].pObject;
+          pMappingParameter = (UNS32*) (d->objdict + offsetObjdict + numPdo)->pSubindex[numMap + 1].pObject;
           /* Get the mapped variable */
           Size = ((UNS8)(((*pMappingParameter) & 0xFF) >> 3));
           objDict = getODentry( d, (UNS16)((*pMappingParameter) >> (UNS8)16),
index 72a48c53b6b0e215583fb1202a33851d77c01b7d..b8faa33c6059a24b305e2e3754b9429cc98d19a4 100644 (file)
--- a/src/sdo.c
+++ b/src/sdo.c
@@ -518,7 +518,7 @@ UNS8 sendSDO (CO_Data* d, UNS8 whoami, s_SDO sdo)
       MSG_ERR(0x1A42, "SendSDO : No SDO server found", 0); 
       return 0xFF;
     }
-    pwCobId = d->objdict[offset].pSubindex[2].pObject;
+    pwCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject;
     MSG_WAR(0x3A41, "I am server. cobId : ", *pwCobId); 
   }
   else {                       /*case client*/
@@ -537,7 +537,7 @@ UNS8 sendSDO (CO_Data* d, UNS8 whoami, s_SDO sdo)
        MSG_ERR(0x1A28, "Subindex 3  not found at index ", 0x1280 + sdoNum);
        return 0xFF;
       }
-      pwNodeId = d->objdict[offset].pSubindex[3].pObject;
+      pwNodeId = (UNS32*) d->objdict[offset].pSubindex[3].pObject;
       MSG_WAR(0x3A44, "Found nodeId server = ", *pwNodeId);    
       if(*pwNodeId == sdo.nodeId) {
        found = 1;
@@ -551,7 +551,7 @@ UNS8 sendSDO (CO_Data* d, UNS8 whoami, s_SDO sdo)
       return 0xFF;
     }
     /* Second, read the cobid client->server */
-    pwCobId = d->objdict[offset].pSubindex[1].pObject;
+    pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject;
   }
   /* message copy for sending */
   m.cob_id.w = *pwCobId;
@@ -636,7 +636,7 @@ UNS8 proceedSDO (CO_Data* d, Message *m)
          MSG_ERR(0x1A61, "Subindex 1  not found at index ", 0x1200 + j);
          return 0xFF;
        }
-      pCobId = d->objdict[offset].pSubindex[1].pObject;
+      pCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject;
       if ( *pCobId == (*m).cob_id.w ) {
        whoami = SDO_SERVER;
        MSG_WAR(0x3A62, "proceedSDO. I am server. index : ", 0x1200 + j);
@@ -659,10 +659,10 @@ UNS8 proceedSDO (CO_Data* d, Message *m)
         return 0xFF;
        }
        /* a) Looking for the cobid received. */
-       pCobId = d->objdict[offset].pSubindex[2].pObject;
+       pCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject;
        if (*pCobId == (*m).cob_id.w ) {
         /* b) cobid found, so reading the node id of the server. */
-        pNodeId = d->objdict[offset].pSubindex[3].pObject;
+        pNodeId = (UNS32*) d->objdict[offset].pSubindex[3].pObject;
         whoami = SDO_CLIENT;
         nodeId_32 = *pNodeId;
         nodeId = (UNS8)nodeId_32;
@@ -1288,7 +1288,7 @@ INLINE UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index,
         return 0xFF;
      }
      /* looking for the nodeId server */
-     pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
+     pNodeIdServer = (UNS32*) d->objdict[offset].pSubindex[3].pObject;
      nodeIdServer = *pNodeIdServer;
      MSG_WAR(0x1AD2, "index : ", 0x1280 + i);
      MSG_WAR(0x1AD3, "nodeIdServer : ", nodeIdServer);
@@ -1448,7 +1448,7 @@ INLINE UNS8 _readNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subInde
         return 0xFF;
      }
      /* looking for the nodeId server */
-     pNodeIdServer = d->objdict[offset].pSubindex[3].pObject;
+     pNodeIdServer = (UNS32*) d->objdict[offset].pSubindex[3].pObject;
      nodeIdServer = *pNodeIdServer;
    
     if(nodeIdServer == (UNS32)nodeId) {
index 062f15c0e5c8988f48f9214b4adac6242d67665c..3d025f641eef764458a1322ad4939f70a2338b69 100644 (file)
@@ -192,7 +192,7 @@ UNS8 proceedSYNC(CO_Data* d, Message *m)
          MSG_ERR(0x1004, "Subindex 2  not found at index ", 0x1800 + pdoNum);\r
          return 0xFF;\r
        }\r
-      pTransmissionType = d->objdict[offsetObjdict].pSubindex[2].pObject;    \r
+      pTransmissionType = (UNS8*) d->objdict[offsetObjdict].pSubindex[2].pObject;    \r
       MSG_WAR(0x3005, "Reading PDO at index : ", 0x1800 + pdoNum);\r
       status = state4; \r
       break;     \r
@@ -215,16 +215,16 @@ UNS8 proceedSYNC(CO_Data* d, Message *m)
        break;\r
       }      \r
     case state5:       /* get PDO CobId */\r
-        pwCobId = d->objdict[offsetObjdict].pSubindex[1].pObject;     \r
+        pwCobId = (UNS32*) d->objdict[offsetObjdict].pSubindex[1].pObject;     \r
        MSG_WAR(0x3009, "  PDO CobId is : ", *pwCobId);\r
        status = state7;\r
        break;     \r
     case state7:  /* get mapped objects number to transmit with this PDO */\r
-      pMappingCount = d->objdict[offsetObjdictMap].pSubindex[0].pObject;\r
+      pMappingCount = (UNS8*) d->objdict[offsetObjdictMap].pSubindex[0].pObject;\r
        MSG_WAR(0x300D, "  Number of objects mapped : ",*pMappingCount );\r
        status = state8;\r
     case state8:       /* get mapping parameters */\r
-      pMappingParameter = d->objdict[offsetObjdictMap].pSubindex[prp_j + 1].pObject;\r
+      pMappingParameter = (UNS32*) d->objdict[offsetObjdictMap].pSubindex[prp_j + 1].pObject;\r
        MSG_WAR(0x300F, "  got mapping parameter : ", *pMappingParameter);\r
        MSG_WAR(0x3050, "    at index : ", 0x1A00 + pdoNum);\r
        MSG_WAR(0x3051, "    sub-index : ", prp_j + 1);\r