Skip to content

Commit b2d4b01

Browse files
committed
enale Wextra
clean up some warning
1 parent 01ac2b3 commit b2d4b01

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ CFLAGS += \
230230
-Wall \
231231
-Werror \
232232
-Wfatal-errors \
233+
-Wextra
233234

234-
CFLAGS += -Wno-error=unused-parameter
235+
# Suppress warning caused by SDK
236+
CFLAGS += -Wno-error=unused-parameter -Wno-error=expansion-to-defined
237+
238+
# TinyUSB tusb_hal_nrf_power_event
239+
CFLAGS += -Wno-error=cast-function-type
235240

236241
# Defined Symbol (MACROS)
237242
CFLAGS += -D__HEAP_SIZE=0

src/usb/uf2/compile_date.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ SOFTWARE.
5050
: 12u /*Dec*/ )
5151

5252
#define __DAY_INT__ ( \
53-
(__DATE__ [4u] == ' ' ? 0u : __DATE__ [4u] - '0') * 10u \
53+
(__DATE__ [4u] == ' ' ? 0 : __DATE__ [4u] - '0') * 10u \
5454
+ (__DATE__ [5u] - '0') )
5555

5656
// __TIME__ expands to an eight-character string constant
5757
// "23:59:01", or (if cannot determine time) "??:??:??"
5858
#define __HOUR_INT__ ( \
59-
(__TIME__ [0u] == '?' ? 0u : __TIME__ [0u] - '0') * 10u \
60-
+ (__TIME__ [1u] == '?' ? 0u : __TIME__ [1u] - '0') )
59+
(__TIME__ [0u] == '?' ? 0 : __TIME__ [0u] - '0') * 10u \
60+
+ (__TIME__ [1u] == '?' ? 0 : __TIME__ [1u] - '0') )
6161

6262
#define __MINUTE_INT__ ( \
63-
(__TIME__ [3u] == '?' ? 0u : __TIME__ [3u] - '0') * 10u \
64-
+ (__TIME__ [4u] == '?' ? 0u : __TIME__ [4u] - '0') )
63+
(__TIME__ [3u] == '?' ? 0 : __TIME__ [3u] - '0') * 10u \
64+
+ (__TIME__ [4u] == '?' ? 0 : __TIME__ [4u] - '0') )
6565

6666
#define __SECONDS_INT__ ( \
67-
(__TIME__ [6u] == '?' ? 0u : __TIME__ [6u] - '0') * 10u \
68-
+ (__TIME__ [7u] == '?' ? 0u : __TIME__ [7u] - '0') )
67+
(__TIME__ [6u] == '?' ? 0 : __TIME__ [6u] - '0') * 10u \
68+
+ (__TIME__ [7u] == '?' ? 0 : __TIME__ [7u] - '0') )
6969

7070

7171
#define __DOSDATE__ ( \

src/usb/uf2/ghostfat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ void read_block(uint32_t block_no, uint8_t *data) {
214214
// WARNING -- code presumes only one NULL .content for .UF2 file
215215
// and all non-NULL .content fit in one sector
216216
// and requires it be the last element of the array
217-
for (int i = 1; i < NUM_FILES * 2 + 4; ++i) {
217+
for (uint32_t i = 1; i < NUM_FILES * 2 + 4; ++i) {
218218
data[i] = 0xff;
219219
}
220220
}
221-
for (int i = 0; i < 256; ++i) { // Generate the FAT chain for the firmware "file"
221+
for (uint32_t i = 0; i < 256; ++i) { // Generate the FAT chain for the firmware "file"
222222
uint32_t v = sectionIdx * 256 + i;
223223
if (UF2_FIRST_SECTOR <= v && v <= UF2_LAST_SECTOR)
224224
((uint16_t *)(void *)data)[i] = v == UF2_LAST_SECTOR ? 0xffff : v + 1;
@@ -237,7 +237,7 @@ void read_block(uint32_t block_no, uint8_t *data) {
237237
remainingEntries--;
238238
}
239239

240-
for (int i = DIRENTRIES_PER_SECTOR * sectionIdx;
240+
for (uint32_t i = DIRENTRIES_PER_SECTOR * sectionIdx;
241241
remainingEntries > 0 && i < NUM_FILES;
242242
i++, d++) {
243243

0 commit comments

Comments
 (0)