1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #6622 from gebart/pr/cppcheck-fixes

cppcheck fixes 1
This commit is contained in:
Martine Lenders 2017-02-17 16:11:11 +01:00 committed by GitHub
commit 4b5952e0ad
7 changed files with 9 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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)) {

View File

@ -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.

View File

@ -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