Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.21
 
1.22
 
MAIN:ragge:20030110220256
 
pftn.c
_>10081008         }
 10091009 }
 10101010 
<> 1011+/*
  1012+ * decide if the string is external or an initializer,
  1013+ * and get the contents accordingly
  1014+ */
10111015 NODE *
<>1012 -getstr(){ /* decide if the string is external or an initializer, and get the contents accordingly */
 1013 -
  1016+getstr()
  1017+{
10141018         int l, temp;
 10151019         NODE *p;
 10161020 
<>1017 -        if( (iclass==EXTDEF||iclass==STATIC) && (pstk->in_t == CHAR || pstk->in_t == UCHAR) &&
 1018 -                        pstk!=instack && ISARY( pstk[-1].in_t ) ){
  1021+        if ((iclass == EXTDEF || iclass==STATIC) &&
  1022+            (pstk->in_t == CHAR || pstk->in_t == UCHAR) &&
  1023+            pstk != instack && ISARY(pstk[-1].in_t)) {
10191024                 /* treat "abc" as { 'a', 'b', 'c', 0 } */
 10201025                 strflg = 1;
 10211026                 ilbrace();  /* simulate { */
<>1022 -                inforce( pstk->in_off );
 1023 -                /* if the array is inflexible (not top level), pass in the size and
 1024 -                        be prepared to throw away unwanted initializers */
 1025 -                lxstr((pstk-1)!=instack?dimtab[(pstk-1)->in_d]:0);  /* get the contents */
  1027+                inforce(pstk->in_off);
  1028+                /*
  1029+                 * if the array is inflexible (not top level),
  1030+                 * pass in the size and be prepared to throw away
  1031+                 * unwanted initializers
  1032+                 */
  1033+
  1034+                  /* get the contents */
  1035+                lxstr((pstk-1) != instack ? dimtab[(pstk-1)->in_d] : 0);
10261036                 irbrace();  /* simulate } */
<>1027 -                return( NIL );
 1028 -                }
 1029 -        else { /* make a label, and get the contents and stash them away */
 1030 -                if( iclass != SNULL ){ /* initializing */
  1037+                return(NIL);
  1038+        } else {
  1039+                /* make a label, and get the contents and stash them away */
  1040+                if (iclass != SNULL) { /* initializing */
10311041                         /* fill out previous word, to permit pointer */
<>1032 -                        vfdalign( ALPOINT );
 1033 -                        }
 1034 -                temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */
 1035 -                deflab( l = getlab() );
  1042+                        vfdalign(ALPOINT);
  1043+                }
  1044+                 /* set up location counter */
  1045+                temp = locctr(blevel==0 ? ISTRNG : STRNG);
  1046+                deflab(l = getlab());
10361047                 strflg = 0;
 10371048                 lxstr(0); /* get the contents */
<>1038 -                (void) locctr( blevel==0?ilocctr:temp );
 1039 -                p = buildtree( STRING, NIL, NIL );
  1049+                (void) locctr(blevel==0 ? ilocctr : temp);
  1050+                p = buildtree(STRING, NIL, NIL);
10401051                 p->tn.rval = -l;
 10411052                 return(p);
<>1042 -                }
10431053         }
<> 1054+}
10441055 
 10451056 /*
 10461057  * simulate byte v appearing in a list of integer values
     
 !
16631674         return mkty(INT, 0, 0);
 16641675 }
 16651676 
<>1666 -/*
 1667 - * Return a basic type from basic types t1, t2, t3 and t4.
 1668 - */
 1669 -TWORD
 1670 -types(TWORD t1, TWORD t2, TWORD t3, TWORD t4) {
 1671 -
 1672 -        TWORD t[4], noun, adj, unsg;
 1673 -        int i;
 1674 -
 1675 -        t[0] = t1;
 1676 -        t[1] = t2;
 1677 -        t[2] = t3;
 1678 -        t[3] = t4;
 1679 -
 1680 -        unsg = INT/* INT or UNSIGNED */
 1681 -        noun = UNDEF/* INT, CHAR, or FLOAT */
 1682 -        adj = INT/* INT, LONG, or SHORT */
 1683 -
 1684 -        for( i=0; i<3; ++i ){
 1685 -                switch( t[i] ){
 1686 -
 1687 -                default:
 1688 -                bad:
 1689 -                        uerror( "illegal type combination" );
 1690 -                        return( INT );
 1691 -
 1692 -                case CONST:
 1693 -                case VOLATILE:
 1694 -                case UNDEF:
 1695 -                        continue;
 1696 -
 1697 -                case SIGNED:
 1698 -                case UNSIGNED:
 1699 -                        if (unsg != INT)
 1700 -                                goto bad;
 1701 -                        unsg = t[i];
 1702 -                        continue;
 1703 -
 1704 -                case LONG:
 1705 -                        if (adj == LONG) {
 1706 -                                adj = LONGLONG;
 1707 -                                continue;
 1708 -                        }
 1709 -                case SHORT:
 1710 -                        if (adj != INT)
 1711 -                                goto bad;
 1712 -                        adj = t[i];
 1713 -                        continue;
 1714 -
 1715 -                case INT:
 1716 -                case CHAR:
 1717 -                case FLOAT:
 1718 -                        if (noun != UNDEF)
 1719 -                                goto bad;
 1720 -                        noun = t[i];
 1721 -                        continue;
 1722 -                        }
 1723 -                }
 1724 -
 1725 -        /* now, construct final type */
 1726 -        if (noun == UNDEF)
 1727 -                noun = INT;
 1728 -        else if (noun == FLOAT) {
 1729 -                if (unsg != INT || adj == SHORT)
 1730 -                        goto bad;
 1731 -                return (adj==LONG ? DOUBLE : FLOAT);
 1732 -        } else if (noun == CHAR && adj != INT)
 1733 -                goto bad;
 1734 -
 1735 -        /* now, noun is INT or CHAR */
 1736 -        if (adj != INT)
 1737 -                noun = adj;
 1738 -        if (unsg == UNSIGNED)
 1739 -                return noun == LONGLONG ? ULONGLONG : (noun + (UNSIGNED-INT));
 1740 -        else
 1741 -                return (noun);
 1742 -}
 1743 -
<_17441677 NODE *
 17451678 tymerge( typ, idp ) NODE *typ, *idp; {
 17461679         /* merge type typ with identifier idp  */
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-02 23:34 +0200