diff options
| author | Tyge Løvset <[email protected]> | 2022-08-08 21:20:57 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-08 21:20:57 +0200 |
| commit | 8e2f3b4aef0b5e8de66d02ca6268c13846cc05a0 (patch) | |
| tree | 928f33c35239fc6fd8beb1da0518bf619d3ef398 /include | |
| parent | c9e0c46d29db9c2a85154c9c6a75ce0d2e2180ff (diff) | |
| download | STC-modified-8e2f3b4aef0b5e8de66d02ca6268c13846cc05a0.tar.gz STC-modified-8e2f3b4aef0b5e8de66d02ca6268c13846cc05a0.zip | |
Final fix on icmp().
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cstr.h | 2 | ||||
| -rw-r--r-- | include/stc/csview.h | 2 | ||||
| -rw-r--r-- | include/stc/utf8.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/cstr.h b/include/stc/cstr.h index 0dabc044..3231c09d 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -303,7 +303,7 @@ STC_INLINE bool cstr_starts_with_s(cstr s, cstr sub) STC_INLINE bool cstr_istarts_with(cstr s, const char* sub) { csview sv = cstr_sv(&s); size_t len = strlen(sub); - return len <= sv.size && !utf8_icmp_sv(cstr_npos, sv, c_sv(sub, len)); + return len <= sv.size && !utf8_icmp_sv(sv, c_sv(sub, len)); } diff --git a/include/stc/csview.h b/include/stc/csview.h index cd19aed7..61ab4d6b 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -127,7 +127,7 @@ STC_INLINE int csview_cmp(const csview* x, const csview* y) { return strcmp(x->str, y->str); } STC_INLINE int csview_icmp(const csview* x, const csview* y) - { return utf8_icmp_sv(csview_npos, *x, *y); } + { return utf8_icmp_sv(*x, *y); } STC_INLINE bool csview_eq(const csview* x, const csview* y) { return x->size == y->size && !memcmp(x->str, y->str, x->size); } diff --git a/include/stc/utf8.h b/include/stc/utf8.h index 4b87bc0b..2dd51927 100644 --- a/include/stc/utf8.h +++ b/include/stc/utf8.h @@ -16,7 +16,7 @@ extern uint32_t utf8_casefold(uint32_t c); extern uint32_t utf8_tolower(uint32_t c); extern uint32_t utf8_toupper(uint32_t c); extern bool utf8_valid_n(const char* s, size_t nbytes); -extern int utf8_icmp_sv(size_t u8max, csview s1, csview s2); +extern int utf8_icmp_sv(csview s1, csview s2); extern unsigned utf8_encode(char *out, uint32_t c); extern uint32_t utf8_peek(const char *s, int u8pos); @@ -35,7 +35,7 @@ STC_INLINE uint32_t utf8_decode(utf8_decode_t* d, const uint32_t byte) { /* case-insensitive utf8 string comparison */ STC_INLINE int utf8_icmp(const char* s1, const char* s2) { - return utf8_icmp_sv(~(size_t)0, c_sv(s1, ~(size_t)0), c_sv(s2, ~(size_t)0)); + return utf8_icmp_sv(c_sv(s1, ~(size_t)0), c_sv(s2, ~(size_t)0)); } STC_INLINE bool utf8_valid(const char* s) { |
