diff options
Diffstat (limited to 'src/u8c')
-rw-r--r-- | src/u8c/end.c | 6 | ||||
-rw-r--r-- | src/u8c/init.c | 3 | ||||
-rw-r--r-- | src/u8c/u32sz.c | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/u8c/end.c b/src/u8c/end.c index 633ced7..adfd8d6 100644 --- a/src/u8c/end.c +++ b/src/u8c/end.c @@ -24,11 +24,11 @@ # include <threads.h> # endif bool u8c_end(void) { - if(u8c_dat.stat) { + if(!u8c_dat.stat) { return false; } # if defined(u8c_bethrdsafe) - /* Destroy mutexes */ + /* Destroy mutexes: */ mtx_destroy(&u8c_dat.errlock); mtx_destroy(&u8c_dat.fmtlock); # endif @@ -38,6 +38,6 @@ bool u8c_end(void) { u8c_dat.fmtbase = UINT8_C(0xC); u8c_dat.fmtendian = UINT8_C(0x0); /* Set status: */ - u8c_dat.stat = UINT8_C(0x1); + u8c_dat.stat = UINT8_C(0x0); return false; } diff --git a/src/u8c/init.c b/src/u8c/init.c index 3c15a1d..f625bce 100644 --- a/src/u8c/init.c +++ b/src/u8c/init.c @@ -24,6 +24,7 @@ # include <threads.h> # endif bool u8c_init(void) { + /* Initialise mutexes: */ # if defined(u8c_bethrdsafe) if(mtx_init(&u8c_dat.errlock,mtx_plain) == thrd_error) { return true; @@ -36,6 +37,6 @@ bool u8c_init(void) { u8c_dat.err = NULL; u8c_seterr((uint_least32_t[]){UINT32_C(0x0),}); /* Set status: */ - u8c_dat.stat = UINT8_C(0x0); + u8c_dat.stat = UINT8_C(0x1); return false; } diff --git a/src/u8c/u32sz.c b/src/u8c/u32sz.c index 9dc2108..3320ae2 100644 --- a/src/u8c/u32sz.c +++ b/src/u8c/u32sz.c @@ -16,6 +16,7 @@ # include <assert.h> # include <stdbool.h> # include <stddef.h> +# include <stdint.h> # include <u8c/SIZE_C.h> # include <u8c/u32fndchr.h> # include <u8c/u32sz.h> @@ -23,7 +24,7 @@ bool u8c_u32sz(size_t * const _sz,char32_t const * const _in) { assert(_sz != NULL); size_t sz = SIZE_C(0x0); - if(u8c_u32fndchr(&sz,_in,U'\0')) { + if(u8c_u32fndchr(&sz,_in,UINT8_C(0x0))) { return true; } *_sz = sz; |