From d73a40e961a74031a2b0e4b4491954512307fb85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Wed, 8 Sep 2010 12:37:44 +0000 Subject: [PATCH] - Fixed IntegerLiterals32.mo on OMDev git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6058 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Parser/Modelica.g | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parser/Modelica.g b/Parser/Modelica.g index 644bc6b2763..37cba2ce757 100644 --- a/Parser/Modelica.g +++ b/Parser/Modelica.g @@ -910,13 +910,13 @@ primary returns [void* ast] @declarations { if (errno || *endptr != 0) { errno = 0; double d = strtod(chars,&endptr); - modelicaParserAssert(*endptr != 0 && !errno, "Number is too large to represent as a long or double on this machine", primary, $start->line, $start->charPosition+1, LT(1)->line, LT(1)->charPosition+1); + modelicaParserAssert(*endptr == 0 && errno==0, "Number is too large to represent as a long or double on this machine", primary, $start->line, $start->charPosition+1, LT(1)->line, LT(1)->charPosition+1); c_add_source_message(2, "SYNTAX", "Warning", "\%s-bit signed integers! Transforming: \%s into a real", args, 2, $start->line, $start->charPosition+1, LT(1)->line, LT(1)->charPosition+1, ModelicaParser_readonly, ModelicaParser_filename_C); $ast = Absyn__REAL(mk_rcon(d)); } else { - if (((long)1<<(RML_SIZE_INT*8-2))-1 > l) { + if (((long)1<<(RML_SIZE_INT*8-2))-1 >= l) { $ast = Absyn__INTEGER(RML_IMMEDIATE(RML_TAGFIXNUM(l))); /* We can't use mk_icon here - it takes "int"; not "long" */ } else { if (l > ((long)1<<30)-1) {