소스 검색

fix error caused by incorrect implicit casting

Fischer, Simon 3 년 전
부모
커밋
bdbff61e38
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  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 */