diff --git a/boards/msba2-common/tools/src/download.c b/boards/msba2-common/tools/src/download.c index 6a6229cdb7..3fa338d4e9 100644 --- a/boards/msba2-common/tools/src/download.c +++ b/boards/msba2-common/tools/src/download.c @@ -854,7 +854,7 @@ static void download_main(int event) // bootloader again. Intead, we need to download a tiny ARM // program that reconfigures the hardware and then jumps to zero. //snprintf(buf, sizeof(buf), "G %d A\r\n", 0); - snprintf(buf, sizeof(buf), "W %u %d\r\n", chip->ram_addr, chip->bootprog[0] * 4); + snprintf(buf, sizeof(buf), "W %u %u\r\n", chip->ram_addr, chip->bootprog[0] * 4); xmit_cmd(buf, 4); return; diff --git a/boards/msba2-common/tools/src/ihex.c b/boards/msba2-common/tools/src/ihex.c index 5db4cb7511..8d4965b9d5 100644 --- a/boards/msba2-common/tools/src/ihex.c +++ b/boards/msba2-common/tools/src/ihex.c @@ -120,8 +120,8 @@ int read_intel_hex(const char *filename) int parse_hex_line(char *line) { - int addr, code, num; - int sum, len, cksum, i; + unsigned int addr, code, num; + unsigned int sum, len, cksum, i; char *ptr; num = 0; diff --git a/core/assert.c b/core/assert.c index 35c9d5359e..873634467d 100644 --- a/core/assert.c +++ b/core/assert.c @@ -20,7 +20,7 @@ #ifdef DEBUG_ASSERT_VERBOSE NORETURN void _assert_failure(const char *file, unsigned line) { - printf("%s:%d => ", file, line); \ + printf("%s:%u => ", file, line); \ core_panic(PANIC_ASSERT_FAIL, assert_crash_message); \ } #else diff --git a/cpu/lm4f120/periph/gpio.c b/cpu/lm4f120/periph/gpio.c index 76ded871e2..24660a95e6 100644 --- a/cpu/lm4f120/periph/gpio.c +++ b/cpu/lm4f120/periph/gpio.c @@ -98,7 +98,7 @@ int gpio_init(gpio_t pin, gpio_mode_t mode) const uint32_t port_addr = _port_base[port_num]; const uint8_t pin_num = _pin_num(pin); const uint32_t sysctl_port_base = _sysctl_port_base[port_num]; - const unsigned long pin_bit = 1 << pin_num; + const unsigned long pin_bit = 1ul << pin_num; DEBUG("Init GPIO: port %c, %d\n", 'A' + port_num, pin_num); DEBUG("Sysctl %" PRIx32 "\n", sysctl_port_base); diff --git a/cpu/lpc2387/mci/lpc2387-mci.c b/cpu/lpc2387/mci/lpc2387-mci.c index 77207ed117..a1045f510a 100644 --- a/cpu/lpc2387/mci/lpc2387-mci.c +++ b/cpu/lpc2387/mci/lpc2387-mci.c @@ -380,6 +380,8 @@ static int send_cmd(unsigned int idx, unsigned long arg, unsigned int rt, unsign { unsigned int s, mc; + assert(buff != NULL); + if (idx & 0x80) { /* Send a CMD55 prior to the specified command if it is ACMD class */ if (!send_cmd(CMD55, (unsigned long)CardRCA << 16, 1, buff) /* When CMD55 is faild, */ || !(buff[0] & 0x00000020)) { diff --git a/dist/tools/cppcheck/check.sh b/dist/tools/cppcheck/check.sh index c2d153bf43..b79884fafb 100755 --- a/dist/tools/cppcheck/check.sh +++ b/dist/tools/cppcheck/check.sh @@ -17,7 +17,7 @@ else fi BRANCH=${1} -FILEREGEX='\.([sScHh]|cpp)$' +FILEREGEX='\.([CcHhSs]|[ch]pp)$' EXCLUDE='^(cpu/saml21/include/atmel/)|^(cpu/cortexm_common/include/)' # If no branch but an option is given, unset BRANCH. diff --git a/sys/arduino/include/serialport.hpp b/sys/arduino/include/serialport.hpp index c373afbbb3..f9a22ca0fd 100644 --- a/sys/arduino/include/serialport.hpp +++ b/sys/arduino/include/serialport.hpp @@ -55,7 +55,7 @@ public: * * @param[in] dev RIOT UART device */ - SerialPort(uart_t dev); + explicit SerialPort(uart_t dev); /** * @brief Get the number of bytes (characters) available for reading from