These functions don't modify their arguments.
It's good coding practise to set them as const.

Signed-off-by: Ali Polatel <a...@exherbo.org>
---
 include/mpd/stats.h |   14 +++++++-------
 src/stats.c         |   14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/mpd/stats.h b/include/mpd/stats.h
index dfb28e2..c5c9acf 100644
--- a/include/mpd/stats.h
+++ b/include/mpd/stats.h
@@ -111,7 +111,7 @@ void mpd_stats_free(struct mpd_stats * stats);
  */
 mpd_pure
 unsigned
-mpd_stats_get_number_of_artists(struct mpd_stats * stats);
+mpd_stats_get_number_of_artists(const struct mpd_stats * stats);
 
 /**
  * @return the number of distinct album names in MPD's database, or 0
@@ -119,7 +119,7 @@ mpd_stats_get_number_of_artists(struct mpd_stats * stats);
  */
 mpd_pure
 unsigned
-mpd_stats_get_number_of_albums(struct mpd_stats * stats);
+mpd_stats_get_number_of_albums(const struct mpd_stats * stats);
 
 /**
  * @return the total number of song files in MPD's database, or 0 if
@@ -127,34 +127,34 @@ mpd_stats_get_number_of_albums(struct mpd_stats * stats);
  */
 mpd_pure
 unsigned
-mpd_stats_get_number_of_songs(struct mpd_stats * stats);
+mpd_stats_get_number_of_songs(const struct mpd_stats * stats);
 
 /**
  * @return the uptime of MPD in seconds, or 0 if unknown
  */
 mpd_pure
-unsigned long mpd_stats_get_uptime(struct mpd_stats * stats);
+unsigned long mpd_stats_get_uptime(const struct mpd_stats * stats);
 
 /**
  * @return the UNIX time stamp of the last database update, or 0 if
  * unknown
  */
 mpd_pure
-unsigned long mpd_stats_get_db_update_time(struct mpd_stats * stats);
+unsigned long mpd_stats_get_db_update_time(const struct mpd_stats * stats);
 
 /**
  * @return the accumulated time MPD was playing music since the
  * process was started, or 0 if unknown
  */
 mpd_pure
-unsigned long mpd_stats_get_play_time(struct mpd_stats * stats);
+unsigned long mpd_stats_get_play_time(const struct mpd_stats * stats);
 
 /**
  * @return the accumulated duration of all songs in the database, or 0
  * if unknown
  */
 mpd_pure
-unsigned long mpd_stats_get_db_play_time(struct mpd_stats * stats);
+unsigned long mpd_stats_get_db_play_time(const struct mpd_stats * stats);
 
 #ifdef __cplusplus
 }
diff --git a/src/stats.c b/src/stats.c
index 7fb3a8e..5f25385 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -91,7 +91,7 @@ void mpd_stats_free(struct mpd_stats * stats) {
 }
 
 unsigned
-mpd_stats_get_number_of_artists(struct mpd_stats * stats)
+mpd_stats_get_number_of_artists(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
@@ -99,7 +99,7 @@ mpd_stats_get_number_of_artists(struct mpd_stats * stats)
 }
 
 unsigned
-mpd_stats_get_number_of_albums(struct mpd_stats * stats)
+mpd_stats_get_number_of_albums(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
@@ -107,35 +107,35 @@ mpd_stats_get_number_of_albums(struct mpd_stats * stats)
 }
 
 unsigned
-mpd_stats_get_number_of_songs(struct mpd_stats * stats)
+mpd_stats_get_number_of_songs(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
        return stats->number_of_songs;
 }
 
-unsigned long mpd_stats_get_uptime(struct mpd_stats * stats)
+unsigned long mpd_stats_get_uptime(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
        return stats->uptime;
 }
 
-unsigned long mpd_stats_get_db_update_time(struct mpd_stats * stats)
+unsigned long mpd_stats_get_db_update_time(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
        return stats->db_update_time;
 }
 
-unsigned long mpd_stats_get_play_time(struct mpd_stats * stats)
+unsigned long mpd_stats_get_play_time(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
        return stats->play_time;
 }
 
-unsigned long mpd_stats_get_db_play_time(struct mpd_stats * stats)
+unsigned long mpd_stats_get_db_play_time(const struct mpd_stats * stats)
 {
        assert(stats != NULL);
 
-- 
1.6.5.7


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to