Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.48
 
1.49
 
MAIN:ragge:20070722125056
 
local.c
_>387387 
 388388 }
 389389 
<> 390+#if 0
390391 /*
 391392  * Print out an integer constant of size size.
 392393  * can only be sizes <= SZINT.
     
 !
408409                 cerror("indata");
 409410         }
 410411 }
<> 412+#endif
411413 
 412414 /*
 413415  * Print out a string of characters.
     
 !
434436         printf("\\0\"\n");
 435437 }
 436438 
<> 439+static int inbits, inval;
  440+
437441 /*
<> 442+ * set fsz bits in sequence to zero.
  443+ */
  444+void
  445+zbits(OFFSZ off, int fsz)
  446+{
  447+        int m;
  448+
  449+        if (idebug)
  450+                printf("zbits off %lld, fsz %d\n", off, fsz);
  451+        if ((m = (inbits % SZCHAR))) {
  452+                m = SZCHAR - m;
  453+                if (fsz < m) {
  454+                        inbits += m;
  455+                        return;
  456+                } else {
  457+                        fsz -= m;
  458+                        printf("\t.byte %d\n", inval);
  459+                        inval = inbits = 0;
  460+                }
  461+        }
  462+        if (fsz >= SZCHAR) {
  463+                printf("\t.zero %d\n", fsz/SZCHAR);
  464+                fsz -= (fsz/SZCHAR);
  465+        }
  466+        if (fsz) {
  467+                inval = 0;
  468+                inbits = fsz;
  469+        }
  470+}
  471+
  472+/*
  473+ * Initialize a bitfield.
  474+ */
  475+void
  476+infld(CONSZ off, int fsz, CONSZ val)
  477+{
  478+        if (idebug)
  479+                printf("infld off %lld, fsz %d, val %lld\n", off, fsz, val);
  480+        val &= (1 << fsz)-1;
  481+        while (fsz + inbits >= SZCHAR) {
  482+                inval |= (val << inbits);
  483+                printf("\t.byte %d\n", inval & 255);
  484+                fsz -= (SZCHAR - inbits);
  485+                val >>= (SZCHAR - inbits);
  486+                inval = inbits = 0;
  487+        }
  488+        inval = val;
  489+        inbits = fsz;
  490+}
  491+
  492+/*
438493  * print out a constant node, may be associated with a label.
 439494  * Do not free the node after use.
<> 495+ * off is bit offset from the beginning of the aggregate
  496+ * fsz is the number of bits this is referring to
440497  */
 441498 void
<>442 -ninval(NODE *p)
  499+ninval(CONSZ off, int fsz, NODE *p)
443500 {
 444501         union { float f; double d; long double l; int i[3]; } u;
 445502         struct symtab *q;
 446503         TWORD t;
 447504         int i;
 448505 
<>449 -        if (p->n_op == INIT)
 450 -                p = p->n_left;
451506         t = p->n_type;
 452507         if (t > BTMASK)
 453508                 t = INT; /* pointer */
 454509 
 455510         if (p->n_op != ICON && p->n_op != FCON)
 456511                 cerror("ninval: init node not constant");
 457512 
<>458 -        if (p->n_sp != NULL && DEUNSIGN(t) != INT)
  513+        if (p->n_op == ICON && p->n_sp != NULL && DEUNSIGN(t) != INT)
459514                 uerror("element not constant");
 460515 
 461516         switch (t) {
     
 !
464519                 i = (p->n_lval >> 32);
 465520                 p->n_lval &= 0xffffffff;
 466521                 p->n_op = INT;
<>467 -                ninval(p);
  522+                ninval(off, 32, p);
468523                 p->n_lval = i;
<>469 -                ninval(p);
  524+                ninval(off+32, 32, p);
470525                 break;
 471526         case INT:
 472527         case UNSIGNED:
     
 !
642697         printf("        .%s\n", loctbl[locc]);
 643698 }
 644699 
<> 700+#if 0
645701 int
 646702 ftoint(NODE *p, CONSZ **c)
 647703 {
     
 !
670726         *c = cc;
 671727         return n;
 672728 }
<_ 729+#endif
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-07-10 21:30 +0200