shell: commands: fix nano specs issues for ifconfig command

This commit is contained in:
Martine Lenders 2016-01-05 23:13:10 +01:00
parent 921f9d440c
commit 950b80cce7

View File

@ -201,6 +201,7 @@ static void _netif_list(kernel_pid_t dev)
netopt_state_t state; netopt_state_t state;
netopt_enable_t enable; netopt_enable_t enable;
bool linebreak = false; bool linebreak = false;
#ifdef MODULE_GNRC_IPV6_NETIF #ifdef MODULE_GNRC_IPV6_NETIF
gnrc_ipv6_netif_t *entry = gnrc_ipv6_netif_get(dev); gnrc_ipv6_netif_t *entry = gnrc_ipv6_netif_get(dev);
char ipv6_addr[IPV6_ADDR_MAX_STR_LEN]; char ipv6_addr[IPV6_ADDR_MAX_STR_LEN];
@ -255,7 +256,7 @@ static void _netif_list(kernel_pid_t dev)
if (res >= 0) { if (res >= 0) {
res = gnrc_netapi_get(dev, NETOPT_CSMA, 0, &enable, sizeof(enable)); res = gnrc_netapi_get(dev, NETOPT_CSMA, 0, &enable, sizeof(enable));
if ((res >= 0) && (enable == NETOPT_ENABLE)) { if ((res >= 0) && (enable == NETOPT_ENABLE)) {
printf(" CSMA Retries: %" PRIu8 " ", *((uint8_t *) &u8)); printf(" CSMA Retries: %u ", (unsigned)u8);
} }
} }
@ -320,7 +321,7 @@ static void _netif_list(kernel_pid_t dev)
#ifdef MODULE_GNRC_IPV6_NETIF #ifdef MODULE_GNRC_IPV6_NETIF
if (entry != NULL) { if (entry != NULL) {
printf("MTU:%" PRIu16 " ", entry->mtu); printf("MTU:%" PRIu16 " ", entry->mtu);
printf("HL:%" PRIu8 " ", entry->cur_hl); printf("HL:%u ", (unsigned)entry->cur_hl);
if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) { if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) {
printf("6LO "); printf("6LO ");
} }
@ -370,8 +371,7 @@ static void _netif_list(kernel_pid_t dev)
if (ipv6_addr_to_str(ipv6_addr, &entry->addrs[i].addr, if (ipv6_addr_to_str(ipv6_addr, &entry->addrs[i].addr,
IPV6_ADDR_MAX_STR_LEN)) { IPV6_ADDR_MAX_STR_LEN)) {
printf("%s/%" PRIu8 " scope: ", ipv6_addr, printf("%s/%u scope: ", ipv6_addr, (unsigned)entry->addrs[i].prefix_len);
entry->addrs[i].prefix_len);
if ((ipv6_addr_is_link_local(&entry->addrs[i].addr))) { if ((ipv6_addr_is_link_local(&entry->addrs[i].addr))) {
printf("local"); printf("local");
@ -526,6 +526,7 @@ static int _netif_set_addr(kernel_pid_t dev, netopt_t opt, char *addr_str)
static int _netif_set_state(kernel_pid_t dev, char *state_str) static int _netif_set_state(kernel_pid_t dev, char *state_str)
{ {
netopt_state_t state; netopt_state_t state;
if ((strcmp("off", state_str) == 0) || (strcmp("OFF", state_str) == 0)) { if ((strcmp("off", state_str) == 0) || (strcmp("OFF", state_str) == 0)) {
state = NETOPT_STATE_OFF; state = NETOPT_STATE_OFF;
} }
@ -930,7 +931,7 @@ int _netif_config(int argc, char **argv)
gnrc_ipv6_netif_t *entry; gnrc_ipv6_netif_t *entry;
if (((hl = atoi(argv[3])) < 0) || (hl > UINT8_MAX)) { if (((hl = atoi(argv[3])) < 0) || (hl > UINT8_MAX)) {
printf("error: Hop limit must be between %" PRIu16 " and %" PRIu16 "\n", printf("error: Hop limit must be between %" PRIu16 " and %" PRIu16 "\n",
(uint16_t)0, (uint16_t)UINT16_MAX); (uint16_t)0, (uint16_t)UINT16_MAX);
return 1; return 1;
} }
if ((entry = gnrc_ipv6_netif_get(dev)) == NULL) { if ((entry = gnrc_ipv6_netif_get(dev)) == NULL) {