diff options
author | Max Kellermann <max@duempel.org> | 2008-10-26 20:56:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-26 20:56:46 +0100 |
commit | 5c19776f2fc1416dab1da2f2baae9a0c764df965 (patch) | |
tree | 828f8f768be17f053e12fc38f2a7593e0a9b77b5 /src/input_file.c | |
parent | 464b6117721056e72c79824a298caf53eb5cd452 (diff) | |
download | mpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.tar.gz mpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.tar.xz mpd-5c19776f2fc1416dab1da2f2baae9a0c764df965.zip |
input_stream: use "bool" instead of "int"
For boolean values and success flags, use bool instead of integer (1/0
for true/false, 0/-1 for success/failure).
Diffstat (limited to '')
-rw-r--r-- | src/input_file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input_file.c b/src/input_file.c index 5c3ff6ad0..eece19c53 100644 --- a/src/input_file.c +++ b/src/input_file.c @@ -32,7 +32,7 @@ input_file_open(struct input_stream *is, const char *filename) return false; } - is->seekable = 1; + is->seekable = true; fseek(fp, 0, SEEK_END); is->size = ftell(fp); @@ -43,22 +43,22 @@ input_file_open(struct input_stream *is, const char *filename) #endif is->data = fp; - is->ready = 1; + is->ready = true; return true; } -static int +static bool input_file_seek(struct input_stream *is, long offset, int whence) { if (fseek((FILE *) is->data, offset, whence) == 0) { is->offset = ftell((FILE *) is->data); } else { is->error = errno; - return -1; + return false; } - return 0; + return true; } static size_t @@ -84,7 +84,7 @@ input_file_close(struct input_stream *is) fclose((FILE *) is->data); } -static int +static bool input_file_eof(struct input_stream *is) { if (feof((FILE *) is->data)) |