From ce87a1eea3e6f7f24b7fd82db8d3775cf456818c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 15 Aug 2009 23:40:55 +0200 Subject: [PATCH] mpdclient: pass const strings The mpdclient library doesn't modify the parameter strings, let's make them const. --- src/mpdclient.c | 16 ++++++++-------- src/mpdclient.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mpdclient.c b/src/mpdclient.c index 4a12515..5f46326 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -189,10 +189,10 @@ mpdclient_disconnect(mpdclient_t *c) gint mpdclient_connect(mpdclient_t *c, - gchar *host, + const gchar *host, gint port, gfloat _timeout, - gchar *password) + const gchar *password) { gint retval = 0; @@ -419,7 +419,7 @@ mpdclient_cmd_crossfade(mpdclient_t *c, gint value) } gint -mpdclient_cmd_db_update(mpdclient_t *c, gchar *path) +mpdclient_cmd_db_update(mpdclient_t *c, const gchar *path) { gint ret; @@ -471,7 +471,7 @@ gint mpdclient_cmd_volume_down(struct mpdclient *c) } gint -mpdclient_cmd_add_path(mpdclient_t *c, gchar *path_utf8) +mpdclient_cmd_add_path(mpdclient_t *c, const gchar *path_utf8) { mpd_sendAddCommand(c->connection, path_utf8); return mpdclient_finish_command(c); @@ -591,7 +591,7 @@ mpdclient_cmd_move(mpdclient_t *c, gint old_index, gint new_index) } gint -mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename_utf8) +mpdclient_cmd_save_playlist(mpdclient_t *c, const gchar *filename_utf8) { gint retval = 0; @@ -602,7 +602,7 @@ mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename_utf8) } gint -mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8) +mpdclient_cmd_load_playlist(mpdclient_t *c, const gchar *filename_utf8) { mpd_sendLoadCommand(c->connection, filename_utf8); c->need_update = TRUE; @@ -610,7 +610,7 @@ mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8) } gint -mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8) +mpdclient_cmd_delete_playlist(mpdclient_t *c, const gchar *filename_utf8) { gint retval = 0; @@ -880,7 +880,7 @@ mpdclient_get_artists(mpdclient_t *c) } GList * -mpdclient_get_albums(mpdclient_t *c, gchar *artist_utf8) +mpdclient_get_albums(mpdclient_t *c, const gchar *artist_utf8) { gchar *str = NULL; GList *list = NULL; diff --git a/src/mpdclient.h b/src/mpdclient.h index e74722e..42aa17c 100644 --- a/src/mpdclient.h +++ b/src/mpdclient.h @@ -40,8 +40,8 @@ mpdclient_finish_command(mpdclient_t *c); mpdclient_t *mpdclient_new(void); void mpdclient_free(mpdclient_t *c); -gint mpdclient_connect(mpdclient_t *c, gchar *host, gint port, - gfloat timeout_, gchar *password); +gint mpdclient_connect(mpdclient_t *c, const gchar *host, gint port, + gfloat timeout_, const gchar *password); gint mpdclient_disconnect(mpdclient_t *c); gint mpdclient_update(mpdclient_t *c); @@ -63,23 +63,23 @@ gint mpdclient_cmd_random(mpdclient_t *c, gint value); gint mpdclient_cmd_single(mpdclient_t *c, gint value); gint mpdclient_cmd_consume(mpdclient_t *c, gint value); gint mpdclient_cmd_crossfade(mpdclient_t *c, gint value); -gint mpdclient_cmd_db_update(mpdclient_t *c, gchar *path); +gint mpdclient_cmd_db_update(mpdclient_t *c, const gchar *path); gint mpdclient_cmd_volume(mpdclient_t *c, gint value); gint mpdclient_cmd_volume_up(struct mpdclient *c); gint mpdclient_cmd_volume_down(struct mpdclient *c); -gint mpdclient_cmd_add_path(mpdclient_t *c, gchar *path); +gint mpdclient_cmd_add_path(mpdclient_t *c, const gchar *path); gint mpdclient_cmd_add(mpdclient_t *c, struct mpd_song *song); gint mpdclient_cmd_delete(mpdclient_t *c, gint index); gint mpdclient_cmd_move(mpdclient_t *c, gint old_index, gint new_index); -gint mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename); -gint mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8); -gint mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8); +gint mpdclient_cmd_save_playlist(mpdclient_t *c, const gchar *filename); +gint mpdclient_cmd_load_playlist(mpdclient_t *c, const gchar *filename_utf8); +gint mpdclient_cmd_delete_playlist(mpdclient_t *c, const gchar *filename_utf8); /* list functions */ GList *mpdclient_get_artists(mpdclient_t *c); -GList *mpdclient_get_albums(mpdclient_t *c, gchar *artist_utf8); +GList *mpdclient_get_albums(mpdclient_t *c, const gchar *artist_utf8); /*** error callbacks *****************************************************/ -- 2.30.2