From b2ea6b9d7e1c56cf0800df2a974d202ad50d28a8 Mon Sep 17 00:00:00 2001 From: johanknol Date: Thu, 11 Oct 2001 13:41:47 +0000 Subject: [PATCH] a ppc endian fix git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1387 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCicode.c | 9 ++++++++- src/SDCCval.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 0adff9fb..62b3a119 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -136,7 +136,14 @@ void checkConstantRange(sym_link *ltype, value *val, char *msg, int pedantic) { char message[132]=""; int warnings=0; int negative=0; - long v=SPEC_CVAL(val->type).v_long; + long v; + + if (SPEC_LONG(val->type)) { + v=SPEC_CVAL(val->type).v_long; + } else { + v=SPEC_CVAL(val->type).v_int; + } + #if 0 // this could be a good idea diff --git a/src/SDCCval.c b/src/SDCCval.c index 819b8144..04fd633c 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -827,7 +827,7 @@ charVal (char *s) } } else /* not a backslash */ - SPEC_CVAL (val->type).v_int = (unsigned char)*s; + SPEC_CVAL (val->type).v_uint = (unsigned char)*s; return val; } -- 2.47.2