change char * to const char * in libmpdclient where appropriate to avoid casts
This commit is contained in:
@@ -1649,7 +1649,7 @@ void mpd_sendSeekIdCommand(mpd_Connection * connection, int id, int time) {
|
|||||||
free(string);
|
free(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mpd_sendUpdateCommand(mpd_Connection * connection, char * path) {
|
void mpd_sendUpdateCommand(mpd_Connection * connection, const char * path) {
|
||||||
char * sPath = mpd_sanitizeArg(path);
|
char * sPath = mpd_sanitizeArg(path);
|
||||||
int len = strlen("update")+2+strlen(sPath)+3;
|
int len = strlen("update")+2+strlen(sPath)+3;
|
||||||
char *string = malloc(len);
|
char *string = malloc(len);
|
||||||
@@ -1997,7 +1997,7 @@ void mpd_commitSearch(mpd_Connection *connection)
|
|||||||
* List the content, with full metadata, of a stored playlist.
|
* List the content, with full metadata, of a stored playlist.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, char *path)
|
void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, const char *path)
|
||||||
{
|
{
|
||||||
char *arg = mpd_sanitizeArg(path);
|
char *arg = mpd_sanitizeArg(path);
|
||||||
int len = strlen("listplaylistinfo")+2+strlen(arg)+3;
|
int len = strlen("listplaylistinfo")+2+strlen(arg)+3;
|
||||||
@@ -2038,7 +2038,7 @@ void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
||||||
char *playlist, char *path)
|
const char *playlist, const char *path)
|
||||||
{
|
{
|
||||||
char *sPlaylist = mpd_sanitizeArg(playlist);
|
char *sPlaylist = mpd_sanitizeArg(playlist);
|
||||||
char *sPath = mpd_sanitizeArg(path);
|
char *sPath = mpd_sanitizeArg(path);
|
||||||
@@ -2052,7 +2052,7 @@ void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
|
||||||
char *playlist, int from, int to)
|
const char *playlist, int from, int to)
|
||||||
{
|
{
|
||||||
char *sPlaylist = mpd_sanitizeArg(playlist);
|
char *sPlaylist = mpd_sanitizeArg(playlist);
|
||||||
int len = strlen("playlistmove")+
|
int len = strlen("playlistmove")+
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange);
|
|||||||
|
|
||||||
void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);
|
void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);
|
||||||
|
|
||||||
void mpd_sendUpdateCommand(mpd_Connection * connection, char * path);
|
void mpd_sendUpdateCommand(mpd_Connection * connection, const char * path);
|
||||||
|
|
||||||
/* returns the update job id, call this after a update command*/
|
/* returns the update job id, call this after a update command*/
|
||||||
int mpd_getUpdateId(mpd_Connection * connection);
|
int mpd_getUpdateId(mpd_Connection * connection);
|
||||||
@@ -605,7 +605,7 @@ char *mpd_getNextTagType(mpd_Connection * connection);
|
|||||||
* List the content, with full metadata, of a stored playlist.
|
* List the content, with full metadata, of a stored playlist.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, char *path);
|
void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, const char *path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param connection a MpdConnection
|
* @param connection a MpdConnection
|
||||||
@@ -667,10 +667,10 @@ void mpd_startStatsSearch(mpd_Connection *connection);
|
|||||||
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path);
|
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path);
|
||||||
|
|
||||||
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
||||||
char *playlist, char *path);
|
const char *playlist, const char *path);
|
||||||
|
|
||||||
void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
|
||||||
char *playlist, int from, int to);
|
const char *playlist, int from, int to);
|
||||||
|
|
||||||
void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection,
|
||||||
const char *playlist, int pos);
|
const char *playlist, int pos);
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ void Connection::UpdateDirectory(const string &path) const
|
|||||||
{
|
{
|
||||||
if (isConnected)
|
if (isConnected)
|
||||||
{
|
{
|
||||||
mpd_sendUpdateCommand(itsConnection, (char *) path.c_str());
|
mpd_sendUpdateCommand(itsConnection, path.c_str());
|
||||||
mpd_finishCommand(itsConnection);
|
mpd_finishCommand(itsConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -348,7 +348,7 @@ void Connection::AddToPlaylist(const string &path, const string &file) const
|
|||||||
{
|
{
|
||||||
if (isConnected)
|
if (isConnected)
|
||||||
{
|
{
|
||||||
mpd_sendPlaylistAddCommand(itsConnection, (char *) path.c_str(), (char *) file.c_str());
|
mpd_sendPlaylistAddCommand(itsConnection, path.c_str(), file.c_str());
|
||||||
if (!isCommandsListEnabled)
|
if (!isCommandsListEnabled)
|
||||||
mpd_finishCommand(itsConnection);
|
mpd_finishCommand(itsConnection);
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ void Connection::Move(const string &path, int from, int to) const
|
|||||||
{
|
{
|
||||||
if (isConnected)
|
if (isConnected)
|
||||||
{
|
{
|
||||||
mpd_sendPlaylistMoveCommand(itsConnection, (char *) path.c_str(), from, to);
|
mpd_sendPlaylistMoveCommand(itsConnection, path.c_str(), from, to);
|
||||||
if (!isCommandsListEnabled)
|
if (!isCommandsListEnabled)
|
||||||
mpd_finishCommand(itsConnection);
|
mpd_finishCommand(itsConnection);
|
||||||
}
|
}
|
||||||
@@ -447,7 +447,7 @@ void Connection::GetPlaylistContent(const string &path, SongList &v) const
|
|||||||
{
|
{
|
||||||
if (isConnected)
|
if (isConnected)
|
||||||
{
|
{
|
||||||
mpd_sendListPlaylistInfoCommand(itsConnection, (char *) path.c_str());
|
mpd_sendListPlaylistInfoCommand(itsConnection, path.c_str());
|
||||||
mpd_InfoEntity *item = NULL;
|
mpd_InfoEntity *item = NULL;
|
||||||
while ((item = mpd_getNextInfoEntity(itsConnection)) != NULL)
|
while ((item = mpd_getNextInfoEntity(itsConnection)) != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user