From: jtvolpe Date: Fri, 20 Apr 2001 02:10:51 +0000 (+0000) Subject: Fixed unary minus on unsigned expressions X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=8d39735a29a8f01179c413cfa9e2a54a1029956b;p=fw%2Fsdcc Fixed unary minus on unsigned expressions git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@744 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCval.c b/src/SDCCval.c index 9b5512ce..e70b7931 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -663,14 +663,14 @@ valUnaryPM (value * val) if (SPEC_LONG (val->etype)) { if (SPEC_USIGN (val->etype)) - SPEC_CVAL (val->etype).v_ulong = -SPEC_CVAL (val->etype).v_ulong; + SPEC_CVAL (val->etype).v_ulong = 0-SPEC_CVAL (val->etype).v_ulong; else SPEC_CVAL (val->etype).v_long = -SPEC_CVAL (val->etype).v_long; } else { if (SPEC_USIGN (val->etype)) - SPEC_CVAL (val->etype).v_uint = -SPEC_CVAL (val->etype).v_uint; + 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; }