From fd60845cbca46308dd26f0930bc09efb47a43b25 Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 23 Nov 2001 10:18:30 +0000 Subject: [PATCH] fixed the "(int) = -0x81" problem git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1629 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCval.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/SDCCval.c b/src/SDCCval.c index 8d65e07f..ad57890f 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -890,17 +890,10 @@ floatFromVal (value * val) return (double) SPEC_CVAL (val->etype).v_long; } - if (SPEC_NOUN(val->etype)==V_INT) { - if (SPEC_USIGN (val->etype)) - return (double) SPEC_CVAL (val->etype).v_uint; - else - return (double) SPEC_CVAL (val->etype).v_int; - } else { // SPEC_NOUN==V_CHAR - if (SPEC_USIGN (val->etype)) - return (double) ((unsigned char)SPEC_CVAL (val->etype).v_uint); - else - return (double) ((signed char)SPEC_CVAL (val->etype).v_int); - } + if (SPEC_USIGN (val->etype)) + return (double) SPEC_CVAL (val->etype).v_uint; + else + return (double) SPEC_CVAL (val->etype).v_int; } @@ -928,9 +921,6 @@ valUnaryPM (value * val) SPEC_CVAL (val->etype).v_uint = 0-SPEC_CVAL (val->etype).v_uint; else SPEC_CVAL (val->etype).v_int = -SPEC_CVAL (val->etype).v_int; - if (SPEC_NOUN (val->etype)==V_CHAR) { - SPEC_CVAL (val->etype).v_uint &= 0xff; - } } } // -(unsigned 3) now really is signed -- 2.47.2