From 088e9e5cfc0d2b17b34821d8cdbe5b6f49191387 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 28 Aug 2025 14:41:15 -0400 Subject: (w)str: NPOS -> NO_POS Signed-off-by: Andrew Opalach --- include/al/str.h | 10 +++++----- include/al/wstr.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/al/str.h b/include/al/str.h index ac5dba8..6640b0f 100644 --- a/include/al/str.h +++ b/include/al/str.h @@ -9,7 +9,7 @@ typedef struct { char *__sized_by(alloc) data; } str; -#define AL_STR_NPOS ((u32)-1) +#define AL_STR_NO_POS ((u32)-1) #define al_str_null() ((str){ 0, 0, NULL }) @@ -134,13 +134,13 @@ static inline bool al_str_eq(str *s, str *c) static inline u32 al_str_find(str *s, char c) { char *loc = (char *)al_memchr(s->data, c, s->length); - return loc ? (u32)(loc - s->data) : AL_STR_NPOS; + return loc ? (u32)(loc - s->data) : AL_STR_NO_POS; } static inline u32 al_str_rfind(str *s, char c) { char *loc = (char *)al_memrchr(s->data, c, s->length); - return loc ? (u32)(loc - s->data) : AL_STR_NPOS; + return loc ? (u32)(loc - s->data) : AL_STR_NO_POS; } // extremely slow. @@ -154,13 +154,13 @@ static inline u32 al_str_find_str(str *s, str *c) } } } - return AL_STR_NPOS; + return AL_STR_NO_POS; } static inline bool al_str_tok(str *result, char delim) { u32 index = al_str_find(result, delim); - if (index == AL_STR_NPOS) { + if (index == AL_STR_NO_POS) { return false; } *result = al_str_substr(result, index + 1, result->length); diff --git a/include/al/wstr.h b/include/al/wstr.h index af66161..599d126 100644 --- a/include/al/wstr.h +++ b/include/al/wstr.h @@ -10,7 +10,7 @@ typedef struct { wchar_t *__sized_by(alloc) data; } wstr; -#define AL_WSTR_NPOS ((u32)-1) +#define AL_WSTR_NO_POS ((u32)-1) #define al_wstr_null() ((wstr){ 0, 0, NULL }) @@ -189,7 +189,7 @@ static inline u32 al_wstr_find(wstr *w, wchar_t c) return i; } } - return AL_WSTR_NPOS; + return AL_WSTR_NO_POS; } static inline u32 al_wstr_rfind(wstr *w, wchar_t c) @@ -199,13 +199,13 @@ static inline u32 al_wstr_rfind(wstr *w, wchar_t c) return i; } } - return AL_WSTR_NPOS; + return AL_WSTR_NO_POS; } static inline bool al_wstr_tok(wstr *result, wchar_t delim) { u32 index = al_wstr_find(result, delim); - if (index == AL_WSTR_NPOS) { + if (index == AL_WSTR_NO_POS) { return false; } *result = al_wstr_substr(result, index + 1, result->length); -- cgit v1.2.3-101-g0448