diff th_ioctx.c @ 457:85fa3d333556

Actually, revert the boolean changes .. meh.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Jan 2018 23:09:29 +0200
parents 347bfd3e017e
children 0a1a65503e0b
line wrap: on
line diff
--- a/th_ioctx.c	Tue Jan 02 22:57:47 2018 +0200
+++ b/th_ioctx.c	Tue Jan 02 23:09:29 2018 +0200
@@ -78,17 +78,17 @@
 }
 
 
-bool th_io_set_handlers(th_ioctx *ctx,
+BOOL th_io_set_handlers(th_ioctx *ctx,
     void (*error)(th_ioctx *, const int, const char *msg),
     void (*msg)(th_ioctx *, const int, const char *msg))
 {
     if (ctx == NULL)
-        return false;
+        return FALSE;
 
     ctx->error = error;
     ctx->msg = msg;
 
-    return true;
+    return TRUE;
 }
 
 
@@ -176,7 +176,7 @@
 }
 
 
-bool thfeof(th_ioctx *ctx)
+BOOL thfeof(th_ioctx *ctx)
 {
     ctx->atime = time(NULL);
     return ctx->fops->feof(ctx);
@@ -268,25 +268,25 @@
 }
 
 
-bool thfread_str(th_ioctx *ctx, void *ptr, const size_t len)
+BOOL thfread_str(th_ioctx *ctx, void *ptr, const size_t len)
 {
     return (thfread(ptr, sizeof(uint8_t), len, ctx) == len);
 }
 
 
-bool thfread_u8(th_ioctx *ctx, uint8_t *val)
+BOOL thfread_u8(th_ioctx *ctx, uint8_t *val)
 {
     return (thfread(val, sizeof(uint8_t), 1, ctx) == 1);
 }
 
 
-bool thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len)
+BOOL thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len)
 {
     return (thfwrite(ptr, sizeof(uint8_t), len, ctx) == len);
 }
 
 
-bool thfwrite_u8(th_ioctx *ctx, const uint8_t val)
+BOOL thfwrite_u8(th_ioctx *ctx, const uint8_t val)
 {
     return (thfwrite(&val, sizeof(uint8_t), 1, ctx) == 1);
 }
@@ -296,21 +296,21 @@
 // File routines for endian-dependant data
 //
 #define TH_DEFINE_FUNC(xname, xtype, xmacro)               \
-bool thfread_ ## xname (th_ioctx *ctx, xtype *v)           \
+BOOL thfread_ ## xname (th_ioctx *ctx, xtype *v)           \
 {                                                          \
     xtype result;                                          \
     if (thfread(&result, sizeof( xtype ), 1, ctx) != 1)    \
-        return false;                                      \
+        return FALSE;                                      \
     *v = TH_ ## xmacro ## _TO_NATIVE (result);             \
-    return true;                                           \
+    return TRUE;                                           \
 }                                                          \
                                                            \
-bool thfwrite_ ## xname (th_ioctx *ctx, const xtype v)     \
+BOOL thfwrite_ ## xname (th_ioctx *ctx, const xtype v)     \
 {                                                          \
     xtype result = TH_NATIVE_TO_ ## xmacro (v);            \
     if (thfwrite(&result, sizeof( xtype ), 1, ctx) != 1)   \
-        return false;                                      \
-    return true;                                           \
+        return FALSE;                                      \
+    return TRUE;                                           \
 }
 
 
@@ -405,7 +405,7 @@
 }
 
 
-static bool th_stdio_feof(th_ioctx *ctx)
+static BOOL th_stdio_feof(th_ioctx *ctx)
 {
     return feof(CTX_FH);
 }