aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:03:39 +0200
committerMax Kellermann <max@duempel.org>2008-10-08 11:03:39 +0200
commitb084bc28ede5d397e88a4e2bdad8c07a55069589 (patch)
treed61d58cc73ed7d591df05fee2f4a48682e8d9c8c /src/playlist.c
parent71351160b1b6fd4203f27f9159ae39a476483e1a (diff)
downloadmpd-b084bc28ede5d397e88a4e2bdad8c07a55069589.tar.gz
mpd-b084bc28ede5d397e88a4e2bdad8c07a55069589.tar.xz
mpd-b084bc28ede5d397e88a4e2bdad8c07a55069589.zip
use the "bool" data type instead of "int"
"bool" should be used in C99 programs for boolean values.
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/playlist.c b/src/playlist.c
index fe172ebbf..402b57ea3 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -57,7 +57,7 @@
#define PLAYLIST_HASH_MULT 4
#define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16)
-#define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS 0
+#define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false
static Playlist playlist;
static int playlist_state = PLAYLIST_STATE_STOP;
@@ -66,7 +66,7 @@ static int playlist_stopOnError;
static int playlist_errorCount;
static int playlist_noGoToNext;
-int playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS;
+bool playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS;
static void swapOrder(int a, int b);
static void playPlaylistOrderNumber(int orderNum);
@@ -119,9 +119,9 @@ void initPlaylist(void)
ConfigParam *param;
playlist.length = 0;
- playlist.repeat = 0;
+ playlist.repeat = false;
playlist.version = 1;
- playlist.random = 0;
+ playlist.random = false;
playlist.queued = -1;
playlist.current = -1;
@@ -329,9 +329,9 @@ void readPlaylistState(FILE *fp)
if (strcmp
(&(buffer[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
"1") == 0) {
- setPlaylistRepeatStatus(1);
+ setPlaylistRepeatStatus(true);
} else
- setPlaylistRepeatStatus(0);
+ setPlaylistRepeatStatus(false);
} else if (!prefixcmp(buffer, PLAYLIST_STATE_FILE_CROSSFADE)) {
setPlayerCrossFade(atoi
(&
@@ -344,9 +344,9 @@ void readPlaylistState(FILE *fp)
(buffer
[strlen(PLAYLIST_STATE_FILE_RANDOM)]),
"1") == 0) {
- setPlaylistRandomStatus(1);
+ setPlaylistRandomStatus(true);
} else
- setPlaylistRandomStatus(0);
+ setPlaylistRandomStatus(false);
} else if (!prefixcmp(buffer, PLAYLIST_STATE_FILE_CURRENT)) {
if (strlen(buffer) ==
strlen(PLAYLIST_STATE_FILE_CURRENT))
@@ -980,17 +980,17 @@ void playPlaylistIfPlayerStopped(void)
}
}
-int getPlaylistRepeatStatus(void)
+bool getPlaylistRepeatStatus(void)
{
return playlist.repeat;
}
-int getPlaylistRandomStatus(void)
+bool getPlaylistRandomStatus(void)
{
return playlist.random;
}
-void setPlaylistRepeatStatus(int status)
+void setPlaylistRepeatStatus(bool status)
{
if (playlist_state == PLAYLIST_STATE_PLAY) {
if (playlist.repeat && !status && playlist.queued == 0)
@@ -1150,9 +1150,9 @@ static void randomizeOrder(int start, int end)
}
}
-void setPlaylistRandomStatus(int status)
+void setPlaylistRandomStatus(bool status)
{
- int statusWas = playlist.random;
+ bool statusWas = playlist.random;
playlist.random = status;