ldlinux: Fix compiler warnings in cli.c
authorMatt Fleming <matt.fleming@linux.intel.com>
Wed, 16 Mar 2011 13:18:41 +0000 (13:18 +0000)
committerMatt Fleming <matt.fleming@linux.intel.com>
Wed, 16 Mar 2011 13:18:41 +0000 (13:18 +0000)
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@linux.intel.com>
com32/elflink/ldlinux/cli.c

index 03befe5..0e0827d 100644 (file)
@@ -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")) {