diff options
author | Max Kellermann <max@duempel.org> | 2008-02-05 10:17:33 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-02-05 10:17:33 +0000 |
commit | 6fbdc721d972d8c1f823acd5473a3dce8836d5fa (patch) | |
tree | e72131541f4e887d5dedd6c75ffce455cbf6b97c /src/command.c | |
parent | 22efbd5eca4705426af5cee17a65a3e76c33bec6 (diff) | |
download | mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.tar.gz mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.tar.xz mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.zip |
fix -Wconst warnings
[ew: cleaned up the dirty union hack a bit]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 11 |
1 files changed, 5 insertions, 6 deletions
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]; |