Browse Source

gnrc: fix cppcheck warnings

master
Martine Lenders 6 years ago committed by Oleg Hahm
parent
commit
c2c2516a53
  1. 2
      sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c
  2. 3
      sys/net/gnrc/routing/rpl/p2p/gnrc_rpl_p2p.c
  3. 3
      sys/net/gnrc/sock/udp/gnrc_sock_udp.c

2
sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c

@ -792,6 +792,8 @@ void gnrc_ipv6_netif_init_by_dev(void)
kernel_pid_t ifs[GNRC_NETIF_NUMOF];
size_t ifnum = gnrc_netif_get(ifs);
#ifdef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER
/* cppcheck-suppress unreadVariable
* (reason: cppcheck bug. abr_init is read in if below) */
bool abr_init = false;
#endif

3
sys/net/gnrc/routing/rpl/p2p/gnrc_rpl_p2p.c

@ -48,9 +48,8 @@ const uint8_t gnrc_rpl_p2p_lifetime_lookup[4] = { 1, 4, 16, 64 };
void gnrc_rpl_p2p_update(void)
{
gnrc_rpl_p2p_ext_t *p2p_ext;
for (uint8_t i = 0; i < GNRC_RPL_P2P_EXTS_NUMOF; ++i) {
p2p_ext = &gnrc_rpl_p2p_exts[i];
gnrc_rpl_p2p_ext_t *p2p_ext = &gnrc_rpl_p2p_exts[i];
if ((p2p_ext->state) && (p2p_ext->lifetime_sec > 0)) {
p2p_ext->lifetime_sec -= GNRC_RPL_LIFETIME_UPDATE_STEP;
if (p2p_ext->lifetime_sec <= 0) {

3
sys/net/gnrc/sock/udp/gnrc_sock_udp.c

@ -69,10 +69,9 @@ static bool _dyn_port_used(uint16_t port)
*/
static uint16_t _get_dyn_port(sock_udp_t *sock)
{
uint16_t port;
unsigned count = GNRC_SOCK_DYN_PORTRANGE_NUM;
do {
port = GNRC_SOCK_DYN_PORTRANGE_MIN +
uint16_t port = GNRC_SOCK_DYN_PORTRANGE_MIN +
(_dyn_port_next * GNRC_SOCK_DYN_PORTRANGE_OFF) % GNRC_SOCK_DYN_PORTRANGE_NUM;
_dyn_port_next++;
if ((sock == NULL) || (sock->flags & SOCK_FLAGS_REUSE_EP) ||

Loading…
Cancel
Save