From: Jan Engelhardt <jengelh@medozas.de>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 3/3] src: declare non-modified data as const
Date: Sat, 18 Dec 2010 21:17:32 +0100 [thread overview]
Message-ID: <1292703453-16324-4-git-send-email-jengelh@medozas.de> (raw)
In-Reply-To: <1292703453-16324-1-git-send-email-jengelh@medozas.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
include/libnetfilter_log/libipulog.h | 2 +-
src/libipulog_compat.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/libnetfilter_log/libipulog.h b/include/libnetfilter_log/libipulog.h
index bb6736a..6917ee7 100644
--- a/include/libnetfilter_log/libipulog.h
+++ b/include/libnetfilter_log/libipulog.h
@@ -48,7 +48,7 @@ ulog_packet_msg_t *ipulog_get_packet(struct ipulog_handle *h,
const unsigned char *buf,
size_t len);
-char *ipulog_strerror(int errcode);
+const char *ipulog_strerror(int errcode);
void ipulog_perror(const char *s);
diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c
index a25cde9..6703c99 100644
--- a/src/libipulog_compat.c
+++ b/src/libipulog_compat.c
@@ -28,10 +28,10 @@ struct ipulog_handle
struct ulog_packet_msg upmsg; /* has to be last in structure */
};
-struct ipulog_errmap_t
+static const struct ipulog_errmap_t
{
int errcode;
- char *message;
+ const char *message;
} ipulog_errmap[] =
{
{ IPULOG_ERR_NONE, "No error" },
@@ -65,7 +65,7 @@ static unsigned int gmask2group(unsigned int gmask)
int ipulog_errno = IPULOG_ERR_NONE;
-char *ipulog_strerror(int errcode)
+const char *ipulog_strerror(int errcode)
{
if (errcode < 0 || errcode > IPULOG_MAXERR)
errcode = IPULOG_ERR_IMPL;
--
1.7.1
next prev parent reply other threads:[~2010-12-18 20:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 20:17 libnetfilter_log: misc annotations Jan Engelhardt
2010-12-18 20:17 ` [PATCH 1/3] libipulog: rebuild required header file inclusion Jan Engelhardt
2010-12-21 19:46 ` Pablo Neira Ayuso
2010-12-18 20:17 ` [PATCH 2/3] src: remove redundant casts Jan Engelhardt
2010-12-21 19:56 ` Pablo Neira Ayuso
2010-12-18 20:17 ` Jan Engelhardt [this message]
2010-12-21 19:56 ` [PATCH 3/3] src: declare non-modified data as const Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292703453-16324-4-git-send-email-jengelh@medozas.de \
--to=jengelh@medozas.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).