Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.45
 
1.46
 
MAIN:ragge:20070310081444
 
local.c
_>388388 }
 389389 
 390390 /*
<>391 - * print out a constant node
 392 - * mat be associated with a label
  391+ * print out a constant node, may be associated with a label.
  392+ * Do not free the node after use.
393393  */
 394394 void
 395395 ninval(NODE *p)
 396396 {
<> 397+        union { float f; double d; long double l; int i[3]; } u;
397398         struct symtab *q;
 398399         TWORD t;
<> 400+        int i;
399401 
<>400 -        p = p->n_left;
  402+        if (p->n_op == INIT)
  403+                p = p->n_left;
401404         t = p->n_type;
 402405         if (t > BTMASK)
 403406                 t = INT; /* pointer */
 404407 
<>405 -        if (p->n_op != ICON)
  408+        if (p->n_op != ICON && p->n_op != FCON)
406409                 cerror("ninval: init node not constant");
 407410 
<> 411+        if (p->n_sp != NULL && DEUNSIGN(t) != INT)
  412+                uerror("element not constant");
  413+
408414         switch (t) {
 409415         case LONGLONG:
 410416         case ULONGLONG:
<>411 -                inval(p->n_lval & 0xffffffff);
 412 -                inval(p->n_lval >> 32);
  417+                i = (p->n_lval >> 32);
  418+                p->n_lval &= 0xffffffff;
  419+                p->n_op = INT;
  420+                ninval(p);
  421+                p->n_lval = i;
  422+                ninval(p);
413423                 break;
 414424         case INT:
 415425         case UNSIGNED:
     
 !
423433                 }
 424434                 printf("\n");
 425435                 break;
<> 436+        case SHORT:
  437+        case USHORT:
  438+                printf("\t.short 0x%x\n", (int)p->n_lval & 0xffff);
  439+                break;
  440+        case CHAR:
  441+        case UCHAR:
  442+                printf("\t.char %d\n", (int)p->n_lval & 0xff);
  443+                break;
  444+        case LDOUBLE:
  445+                u.i[2] = 0;
  446+                u.l = (long double)p->n_dcon;
  447+                printf("\t.long\t0x%x,0x%x,0x%x\n", u.i[0], u.i[1], u.i[2]);
  448+                break;
  449+        case DOUBLE:
  450+                u.d = (double)p->n_dcon;
  451+                printf("\t.long\t0x%x,0x%x\n", u.i[0], u.i[1]);
  452+                break;
  453+        case FLOAT:
  454+                u.f = (float)p->n_dcon;
  455+                printf("\t.long\t0x%x\n", u.i[0]);
  456+                break;
426457         default:
 427458                 cerror("ninval");
 428459         }
 429460 }
 430461 
<> 462+#if 0
431463 /*
 432464  * print out an integer.
 433465  */
     
 !
461493                 break;
 462494         }
 463495 }
<> 496+#endif
<_464497 
 465498 /* make a name look like an external name in the local machine */
 466499 char *
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-09-18 17:42 +0200