Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.248
 
1.249
 
MAIN:ragge:20100616194140
 
trees.c
_>865865         default:
 866866                 return(0);
 867867                 }
<> 868+        /* Do the best in making everything type correct after calc */
  869+        p->n_lval = valcast(p->n_lval, p->n_type);
868870         return(1);
 869871         }
 870872 
 871873 /*
<> 874+ * Ensure that v matches the type t; sign- or zero-extended
  875+ * as suitable to CONSZ.
  876+ * Only to be used for integer types.
  877+ */
  878+CONSZ
  879+valcast(CONSZ v, TWORD t)
  880+{
  881+        CONSZ r;
  882+
  883+        if (t < CHAR || t > ULONGLONG)
  884+                cerror("valcast");
  885+
  886+        if (t >= LONGLONG)
  887+                return v; /* already largest */
  888+
  889+#define M(x)    ((((1ULL << ((x)-1)) - 1) << 1) + 1)
  890+#define NOTM(x) (~M(x))
  891+#define SBIT(x) (1ULL << ((x)-1))
  892+
  893+        r = v & M(btdims[t].suesize);
  894+        if (!ISUNSIGNED(t) && (SBIT(btdims[t].suesize) & r))
  895+                r = r | NOTM(btdims[t].suesize);
  896+        return r;
  897+}
  898+
  899+/*
<_872900  * Checks p for the existance of a pun.  This is called when the op of p
 873901  * is ASSIGN, RETURN, CAST, COLON, or relational.
 874902  * One case is when enumerations are used: this applies only to lint.
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-31 21:50 +0100