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
This commit is contained in:
Max Kellermann
2008-02-05 10:17:33 +00:00
committed by Eric Wong
parent 22efbd5eca
commit 6fbdc721d9
37 changed files with 223 additions and 197 deletions

View File

@@ -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];