diff --git a/drivers/audio/es8388.c b/drivers/audio/es8388.c index cec1746fd5..b53d27b7c2 100644 --- a/drivers/audio/es8388.c +++ b/drivers/audio/es8388.c @@ -501,9 +501,11 @@ static void es8388_setvolume(FAR struct es8388_dev_s *priv, static void es8388_setmclkfrequency(FAR struct es8388_dev_s *priv) { + int i; + priv->mclk = 0; - for (int i = 0; i < nitems(es8388_mclk_rate); i++) + for (i = 0; i < nitems(es8388_mclk_rate); i++) { if (es8388_mclk_rate[i].sample_rate == priv->samprate) { diff --git a/drivers/lcd/lcddrv_spiif.c b/drivers/lcd/lcddrv_spiif.c index 33324bd68a..8e998f574b 100644 --- a/drivers/lcd/lcddrv_spiif.c +++ b/drivers/lcd/lcddrv_spiif.c @@ -139,10 +139,11 @@ static void lcddrv_spiif_deselect(FAR struct lcddrv_lcd_s *lcd) static int lcddrv_spiif_sendmulti(FAR struct lcddrv_lcd_s *lcd, FAR const uint16_t *wd, uint32_t nwords) { + uint32_t t; FAR struct lcddrv_spiif_lcd_s *priv = (FAR struct lcddrv_spiif_lcd_s *)lcd; SPI_SETBITS(priv->spi, 16); - for (uint32_t t = 0; t < nwords; t++) + for (t = 0; t < nwords; t++) { SPI_SEND(priv->spi, *wd++); } diff --git a/drivers/sensors/fakesensor.c b/drivers/sensors/fakesensor.c index da4633c4d1..541ad8707e 100644 --- a/drivers/sensors/fakesensor.c +++ b/drivers/sensors/fakesensor.c @@ -335,10 +335,11 @@ static int fakesensor_thread(int argc, char** argv) if (sensor->batch) { uint32_t batch_num = sensor->batch / sensor->interval; - uint64_t event_timestamp = sensor_get_timestamp() - sensor->interval * batch_num; - for (int i = 0; i < batch_num; i++) + int i; + + for (i = 0; i < batch_num; i++) { fakesensor_push_event(&sensor->lower, event_timestamp); event_timestamp += sensor->interval; diff --git a/libs/libc/locale/lib_iconv.c b/libs/libc/locale/lib_iconv.c index d61a6fd8b5..cdd8179750 100644 --- a/libs/libc/locale/lib_iconv.c +++ b/libs/libc/locale/lib_iconv.c @@ -863,10 +863,14 @@ size_t iconv(iconv_t cd, FAR char **in, FAR size_t *inb, c += 128; for (d = 0; d <= c; ) { + int i; + k = 0; - for (int i = 0; i < 126; i++) + for (i = 0; i < 126; i++) { - for (int j = 0; j < 190; j++) + int j; + + for (j = 0; j < 190; j++) { if (g_gb18030[i][j] - d <= c - d) { @@ -1060,10 +1064,14 @@ size_t iconv(iconv_t cd, FAR char **in, FAR size_t *inb, c += 0xac00; for (d = 0xac00; d <= c; ) { + int i; + k = 0; - for (int i = 0; i < 93; i++) + for (i = 0; i < 93; i++) { - for (int j = 0; j < 94; j++) + int j; + + for (j = 0; j < 94; j++) { if (g_ksc[i][j] - d <= c - d) { diff --git a/net/can/can_getsockopt.c b/net/can/can_getsockopt.c index d6d9153e82..74931a0938 100644 --- a/net/can/can_getsockopt.c +++ b/net/can/can_getsockopt.c @@ -123,6 +123,7 @@ int can_getsockopt(FAR struct socket *psock, int level, int option, else { int count = conn->filter_count; + int i; if (*value_len < count * sizeof(struct can_filter)) { @@ -133,9 +134,9 @@ int can_getsockopt(FAR struct socket *psock, int level, int option, *value_len = count * sizeof(struct can_filter); } - for (int i = 0; i < count; i++) + for (i = 0; i < count; i++) { - ((struct can_filter *)value)[i] = conn->filters[i]; + ((FAR struct can_filter *)value)[i] = conn->filters[i]; } } break; diff --git a/net/can/can_setsockopt.c b/net/can/can_setsockopt.c index dc45e7d4d9..1216588785 100644 --- a/net/can/can_setsockopt.c +++ b/net/can/can_setsockopt.c @@ -138,9 +138,11 @@ int can_setsockopt(FAR struct socket *psock, int level, int option, } else { + int i; + count = value_len / sizeof(struct can_filter); - for (int i = 0; i < count; i++) + for (i = 0; i < count; i++) { conn->filters[i] = ((struct can_filter *)value)[i]; }