aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-03-26 09:15:42 +0300
committerMikhail Romanko <me@blankhex.com>2025-04-05 13:56:00 +0300
commit9025c3d9451795f75733ea772944aced285f1a50 (patch)
treed4347c4c13df0cf0f617443a4948387d9d7bcba7
parent4b2e3da567e9f972e55ce5da60b4147f29444f53 (diff)
downloadbhlib-9025c3d9451795f75733ea772944aced285f1a50.tar.gz
Fix bug related to char being signed or unsigned on different platforms
-rw-r--r--src/String/Int.c4
1 files 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++); \