From 9025c3d9451795f75733ea772944aced285f1a50 Mon Sep 17 00:00:00 2001 From: Mikhail Romanko Date: Wed, 26 Mar 2025 09:15:42 +0300 Subject: Fix bug related to char being signed or unsigned on different platforms --- src/String/Int.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/String/Int.c b/src/String/Int.c index d4f468f..f15e9a3 100644 --- a/src/String/Int.c +++ b/src/String/Int.c @@ -6,7 +6,7 @@ static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -static const char lookup[] = +static const signed char lookup[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -158,7 +158,7 @@ char *BH_StringFromInt64u(uint64_t value, #undef TEMPLATE_IMPL #define TEMPLATE_IMPL(type) \ - type result = 0; int sign, flag = 0; char sym; if (size) *size = 0; \ + type result = 0; int sign, flag = 0; signed char sym; if (size) *size = 0; \ if (base != 0 && (base < 2 || base > 36)) { return 0; } \ skipSpace(&string, size); handleSign(&string, size, &sign); \ guessBase(&string, size, &base); while(*string) { sym = *(string++); \ -- cgit v1.2.3