diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-01 10:25:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 10:25:27 +0200 |
commit | 48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715 (patch) | |
tree | e792fd9dfe30eebbb6525a285d071d4f719d38ad /src/nvim/mbyte.c | |
parent | d9a873f278272bf1311179e73ae0d7fad2c00f81 (diff) | |
parent | bd51ac2a347c0a3efb64e4b09400b7314286844c (diff) | |
download | rneovim-48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715.tar.gz rneovim-48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715.tar.bz2 rneovim-48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715.zip |
Merge pull request #20022 from dundargoc/refactor/char_u/6
refactor: replace char_u with char 6
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index f592b54f67..947594be4f 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1541,17 +1541,16 @@ ssize_t mb_utf_index_to_bytes(const char_u *s, size_t len, size_t index, bool us return -1; } -/* - * Version of strnicmp() that handles multi-byte characters. - * Needed for Big5, Shift-JIS and UTF-8 encoding. Other DBCS encodings can - * probably use strnicmp(), because there are no ASCII characters in the - * second byte. - * Returns zero if s1 and s2 are equal (ignoring case), the difference between - * two characters otherwise. - */ -int mb_strnicmp(const char_u *s1, const char_u *s2, const size_t nn) +/// Version of strnicmp() that handles multi-byte characters. +/// Needed for Big5, Shift-JIS and UTF-8 encoding. Other DBCS encodings can +/// probably use strnicmp(), because there are no ASCII characters in the +/// second byte. +/// +/// @return zero if s1 and s2 are equal (ignoring case), the difference between +/// two characters otherwise. +int mb_strnicmp(const char *s1, const char *s2, const size_t nn) { - return utf_strnicmp(s1, s2, nn, nn); + return utf_strnicmp((char_u *)s1, (char_u *)s2, nn, nn); } /// Compare strings case-insensitively @@ -1568,7 +1567,7 @@ int mb_strnicmp(const char_u *s1, const char_u *s2, const size_t nn) /// @return 0 if strings are equal, <0 if s1 < s2, >0 if s1 > s2. int mb_stricmp(const char *s1, const char *s2) { - return mb_strnicmp((const char_u *)s1, (const char_u *)s2, MAXCOL); + return mb_strnicmp(s1, s2, MAXCOL); } /* |