aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-14 06:45:34 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-14 06:45:34 +0000
commit7ccfb2eb5f9d91bdb4139cb420a3b5f8deb2f6e8 (patch)
tree29ccfd792bcd8109ef331d031b6f04d89b99b310 /vl.c
parent5d0c5750bb19212c8ecfb9660956611baf6aa861 (diff)
downloadqemu-7ccfb2eb5f9d91bdb4139cb420a3b5f8deb2f6e8.zip
qemu-7ccfb2eb5f9d91bdb4139cb420a3b5f8deb2f6e8.tar.gz
qemu-7ccfb2eb5f9d91bdb4139cb420a3b5f8deb2f6e8.tar.bz2
Fix warnings that would be caused by gcc flag -Wwrite-strings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/vl.c b/vl.c
index 0619f1c..dd4ffcc 100644
--- a/vl.c
+++ b/vl.c
@@ -1898,7 +1898,7 @@ static int mux_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
return ret;
}
-static char *mux_help[] = {
+static const char * const mux_help[] = {
"% h print this help\n\r",
"% x exit emulator\n\r",
"% s save disk data back to file (if -snapshot)\n\r",
@@ -1948,7 +1948,7 @@ static int mux_proc_byte(CharDriverState *chr, MuxDriver *d, int ch)
break;
case 'x':
{
- char *term = "QEMU: Terminated\n\r";
+ const char *term = "QEMU: Terminated\n\r";
chr->chr_write(chr,(uint8_t *)term,strlen(term));
exit(0);
break;
@@ -3957,6 +3957,7 @@ int parse_host_src_port(struct sockaddr_in *haddr,
char *str = strdup(input_str);
char *host_str = str;
char *src_str;
+ const char *src_str2;
char *ptr;
/*
@@ -3975,10 +3976,11 @@ int parse_host_src_port(struct sockaddr_in *haddr,
if (parse_host_port(haddr, host_str) < 0)
goto fail;
+ src_str2 = src_str;
if (!src_str || *src_str == '\0')
- src_str = ":0";
+ src_str2 = ":0";
- if (parse_host_port(saddr, src_str) < 0)
+ if (parse_host_port(saddr, src_str2) < 0)
goto fail;
free(str);
@@ -5164,7 +5166,7 @@ static int get_param_value(char *buf, int buf_size,
}
static int check_params(char *buf, int buf_size,
- char **params, const char *str)
+ const char * const *params, const char *str)
{
const char *p;
int i;
@@ -5451,9 +5453,10 @@ static int drive_init(struct drive_opt *arg, int snapshot,
int cache;
int bdrv_flags;
char *str = arg->opt;
- char *params[] = { "bus", "unit", "if", "index", "cyls", "heads",
- "secs", "trans", "media", "snapshot", "file",
- "cache", "format", NULL };
+ static const char * const params[] = { "bus", "unit", "if", "index",
+ "cyls", "heads", "secs", "trans",
+ "media", "snapshot", "file",
+ "cache", "format", NULL };
if (check_params(buf, sizeof(buf), params, str) < 0) {
fprintf(stderr, "qemu: unknown parameter '%s' in '%s'\n",