From d32498dfec5f97275e6d769080a2a39c16f214c8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:08:04 +0200 Subject: directory: directory_get_path(NULL) is not allowed Also convert directory_get_path() to an inline function, which returns a constant string. --- src/directory.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/directory.h b/src/directory.h index a95e0d7db..5609e4ea4 100644 --- a/src/directory.h +++ b/src/directory.h @@ -61,7 +61,10 @@ static inline int directory_is_empty(struct directory *directory) return directory->children.nr == 0 && directory->songs.nr == 0; } -int printDirectoryInfo(int fd, const char *dirname); +static inline const char * directory_get_path(struct directory *dir) +{ + return dir->path ? dir->path : ""; +} void directory_prune_empty(struct directory *directory); @@ -86,6 +89,4 @@ int directory_walk(struct directory *directory, int (*forEachSong) (struct mpd_song *, void *), int (*forEachDir) (struct directory *, void *), void *data); -#define directory_get_path(dir) ((dir && dir->path) ? dir->path : "") - #endif -- cgit v1.2.3