aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmpdclient.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-15 12:27:28 +0200
committerMax Kellermann <max@duempel.org>2008-09-15 12:27:28 +0200
commit0b3bcb6c7f1bb4a633896b8a9936e498570ef8e1 (patch)
tree611b143eb0834c892246f8b31311e9224977c952 /src/libmpdclient.c
parent1f0ff952055c920c8671a1587c622e4df8b4a99d (diff)
downloadmpd-0b3bcb6c7f1bb4a633896b8a9936e498570ef8e1.tar.gz
mpd-0b3bcb6c7f1bb4a633896b8a9936e498570ef8e1.tar.xz
mpd-0b3bcb6c7f1bb4a633896b8a9936e498570ef8e1.zip
const pointers
Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
Diffstat (limited to 'src/libmpdclient.c')
-rw-r--r--src/libmpdclient.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libmpdclient.c b/src/libmpdclient.c
index c9641e9e4..a52ce23ca 100644
--- a/src/libmpdclient.c
+++ b/src/libmpdclient.c
@@ -233,7 +233,7 @@ static int mpd_connect(mpd_Connection * connection, const char * host, int port,
}
#endif /* !MPD_HAVE_GAI */
-char * mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES] =
+const char *const mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES] =
{
"Artist",
"Album",
@@ -419,11 +419,12 @@ void mpd_closeConnection(mpd_Connection * connection) {
WSACleanup();
}
-static void mpd_executeCommand(mpd_Connection * connection, char * command) {
+static void mpd_executeCommand(mpd_Connection *connection,
+ const char *command) {
int ret;
struct timeval tv;
fd_set fds;
- char * commandPtr = command;
+ const char *commandPtr = command;
int commandLen = strlen(command);
if(!connection->doneProcessing && !connection->commandList) {
@@ -1432,8 +1433,8 @@ void mpd_sendSeekIdCommand(mpd_Connection * connection, int id, int time) {
free(string);
}
-void mpd_sendUpdateCommand(mpd_Connection * connection, char * path) {
- char * sPath = mpd_sanitizeArg(path);
+void mpd_sendUpdateCommand(mpd_Connection * connection, const char *path) {
+ char *sPath = mpd_sanitizeArg(path);
char * string = malloc(strlen("update")+strlen(sPath)+5);
sprintf(string,"update \"%s\"\n",sPath);
mpd_sendInfoCommand(connection,string);