Przeglądaj źródła

fix error caused by incorrect implicit casting

Fischer, Simon 3 lat temu
rodzic
commit
bdbff61e38
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/shellmatta.c

+ 3 - 2
src/shellmatta.c

@@ -392,7 +392,7 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
         {
             // TODO: Move this into shellmatta_transport.c
             /* use headerCounter to watch how many header fields have been worked on */
-            uint8_t headerCounter = 0;
+            uint8_t headerCounter = 0u;
             while ( (size > headerCounter) 
                 ||  (   (true == transportLayerInst.mandatory)
                     &&  (size > headerCounter))
@@ -413,7 +413,7 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
                     break;
 
                 case STATE_GET_PAYLOAD_LENGTH:
-                    payloadLength = data[headerCounter];
+                    payloadLength = (uint8_t)data[headerCounter];
                     break;
 
                 case STATE_GET_SOURCE:
@@ -462,6 +462,7 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
 
                 headerCounter++;
 
+                /* processes payload by forwarding it recursively without transport layer to processData() */
                 if (transportLayerInst.state == STATE_PROCESS_PAYLOAD)
                 {
                     /* replace inst->write function pointer with transport layer write function */