summaryrefslogtreecommitdiff
path: root/include/al
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-08-28 14:41:15 -0400
committerAndrew Opalach <andrew@akon.city> 2025-08-28 14:41:15 -0400
commit088e9e5cfc0d2b17b34821d8cdbe5b6f49191387 (patch)
tree7c78faf9ca4077cd970969fcea4120c89864e9e7 /include/al
parent492f4a38f7b7f32727ab678f333eff840d968d74 (diff)
downloadlibalabaster-088e9e5cfc0d2b17b34821d8cdbe5b6f49191387.tar.gz
libalabaster-088e9e5cfc0d2b17b34821d8cdbe5b6f49191387.tar.bz2
libalabaster-088e9e5cfc0d2b17b34821d8cdbe5b6f49191387.zip
(w)str: NPOS -> NO_POS
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'include/al')
-rw-r--r--include/al/str.h10
-rw-r--r--include/al/wstr.h8
2 files changed, 9 insertions, 9 deletions
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);