add -Wextra: further code cleanup

please fix Wno-unused-parameter -Wno-missing-field-initializers in the future
This commit is contained in:
yparitcher
2019-01-06 11:41:56 -05:00
parent 400b37a96a
commit 1dd835d698
14 changed files with 35 additions and 32 deletions

View File

@@ -38,7 +38,7 @@ void BOOT_boot(void)
((pFunction)bootAddress[1])();
}
int main(int argc, char * argv[])
int main()
{
uint8_t hidmsg[64];
uint32_t t1 = 0;

View File

@@ -43,7 +43,7 @@ endif
DEFINES = -DDEBUG_LEVEL=$(DEBUG) -D$(CHIP) -DAES256=1 -DUSE_FULL_LL_DRIVER -DAPP_CONFIG=\"app.h\" $(EXTRA_DEFINES)
# DEFINES += -DTEST_SOLO_STM32 -DTEST -DTEST_FIFO=1
CFLAGS=$(INC) -c $(DEFINES) -Wall -fdata-sections -ffunction-sections $(HW) -g $(VERSION_FLAGS)
CFLAGS=$(INC) -c $(DEFINES) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fdata-sections -ffunction-sections $(HW) -g $(VERSION_FLAGS)
LDFLAGS_LIB=$(HW) $(SEARCH) -specs=nano.specs -specs=nosys.specs -Wl,--gc-sections -u _printf_float -lnosys
LDFLAGS=$(HW) $(LDFLAGS_LIB) -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref -Wl,-Bstatic -ltinycbor

View File

@@ -41,7 +41,7 @@ endif
DEFINES = -DDEBUG_LEVEL=$(DEBUG) -D$(CHIP) -DAES256=1 -DUSE_FULL_LL_DRIVER -DAPP_CONFIG=\"bootloader.h\" $(EXTRA_DEFINES)
# DEFINES += -DTEST_SOLO_STM32 -DTEST -DTEST_FIFO=1
CFLAGS=$(INC) -c $(DEFINES) -Wall -fdata-sections -ffunction-sections $(HW) -g $(VERSION_FLAGS)
CFLAGS=$(INC) -c $(DEFINES) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fdata-sections -ffunction-sections $(HW) -g $(VERSION_FLAGS)
LDFLAGS_LIB=$(HW) $(SEARCH) -specs=nano.specs -specs=nosys.specs -Wl,--gc-sections -lnosys
LDFLAGS=$(HW) $(LDFLAGS_LIB) -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref -Wl,-Bstatic

View File

@@ -99,7 +99,7 @@ void crypto_sha256_final(uint8_t * hash)
void crypto_sha256_hmac_init(uint8_t * key, uint32_t klen, uint8_t * hmac)
{
uint8_t buf[64];
int i;
unsigned int i;
memset(buf, 0, sizeof(buf));
if (key == CRYPTO_MASTER_KEY)
@@ -133,7 +133,7 @@ void crypto_sha256_hmac_init(uint8_t * key, uint32_t klen, uint8_t * hmac)
void crypto_sha256_hmac_final(uint8_t * key, uint32_t klen, uint8_t * hmac)
{
uint8_t buf[64];
int i;
unsigned int i;
crypto_sha256_final(hmac);
memset(buf, 0, sizeof(buf));
if (key == CRYPTO_MASTER_KEY)

View File

@@ -63,7 +63,7 @@ uint32_t millis()
return (((uint32_t)TIM6->CNT) + (__90_ms * 90));
}
void device_set_status(int status)
void device_set_status(uint32_t status)
{
__disable_irq();
__last_update = millis();

View File

@@ -133,7 +133,7 @@ void flash_write_dword(uint32_t addr, uint64_t data)
void flash_write(uint32_t addr, uint8_t * data, size_t sz)
{
int i;
unsigned int i;
uint8_t buf[8];
while (FLASH->SR & (1<<16))
;