MISRAC2012-Rule-20.7: don't use comma operator

This commit is contained in:
Matthias Ringwald 2019-11-19 12:21:02 +01:00
parent 5efd501109
commit 15a2796783
2 changed files with 5 additions and 3 deletions

View File

@ -1607,9 +1607,9 @@ void hfp_log_rfcomm_message(const char * tag, uint8_t * packet, uint16_t size){
#ifdef ENABLE_LOG_INFO
// encode \n\r
char printable[HFP_HF_RX_DEBUG_PRINT_LINE+2];
int i;
int i = 0;
int pos;
for (i=0,pos=0;(pos < size) && (i < (HFP_HF_RX_DEBUG_PRINT_LINE - 3)); pos++){
for (pos=0 ; (pos < size) && (i < (HFP_HF_RX_DEBUG_PRINT_LINE - 3)) ; pos++){
switch (packet[pos]){
case '\n':
printable[i++] = '\\';

View File

@ -439,7 +439,9 @@ static int hci_is_le_connection(hci_connection_t * connection){
static int nr_hci_connections(void){
int count = 0;
btstack_linked_item_t *it;
for (it = (btstack_linked_item_t *) hci_stack->connections; it ; it = it->next, count++);
for (it = (btstack_linked_item_t *) hci_stack->connections; it ; it = it->next){
count++;
}
return count;
}