From 3b1d17d69eac10c7d050786a2e4d3964442868dd Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 5 Jun 2013 16:23:13 +0200 Subject: Fix warnings about passing of string constant as argument. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hdlcutil/hdrvcomm.c | 6 +++--- hdlcutil/hdrvcomm.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'hdlcutil') 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); -- cgit v1.2.3