diff options
author | Max Kellermann <max@duempel.org> | 2011-09-13 21:36:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-13 21:39:07 +0200 |
commit | b7d2d4cfe8b88174a7b1f41840ddc0b23dbd6a75 (patch) | |
tree | 13032fee9c1341f02a2318eb12e3356f87f74d74 /src/db | |
parent | a6c797ee4b8e83c031961b22e449f083e79fe7af (diff) | |
download | mpd-b7d2d4cfe8b88174a7b1f41840ddc0b23dbd6a75.tar.gz mpd-b7d2d4cfe8b88174a7b1f41840ddc0b23dbd6a75.tar.xz mpd-b7d2d4cfe8b88174a7b1f41840ddc0b23dbd6a75.zip |
database: don't allow uri==NULL
Add nonnull attributes and fix all callers.
Diffstat (limited to '')
-rw-r--r-- | src/dbUtils.h | 7 | ||||
-rw-r--r-- | src/db_print.c | 2 | ||||
-rw-r--r-- | src/db_print.h | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/dbUtils.h b/src/dbUtils.h index f693a7793..40594652b 100644 --- a/src/dbUtils.h +++ b/src/dbUtils.h @@ -20,23 +20,26 @@ #ifndef MPD_DB_UTILS_H #define MPD_DB_UTILS_H +#include "gcc.h" + #include <glib.h> #include <stdbool.h> struct locate_item_list; struct player_control; +gcc_nonnull(1,2) bool addAllIn(struct player_control *pc, const char *uri, GError **error_r); +gcc_nonnull(1,2) bool addAllInToStoredPlaylist(const char *uri_utf8, const char *path_utf8, GError **error_r); +gcc_nonnull(1,2,3) bool findAddIn(struct player_control *pc, const char *name, const struct locate_item_list *criteria, GError **error_r); -unsigned long sumSongTimesIn(const char *name); - #endif diff --git a/src/db_print.c b/src/db_print.c index c4086a387..d398a22ac 100644 --- a/src/db_print.c +++ b/src/db_print.c @@ -286,7 +286,7 @@ listAllUniqueTags(struct client *client, int type, data.set = strset_new(); } - if (!db_walk(NULL, &unique_tags_visitor, &data, error_r)) { + if (!db_walk("", &unique_tags_visitor, &data, error_r)) { freeListCommandItem(item); return false; } diff --git a/src/db_print.h b/src/db_print.h index 7d6309517..76e43c3a0 100644 --- a/src/db_print.h +++ b/src/db_print.h @@ -20,6 +20,8 @@ #ifndef MPD_DB_PRINT_H #define MPD_DB_PRINT_H +#include "gcc.h" + #include <glib.h> #include <stdbool.h> @@ -27,28 +29,34 @@ struct client; struct locate_item_list; struct db_visitor; +gcc_nonnull(1,2) bool printAllIn(struct client *client, const char *uri_utf8, GError **error_r); +gcc_nonnull(1,2) bool printInfoForAllIn(struct client *client, const char *uri_utf8, GError **error_r); +gcc_nonnull(1,2,3) bool searchForSongsIn(struct client *client, const char *name, const struct locate_item_list *criteria, GError **error_r); +gcc_nonnull(1,2,3) bool findSongsIn(struct client *client, const char *name, const struct locate_item_list *criteria, GError **error_r); +gcc_nonnull(1,2,3) bool searchStatsForSongsIn(struct client *client, const char *name, const struct locate_item_list *criteria, GError **error_r); +gcc_nonnull(1,3) bool listAllUniqueTags(struct client *client, int type, const struct locate_item_list *criteria, |