aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-16 21:18:33 +0100
committerMax Kellermann <max@duempel.org>2008-12-16 21:18:33 +0100
commitd0024c077d94963d86651748888187944441699c (patch)
treedf7e7f23505fcfa81dde8ec63c35a67e72329eca /src
parent1d82edc6d36115ef4ecc251086a5b31c72333e5d (diff)
downloadmpd-d0024c077d94963d86651748888187944441699c.tar.gz
mpd-d0024c077d94963d86651748888187944441699c.tar.xz
mpd-d0024c077d94963d86651748888187944441699c.zip
ls: use bool
Use the C99 "bool" data type instead of "int".
Diffstat (limited to 'src')
-rw-r--r--src/ls.c9
-rw-r--r--src/ls.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/ls.c b/src/ls.c
index 3de260d8b..60121472d 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -42,19 +42,18 @@ void printRemoteUrlHandlers(struct client *client)
}
}
-int isRemoteUrl(const char *url)
+
+bool isRemoteUrl(const char *url)
{
- int count = 0;
const char **urlPrefixes = remoteUrlPrefixes;
while (*urlPrefixes) {
- count++;
if (g_str_has_prefix(url, *urlPrefixes))
- return count;
+ return true;
urlPrefixes++;
}
- return 0;
+ return false;
}
/* suffixes should be ascii only characters */
diff --git a/src/ls.h b/src/ls.h
index 4253431ec..5ea65faf7 100644
--- a/src/ls.h
+++ b/src/ls.h
@@ -21,12 +21,14 @@
#include "decoder_list.h"
+#include <stdbool.h>
+
struct stat;
struct client;
const char *getSuffix(const char *utf8file);
-int isRemoteUrl(const char *url);
+bool isRemoteUrl(const char *url);
const struct decoder_plugin *
hasMusicSuffix(const char *utf8file, unsigned int next);