]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Constify flowop functions.
authorAndre Noll <maan@systemlinux.org>
Fri, 22 Apr 2011 02:07:35 +0000 (04:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 22 May 2011 13:24:16 +0000 (15:24 +0200)
This trivial patch fixes some "discards qualifiers" gcc
warnings when compiling with -Wwrite-strings.

net.c
net.h

diff --git a/net.c b/net.c
index ffd4350b4b14bc32d8e270db2734cc97fee400df..697e3b76963babf6b7d4aaec4e83c400e0060deb 100644 (file)
--- 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 a1af08ae94ea521cc856c2a1c40b4873ab148163..80f5794466fe74b8dbb429ad2ae2d38415945dba 100644 (file)
--- 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)