summaryrefslogtreecommitdiff
path: root/src/host-java/main.cc
diff options
context:
space:
mode:
authorJun He <jun.he@linaro.org>2020-09-17 14:03:09 +0800
committerJun He <jun.he@linaro.org>2020-09-17 14:32:22 +0800
commite2650a71a1af9711fd07e213988db4b3c6d7fa71 (patch)
tree4c31853b5855a1e37bce79c7656e60e870a04bbb /src/host-java/main.cc
parent401cb0041f5871215d83c64ab5e021149078e426 (diff)
downloadragel-e2650a71a1af9711fd07e213988db4b3c6d7fa71.tar.gz
common: Fix ambiguous CHAR_MIN/MAX definition
According to C/C++ standards, char is implementation-defined whether it could hold negative values. See: http://www.cplusplus.com/reference/climits/ In ragel char is treated as a signed value with range as [-128, 127]. This means that the CHAR_MIN/CHAR_MAX should be replaced with a more accurate definition to align across different systems and library implementations. Change-Id: I10668f2d2550b603101dc68f4cc1121035022abd Signed-off-by: Jun He <jun.he@linaro.org>
Diffstat (limited to 'src/host-java/main.cc')
-rw-r--r--src/host-java/main.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host-java/main.cc b/src/host-java/main.cc
index d4efd3fc..9899a053 100644
--- a/src/host-java/main.cc
+++ b/src/host-java/main.cc
@@ -36,7 +36,7 @@ const char *defaultOutFnJava( const char *inputFileName )
HostType hostTypesJava[] =
{
- { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 },
+ { "byte", 0, "byte", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 },
{ "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 },
{ "char", 0, "char", false, true, false, 0, 0, 0, USHRT_MAX, 2 },
{ "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 },