[syslinux:elflink] ldlinux: Fix compiler warnings in cli.c

syslinux-bot for Matt Fleming matt.fleming at linux.intel.com
Fri Mar 18 11:30:48 PDT 2011


Commit-ID:  3664450f21f246cf9ebbdc21bf52eb60b6de890e
Gitweb:     http://syslinux.zytor.com/commit/3664450f21f246cf9ebbdc21bf52eb60b6de890e
Author:     Matt Fleming <matt.fleming at linux.intel.com>
AuthorDate: Wed, 16 Mar 2011 13:18:41 +0000
Committer:  Matt Fleming <matt.fleming at linux.intel.com>
CommitDate: Wed, 16 Mar 2011 13:18:41 +0000

ldlinux: Fix compiler warnings in cli.c

Make the compiler happy by casting away the following warnings,

cli.c: In function ‘process_command’:
cli.c:381:2: warning: passing argument 1 of ‘strtok’ discards qualifiers from pointer target type
../../../com32/include/string.h:44:16: note: expected ‘char *’ but argument is of type ‘const char *’
cli.c:400:3: warning: passing argument 2 of ‘spawn_load’ from incompatible pointer type
../../../com32/include/sys/exec.h:43:12: note: expected ‘const char **’ but argument is of type ‘char **’

Signed-off-by: Matt Fleming <matt.fleming at linux.intel.com>


---
 com32/elflink/ldlinux/cli.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 03befe5..0e0827d 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -378,7 +378,7 @@ void process_command(const char *cmd, bool history)
 
 	//	dprintf("raw cmd = %s", cmd);
 	strcpy(temp_cmd, cmd);
-	module_name = strtok(cmd, COMMAND_DELIM);
+	module_name = strtok((char *)cmd, COMMAND_DELIM);
 	len_mn = strlen(module_name);
 
 	if (!strcmp(module_name + len_mn - 4, ".c32")) {
@@ -397,7 +397,7 @@ void process_command(const char *cmd, bool history)
 		} while (argc < MAX_COMMAND_ARGS);
 		argv[argc] = NULL;
 		module_load_dependencies(module_name, MODULES_DEP);
-		spawn_load(module_name, argv);
+		spawn_load(module_name, (const char **)argv);
 	} else if (!strcmp(module_name + len_mn - 2, ".0")) {
 		execute(cmd, KT_PXE);
 	} else if (!strcmp(module_name + len_mn - 3, ".bs")) {



More information about the Syslinux-commits mailing list