Fix type signedness error in commit 5c40364dd6.

Use ssize_t instead of size_t.

Discussion: https://postgr.es/m/b20d6d97-7338-48ea-ba33-837a1c8ef98e@iki.fi
Reported-by: Heikki Linnakangas
This commit is contained in:
Jeff Davis 2024-03-08 15:58:32 -08:00
parent be41a9b038
commit 33ee2550d3
2 changed files with 7 additions and 7 deletions

View File

@ -21,8 +21,8 @@
#include "mb/pg_wchar.h"
static const pg_case_map *find_case_map(pg_wchar ucs);
static size_t convert_case(char *dst, size_t dstsize, const char *src, size_t srclen,
CaseKind casekind);
static size_t convert_case(char *dst, size_t dstsize, const char *src,
ssize_t srclen, CaseKind casekind);
pg_wchar
unicode_lowercase_simple(pg_wchar code)
@ -65,7 +65,7 @@ unicode_uppercase_simple(pg_wchar code)
* required buffer size before allocating.
*/
size_t
unicode_strlower(char *dst, size_t dstsize, const char *src, size_t srclen)
unicode_strlower(char *dst, size_t dstsize, const char *src, ssize_t srclen)
{
return convert_case(dst, dstsize, src, srclen, CaseLower);
}
@ -87,7 +87,7 @@ unicode_strlower(char *dst, size_t dstsize, const char *src, size_t srclen)
* required buffer size before allocating.
*/
size_t
unicode_strupper(char *dst, size_t dstsize, const char *src, size_t srclen)
unicode_strupper(char *dst, size_t dstsize, const char *src, ssize_t srclen)
{
return convert_case(dst, dstsize, src, srclen, CaseUpper);
}
@ -98,7 +98,7 @@ unicode_strupper(char *dst, size_t dstsize, const char *src, size_t srclen)
* Map each character in the string for which a mapping is available.
*/
static size_t
convert_case(char *dst, size_t dstsize, const char *src, size_t srclen,
convert_case(char *dst, size_t dstsize, const char *src, ssize_t srclen,
CaseKind casekind)
{
size_t srcoff = 0;

View File

@ -20,8 +20,8 @@ pg_wchar unicode_lowercase_simple(pg_wchar ucs);
pg_wchar unicode_titlecase_simple(pg_wchar ucs);
pg_wchar unicode_uppercase_simple(pg_wchar ucs);
size_t unicode_strlower(char *dst, size_t dstsize, const char *src,
size_t srclen);
ssize_t srclen);
size_t unicode_strupper(char *dst, size_t dstsize, const char *src,
size_t srclen);
ssize_t srclen);
#endif /* UNICODE_CASE_H */