From 13f672993a23637fe8ad76d9ebc64fe774528f5d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 22 Apr 2011 04:07:35 +0200 Subject: [PATCH] Constify flowop functions. This trivial patch fixes some "discards qualifiers" gcc warnings when compiling with -Wwrite-strings. --- net.c | 4 ++-- net.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net.c b/net.c index ffd4350b..697e3b76 100644 --- a/net.c +++ b/net.c @@ -285,7 +285,7 @@ struct flowopts *flowopt_new(void) * \sa setsockopt(2) */ void flowopt_add(struct flowopts *fo, int lev, int opt, - char *name, const void *val, int len) + const char *name, const void *val, int len) { struct pre_conn_opt *new = para_malloc(sizeof(*new)); @@ -306,7 +306,7 @@ void flowopt_add(struct flowopts *fo, int lev, int opt, } void flowopt_add_bool(struct flowopts *fo, int lev, int opt, - char *optname, bool on_or_off) + const char *optname, bool on_or_off) { int on = on_or_off; /* kernel takes 'int' */ diff --git a/net.h b/net.h index a1af08ae..80f57944 100644 --- a/net.h +++ b/net.h @@ -60,9 +60,9 @@ struct flowopts; extern struct flowopts *flowopt_new(void); extern void flowopt_add(struct flowopts *fo, int level, int opt, - char *name, const void *val, int len); + const char *name, const void *val, int len); extern void flowopt_add_bool(struct flowopts *fo, int lev, int opt, - char *optname, bool on_or_off); + const char *optname, bool on_or_off); /** Flowopt shortcut macros */ #define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len) #define OPT_ENABLE(fo, lev, opt) flowopt_add_bool(fo, lev, opt, #opt, 1) -- 2.39.5