1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 09:32:44 +01:00

tests: fix misc cppcheck warnings

This commit is contained in:
Kaspar Schleiser 2017-03-10 17:06:04 +01:00 committed by Oleg Hahm
parent 6928c5d4ed
commit 908429eb33
6 changed files with 8 additions and 4 deletions

View File

@ -33,7 +33,6 @@ int main(void)
{ {
hdc1000_t dev; hdc1000_t dev;
int16_t temp, hum; int16_t temp, hum;
size_t len;
char tstr[8]; char tstr[8];
char hstr[8]; char hstr[8];
@ -49,6 +48,7 @@ int main(void)
} }
while (1) { while (1) {
size_t len;
hdc1000_read(&dev, &temp, &hum); hdc1000_read(&dev, &temp, &hum);
len = fmt_s16_dfp(tstr, temp, 2); len = fmt_s16_dfp(tstr, temp, 2);

View File

@ -50,6 +50,8 @@ int main(void)
ret = pn532_init_i2c(&pn532, &pn532_conf[0]); ret = pn532_init_i2c(&pn532, &pn532_conf[0]);
#elif defined(PN532_SUPPORT_SPI) #elif defined(PN532_SUPPORT_SPI)
ret = pn532_init_spi(&pn532, &pn532_conf[0]); ret = pn532_init_spi(&pn532, &pn532_conf[0]);
#else
#error None of PN532_SUPPORT_I2C and PN532_SUPPORT_SPI set!
#endif #endif
if (ret != 0) { if (ret != 0) {

View File

@ -77,6 +77,8 @@ int main(void)
#endif #endif
puts("On-board LED test\n"); puts("On-board LED test\n");
/* cppcheck-suppress knownConditionTrueFalse
* rationale: board-dependent ifdefs */
if (numof == 0) { if (numof == 0) {
puts("NO LEDs AVAILABLE"); puts("NO LEDs AVAILABLE");
} }

View File

@ -31,7 +31,7 @@ int main(void)
uint8_t buf[LIMIT]; uint8_t buf[LIMIT];
puts("\nHWRNG peripheral driver test\n"); puts("\nHWRNG peripheral driver test\n");
printf("This test will print from 1 to %i random bytes about every " printf("This test will print from 1 to %u random bytes about every "
"second\n\n", LIMIT); "second\n\n", LIMIT);
puts("Initializing the HWRNG driver.\n"); puts("Initializing the HWRNG driver.\n");

View File

@ -68,7 +68,7 @@ int main(void) {
void *res; void *res;
pthread_join(th_id, (void **) &res); pthread_join(th_id, (void **) &res);
printf("Result: %u\n", (int) (intptr_t) res); printf("Result: %i\n", (int) (intptr_t) res);
puts("Done."); puts("Done.");
return 0; return 0;
} }

View File

@ -40,7 +40,7 @@ void tests_crypto(void);
*/ */
Test *tests_crypto_chacha_tests(void); Test *tests_crypto_chacha_tests(void);
static inline int compare(uint8_t a[16], uint8_t b[16], uint8_t len) static inline int compare(uint8_t *a, uint8_t *b, uint8_t len)
{ {
int result = 1; int result = 1;