From 6fbdc721d972d8c1f823acd5473a3dce8836d5fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 Feb 2008 10:17:33 +0000 Subject: fix -Wconst warnings [ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/command.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index eddb49af0..78eb9a597 100644 --- a/src/command.c +++ b/src/command.c @@ -128,7 +128,7 @@ typedef int (*CommandListHandlerFunction) /* if min: -1 don't check args * * if max: -1 no max args */ struct _CommandEntry { - char *cmd; + const char *cmd; int min; int max; int reqPermission; @@ -136,7 +136,6 @@ struct _CommandEntry { CommandListHandlerFunction listHandler; }; - /* this should really be "need a non-negative integer": */ static const char need_positive[] = "need a positive integer"; /* no-op */ @@ -146,7 +145,7 @@ static const char need_integer[] = "need an integer"; static const char check_boolean[] = "\"%s\" is not 0 or 1"; static const char check_non_negative[] = "\"%s\" is not an integer >= 0"; -static char *current_command; +static const char *current_command; static int command_listNum; static CommandEntry *getCommandEntryFromString(char *string, int *permission); @@ -215,7 +214,7 @@ static int mpd_fprintf__ check_int(int fd, int *dst, return 0; } -static void addCommand(char *name, +static void addCommand(const char *name, int reqPermission, int minargs, int maxargs, @@ -291,7 +290,7 @@ static int handlePause(int fd, int *permission, int argc, char *argv[]) static int commandStatus(int fd, int *permission, int argc, char *argv[]) { - char *state = NULL; + const char *state = NULL; int updateJobId; int song; @@ -450,7 +449,7 @@ static int handleListPlaylistInfo(int fd, int *permission, static int handleLsInfo(int fd, int *permission, int argc, char *argv[]) { - char *path = ""; + const char *path = ""; if (argc == 2) path = argv[1]; -- cgit v1.2.3