diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-06-05 16:23:13 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-06-06 12:51:26 +0200 |
commit | 3b1d17d69eac10c7d050786a2e4d3964442868dd (patch) | |
tree | e6cc7335e7519e448cd82904ce02697fbf78f6d9 | |
parent | 33cd703f559200f326bd4a9613edd90f1b1c8e9d (diff) |
Fix warnings about passing of string constant as argument.
g++ -DHAVE_CONFIG_H -I. -I../.. -I./.. -g -O2 -MT xfsmmixer_main.o -MD -MP -
MF .deps/xfsmmixer_main.Tpo -c -o xfsmmixer_main.o xfsmmixer_main.cxx
xfsmmixer_main.cxx: In function ‘int main(int, char**)’:
xfsmmixer_main.cxx:318:31: warning: deprecated conversion from string constant t
o ‘char*’ [-Wwrite-strings]
[...]
g++ -DHAVE_CONFIG_H -I. -I../.. -I./.. -g -O2 -MT xfhdlcchpar_main.o -MD -MP
-MF .deps/xfhdlcchpar_main.Tpo -c -o xfhdlcchpar_main.o xfhdlcchpar_main.cxx
xfhdlcchpar_main.cxx: In function ‘int main(int, char**)’:
xfhdlcchpar_main.cxx:88:31: warning: deprecated conversion from string constant
to ‘char*’ [-Wwrite-strings]
[...]
g++ -DHAVE_CONFIG_H -I. -I../.. -I./.. -g -O2 -MT xfhdlcst_main.o -MD -MP -M
F .deps/xfhdlcst_main.Tpo -c -o xfhdlcst_main.o xfhdlcst_main.cxx
xfhdlcst_main.cxx: In function ‘int main(int, char**)’:
xfhdlcst_main.cxx:84:31: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
[...]
g++ -DHAVE_CONFIG_H -I. -I../.. -I./.. -g -O2 -MT xfsmdiag_main.o -MD -MP -M
F .deps/xfsmdiag_main.Tpo -c -o xfsmdiag_main.o xfsmdiag_main.cxx
xfsmdiag_main.cxx: In function ‘int main(int, char**)’:
xfsmdiag_main.cxx:360:31: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | hdlcutil/hdrvcomm.c | 6 | ||||
-rw-r--r-- | hdlcutil/hdrvcomm.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/hdlcutil/hdrvcomm.c b/hdlcutil/hdrvcomm.c index 7392d4e..6b4335e 100644 --- a/hdlcutil/hdrvcomm.c +++ b/hdlcutil/hdrvcomm.c @@ -65,7 +65,7 @@ #ifdef HDRVC_KERNEL static int kernel_mode = 1; #endif /* HDRVC_KERNEL */ -static char *if_name = "bcsf0"; +static const char *if_name = "bcsf0"; static char *prg_name; static int fd = -1; static struct ifreq ifr_h; @@ -171,14 +171,14 @@ int hdrvc_getfd(void) /* ---------------------------------------------------------------------- */ -char *hdrvc_ifname(void) +const char *hdrvc_ifname(void) { return if_name; } /* ---------------------------------------------------------------------- */ -void hdrvc_args(int *argc, char *argv[], char *def_if) +void hdrvc_args(int *argc, char *argv[], const char *def_if) { int ac, i; diff --git a/hdlcutil/hdrvcomm.h b/hdlcutil/hdrvcomm.h index ce3767e..fbb4965 100644 --- a/hdlcutil/hdrvcomm.h +++ b/hdlcutil/hdrvcomm.h @@ -87,8 +87,8 @@ struct hdrvc_channel_state { extern int hdrvc_recvpacket(char *pkt, int maxlen); extern int hdrvc_getfd(void); -extern char *hdrvc_ifname(void); -extern void hdrvc_args(int *argc, char *argv[], char *def_if); +extern const char *hdrvc_ifname(void); +extern void hdrvc_args(int *argc, char *argv[], const char *def_if); extern void hdrvc_init(void); extern int hdrvc_get_samples(void); extern int hdrvc_get_bits(void); |