From 77f906376e82ba7a8608494780d481aa44b54aa3 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 7 Oct 2015 10:36:50 +0200 Subject: [PATCH] minor: fixed coding style (lwip style) --- src/core/netif.c | 2 +- src/core/snmp/mib2.c | 6 +++--- src/core/snmp/mib_structs.c | 10 +++++----- src/core/snmp/msg_in.c | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/netif.c b/src/core/netif.c index be4ac196..4e28fb29 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -722,7 +722,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p) #if LWIP_LOOPBACK_MAX_PBUFS clen = pbuf_clen(r); /* check for overflow or too many pbuf on queue */ - if(((netif->loop_cnt_current + clen) < netif->loop_cnt_current) || + if (((netif->loop_cnt_current + clen) < netif->loop_cnt_current) || ((netif->loop_cnt_current + clen) > LWIP_LOOPBACK_MAX_PBUFS)) { pbuf_free(r); LINK_STATS_INC(link.memerr); diff --git a/src/core/snmp/mib2.c b/src/core/snmp/mib2.c index 0c105d58..515517ca 100644 --- a/src/core/snmp/mib2.c +++ b/src/core/snmp/mib2.c @@ -764,7 +764,7 @@ void mib2_netif_removed(struct netif *ni) snmp_mib_node_delete(&iflist_root, iflist_root.tail); /* disable getnext traversal on empty table */ - if(iflist_root.count == 0) { + if (iflist_root.count == 0) { iftable.maxlength = 0; } } @@ -881,10 +881,10 @@ void mib2_remove_arp_entry(struct netif *ni, ip4_addr_t *ip) } } /* disable getnext traversal on empty tables */ - if(arptree_root.count == 0) { + if (arptree_root.count == 0) { at.maxlength = 0; } - if(ipntomtree_root.count == 0) { + if (ipntomtree_root.count == 0) { ipntomtable.maxlength = 0; } } diff --git a/src/core/snmp/mib_structs.c b/src/core/snmp/mib_structs.c index 7fa39319..66226ce7 100644 --- a/src/core/snmp/mib_structs.c +++ b/src/core/snmp/mib_structs.c @@ -442,7 +442,7 @@ snmp_search_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru LWIP_DEBUGF(SNMP_MIB_DEBUG,("an search failed, short object identifier\n")); return NULL; } - } else if(node_type == MIB_NODE_LR) { + } else if (node_type == MIB_NODE_LR) { const struct mib_list_rootnode *lrn; struct mib_list_node *ln; @@ -477,7 +477,7 @@ snmp_search_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru LWIP_DEBUGF(SNMP_MIB_DEBUG,("ln search failed, short object identifier\n")); return NULL; } - } else if(node_type == MIB_NODE_EX) { + } else if (node_type == MIB_NODE_EX) { const struct mib_external_node *en; u16_t i, len; @@ -674,7 +674,7 @@ snmp_expand_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru climb_tree = 1; } } - } else if(node_type == MIB_NODE_LR) { + } else if (node_type == MIB_NODE_LR) { const struct mib_list_rootnode *lrn; struct mib_list_node *ln; @@ -760,7 +760,7 @@ snmp_expand_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru climb_tree = 1; } } - } else if(node_type == MIB_NODE_EX) { + } else if (node_type == MIB_NODE_EX) { const struct mib_external_node *en; s32_t ex_id; @@ -844,7 +844,7 @@ snmp_expand_tree(const struct mib_node *node, u8_t ident_len, s32_t *ident, stru ext_level++; } } - } else if(node_type == MIB_NODE_SC) { + } else if (node_type == MIB_NODE_SC) { /* scalar node */ if (ident_len > 0) { /* at .0 */ diff --git a/src/core/snmp/msg_in.c b/src/core/snmp/msg_in.c index 38606652..8e907453 100644 --- a/src/core/snmp/msg_in.c +++ b/src/core/snmp/msg_in.c @@ -286,7 +286,7 @@ snmp_msg_get_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) if (vb->value != NULL) { vb->value_len = en->get_value_a(request_id, &msg_ps->ext_object_def, vb->value); LWIP_ASSERT("SNMP_MAX_VALUE_SIZE is configured too low", vb->value_len <= SNMP_MAX_VALUE_SIZE); - if(vb->value_len == 0) + if (vb->value_len == 0) { memp_free(MEMP_SNMP_VALUE, vb->value); vb->value = NULL; @@ -335,7 +335,7 @@ snmp_msg_get_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->ext_name_ptr = np; en->get_object_def_q(en->addr_inf, request_id, np.ident_len, np.ident); - } else if((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { + } else if ((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { /* internal object */ struct obj_def object_def; const struct mib_scalar_node *msn = (const struct mib_scalar_node*)(const void*)mn; @@ -368,7 +368,7 @@ snmp_msg_get_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) if (vb->value != NULL) { vb->value_len = msn->get_value(&object_def, vb->value); LWIP_ASSERT("SNMP_MAX_OCTET_STRING_LEN is configured too low", vb->value_len <= SNMP_MAX_VALUE_SIZE); - if(vb->value_len == 0) { + if (vb->value_len == 0) { memp_free(MEMP_SNMP_VALUE, vb->value); vb->value = NULL; } @@ -488,7 +488,7 @@ snmp_msg_getnext_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->ext_oid = oid; en->get_object_def_q(en->addr_inf, request_id, 1, &oid.id[oid.len - 1]); - } else if((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { + } else if ((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { /* internal object */ struct obj_def object_def; struct snmp_varbind *vb; @@ -632,7 +632,7 @@ snmp_msg_set_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->ext_name_ptr = np; en->get_object_def_q(en->addr_inf, request_id, np.ident_len, np.ident); - } else if((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { + } else if ((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { /* internal object */ struct obj_def object_def; const struct mib_scalar_node *msn = (const struct mib_scalar_node*)(const void*)mn; @@ -705,7 +705,7 @@ snmp_msg_set_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->ext_name_ptr = np; en->get_object_def_q(en->addr_inf, request_id, np.ident_len, np.ident); - } else if((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { + } else if ((mn->node_type == MIB_NODE_SC) || (mn->node_type == MIB_NODE_LR)) { /* internal object */ struct obj_def object_def; const struct mib_scalar_node *msn = (const struct mib_scalar_node*)(const void*)mn; @@ -749,7 +749,7 @@ snmp_msg_event(u8_t request_id) snmp_msg_getnext_event(request_id, msg_ps); } else if (msg_ps->rt == SNMP_ASN1_PDU_GET_REQ) { snmp_msg_get_event(request_id, msg_ps); - } else if(msg_ps->rt == SNMP_ASN1_PDU_SET_REQ) { + } else if (msg_ps->rt == SNMP_ASN1_PDU_SET_REQ) { snmp_msg_set_event(request_id, msg_ps); } }