diff --git a/CLI/CLI.c b/CLI/CLI.c index a4544b1..3daced7 100644 --- a/CLI/CLI.c +++ b/CLI/CLI.c @@ -78,7 +78,8 @@ char* fifoToString(FIFOBuffChar_t* fifo) char* out = malloc(fifo->size + 1); char* write_p = out; - for (int i = fifo->size; i > 0; i--) + int i; + for (i = fifo->size; i > 0; i--) { FIFOBuffChar_get(fifo, write_p); write_p++; @@ -111,6 +112,7 @@ void CLI_PrintHistory() void historyPrevius() { char* line; + int i; if ( (History_getCurrPos(History) == History_getSize(History)) && (FIFOBuffChar_getSize(FIFO) > 0) @@ -119,7 +121,7 @@ void historyPrevius() // add current text to end of history line = fifoToString(FIFO); History_put(History, line); - for (int i=0; *(line + i) != '\0'; i++) + for (i=0; *(line + i) != '\0'; i++) { CLI_stringOut((char*)"\x1b[D \x1b[D"); } @@ -139,7 +141,7 @@ void historyPrevius() // write line if ((ret >= 0) && (line != NULL)) { - for (int i=0; *(line + i) != '\0'; i++) + for (i=0; *(line + i) != '\0'; i++) { CLI_charIn(*(line + i)); } @@ -161,7 +163,8 @@ void historyNext() // write line if ((ret >= 0) && (line != NULL)) { - for (int i=0; *(line + i) != '\0'; i++) + int i; + for (i=0; *(line + i) != '\0'; i++) { CLI_charIn(*(line + i)); } diff --git a/CMDList/CMDList.c b/CMDList/CMDList.c index 61547a8..d785fd3 100644 --- a/CMDList/CMDList.c +++ b/CMDList/CMDList.c @@ -19,7 +19,8 @@ int CMDList_deinit(CMDList_t *list) { CMDList_t** list_p = (CMDList_t**)list; - for (int i = 0; i < 26; i++) + int i; + for (i = 0; i < 26; i++) { if (*(list_p + i) != NULL) { diff --git a/FIFOBuff/FIFOBuffChar.c b/FIFOBuff/FIFOBuffChar.c index 6f41aef..6801ad6 100644 --- a/FIFOBuff/FIFOBuffChar.c +++ b/FIFOBuff/FIFOBuffChar.c @@ -141,6 +141,7 @@ bool FIFOBuffChar_pop(FIFOBuffChar_t *fifo) default: // buffer is at least 2 element big // find the second last element + { FIFOBuffChar_element_t* secondLastEl = fifo->FirstEl_p; while ( secondLastEl->nextElement != fifo->LastEl_p @@ -158,6 +159,7 @@ bool FIFOBuffChar_pop(FIFOBuffChar_t *fifo) fifo->size--; ok = true; break; + } } return ok;