From patchwork Wed Feb 29 07:15:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/6] const-ify static data objects Date: Tue, 28 Feb 2012 21:15:38 -0000 From: Jan Engelhardt X-Patchwork-Id: 143673 Message-Id: <1330499742-28091-3-git-send-email-jengelh@medozas.de> To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org Signed-off-by: Jan Engelhardt --- src/libnetfilter_cttimeout.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c index 2f1ba79..6050514 100644 --- a/src/libnetfilter_cttimeout.c +++ b/src/libnetfilter_cttimeout.c @@ -21,7 +21,7 @@ #include -static char *tcp_state_to_name[] = { +static const char *const tcp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_TCP_SYN_SENT] = "SYN_SENT", [NFCT_TIMEOUT_ATTR_TCP_SYN_RECV] = "SYN_RECV", [NFCT_TIMEOUT_ATTR_TCP_ESTABLISHED] = "ESTABLISHED", @@ -35,16 +35,16 @@ static char *tcp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_TCP_UNACK] = "UNACKNOWLEDGED", }; -static char *generic_state_to_name[] = { +static const char *const generic_state_to_name[] = { [NFCT_TIMEOUT_ATTR_GENERIC] = "TIMEOUT", }; -static char *udp_state_to_name[] = { +static const char *const udp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_UDP_UNREPLIED] = "UNREPLIED", [NFCT_TIMEOUT_ATTR_UDP_REPLIED] = "REPLIED", }; -static char *sctp_state_to_name[] = { +static const char *const sctp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_SCTP_CLOSED] = "CLOSED", [NFCT_TIMEOUT_ATTR_SCTP_COOKIE_WAIT] = "COOKIE_WAIT", [NFCT_TIMEOUT_ATTR_SCTP_COOKIE_ECHOED] = "COOKIE_ECHOED", @@ -54,7 +54,7 @@ static char *sctp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_SCTP_SHUTDOWN_ACK_SENT] = "SHUTDOWN_ACK_SENT", }; -static char *dccp_state_to_name[] = { +static const char *const dccp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_DCCP_REQUEST] = "REQUEST", [NFCT_TIMEOUT_ATTR_DCCP_RESPOND] = "RESPOND", [NFCT_TIMEOUT_ATTR_DCCP_PARTOPEN] = "PARTOPEN", @@ -64,14 +64,14 @@ static char *dccp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_DCCP_TIMEWAIT] = "TIMEWAIT", }; -static char *icmp_state_to_name[] = { +static const char *const icmp_state_to_name[] = { [NFCT_TIMEOUT_ATTR_ICMP] = "TIMEOUT", }; static struct { uint32_t nlattr_max; uint32_t attr_max; - char **state_to_name; + const char *const *state_to_name; } timeout_protocol[IPPROTO_MAX] = { [IPPROTO_ICMP] = { .nlattr_max = __CTA_TIMEOUT_ICMP_MAX,