From: Andre Noll Date: Fri, 22 Apr 2011 02:07:35 +0000 (+0200) Subject: Constify flowop functions. X-Git-Tag: v0.4.8~33^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=13f672993a23637fe8ad76d9ebc64fe774528f5d;p=paraslash.git Constify flowop functions. This trivial patch fixes some "discards qualifiers" gcc warnings when compiling with -Wwrite-strings. --- 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)