Found some struct instances that can be const

This commit is contained in:
Dirk Ziegelmeier 2016-02-16 22:31:59 +01:00
parent 9dd1c81d41
commit 24bc77a935
4 changed files with 13 additions and 13 deletions

View File

@ -60,15 +60,15 @@ const struct snmp_obj_id_const_ref snmp_zero_dot_zero = { LWIP_ARRAYSIZE(snmp_ze
#if SNMP_LWIP_MIB2
#include "lwip/apps/snmp_mib2.h"
static const struct snmp_mib *default_mibs[] = { &mib2 };
static u8_t snmp_num_mibs = 1;
static const struct snmp_mib* const default_mibs[] = { &mib2 };
static u8_t snmp_num_mibs = 1;
#else
static const struct snmp_mib *default_mibs[] = { NULL };
static u8_t snmp_num_mibs = 0;
static const struct snmp_mib* const default_mibs[] = { NULL };
static u8_t snmp_num_mibs = 0;
#endif
/* List of known mibs */
static struct snmp_mib const **snmp_mibs = default_mibs;
static struct snmp_mib const * const *snmp_mibs = default_mibs;
/**
* Sets the MIBs to use.

View File

@ -195,7 +195,7 @@ CREATE_LWIP_SYNC_NODE(7, udp_endpointTable)
CREATE_LWIP_SYNC_NODE(8, udp_HCInDatagrams)
CREATE_LWIP_SYNC_NODE(9, udp_HCOutDatagrams)
static const struct snmp_node* udp_nodes[] = {
static const struct snmp_node* const udp_nodes[] = {
&SYNC_NODE_NAME(udp_inDatagrams).node.node,
&SYNC_NODE_NAME(udp_noPorts).node.node,
&SYNC_NODE_NAME(udp_inErrors).node.node,
@ -294,7 +294,7 @@ CREATE_LWIP_SYNC_NODE(18, tcp_HCOutSegs)
CREATE_LWIP_SYNC_NODE(19, tcp_ConnectionTable)
CREATE_LWIP_SYNC_NODE(20, tcp_ListenerTable)
static const struct snmp_node* tcp_nodes[] = {
static const struct snmp_node* const tcp_nodes[] = {
&SYNC_NODE_NAME(tcp_RtoAlgorithm).node.node,
&SYNC_NODE_NAME(tcp_RtoMin).node.node,
&SYNC_NODE_NAME(tcp_RtoMax).node.node,
@ -458,7 +458,7 @@ CREATE_LWIP_SYNC_NODE(22, ip_NetToMediaTable)
#endif /* LWIP_ARP */
CREATE_LWIP_SYNC_NODE(23, ip_RoutingDiscards)
static const struct snmp_node* ip_nodes[] = {
static const struct snmp_node* const ip_nodes[] = {
&SYNC_NODE_NAME(ip_Forwarding).node.node,
&SYNC_NODE_NAME(ip_DefaultTTL).node.node,
&SYNC_NODE_NAME(ip_InReceives).node.node,
@ -504,7 +504,7 @@ static const struct snmp_table_simple_node at_Table = SNMP_TABLE_CREATE_SIMPLE(1
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
CREATE_LWIP_SYNC_NODE(1, at_Table)
static const struct snmp_node* at_nodes[] = {
static const struct snmp_node* const at_nodes[] = {
&SYNC_NODE_NAME(at_Table).node.node
};
@ -568,7 +568,7 @@ static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE(
CREATE_LWIP_SYNC_NODE(1, interfaces_Number)
CREATE_LWIP_SYNC_NODE(2, interfaces_Table)
static const struct snmp_node* interface_nodes[] = {
static const struct snmp_node* const interface_nodes[] = {
&SYNC_NODE_NAME(interfaces_Number).node.node,
&SYNC_NODE_NAME(interfaces_Table).node.node
};
@ -593,7 +593,7 @@ static const struct snmp_scalar_array_node_def system_nodes[] = {
static const struct snmp_scalar_array_node system_node = SNMP_SCALAR_CREATE_ARRAY_NODE(1, system_nodes, system_get_value, system_set_test, system_set_value);
/* --- mib-2 .1.3.6.1.2.1 ----------------------------------------------------- */
static const struct snmp_node* mib2_nodes[] = {
static const struct snmp_node* const mib2_nodes[] = {
&system_node.node.node,
&interface_root.node,
#if LWIP_ARP && LWIP_IPV4

View File

@ -72,7 +72,7 @@
#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc)
#include "lwip/priv/memp_std.h"
const struct memp_desc *memp_pools[MEMP_MAX] = {
const struct memp_desc* const memp_pools[MEMP_MAX] = {
#define LWIP_MEMPOOL(name,num,size,desc) &memp_ ## name,
#include "lwip/priv/memp_std.h"
};

View File

@ -62,7 +62,7 @@ typedef enum {
* extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_my_private_pool[];
*/
extern const struct memp_desc *memp_pools[MEMP_MAX];
extern const struct memp_desc* const memp_pools[MEMP_MAX];
#define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name