Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.51
 
1.52
 
MAIN:ragge:20030707175138
 
trees.c
_>644644         t1 = p->n_left->n_type;
 645645         t2 = p->n_right->n_type;
 646646 
<> 647+        /* return of void allowed but nothing else */
  648+        if (p->n_op == RETURN) {
  649+                if (t1 == VOID && t2 == VOID)
  650+                        return;
  651+                if (t1 == VOID)
  652+                        return uerror("returning value from void function");
  653+                if (t2 == VOID)
  654+                        return uerror("using void value");
  655+        }
  656+
  657+        /* allow void pointer assignments in any direction */
  658+        if (BTYPE(t1) == VOID && (t2 & TMASK))
  659+                return;
  660+        if (BTYPE(t2) == VOID && (t1 & TMASK))
  661+                return;
  662+
647663         /* check for enumerations */
 648664         if (t1==ENUMTY || t2==ENUMTY) {
 649665                 if( logop( p->n_op ) && p->n_op != EQ && p->n_op != NE ) {
     
 !
658674                 }
 659675         }
 660676 
<>661 -        if( ISPTR(t1) || ISARY(t1) ) q = p->n_right;
 662 -        else q = p->n_left;
  677+        if (ISPTR(t1) || ISARY(t1))
  678+                q = p->n_right;
  679+        else
  680+                q = p->n_left;
663681 
<>664 -        if ( !ISPTR(q->n_type) && !ISARY(q->n_type) ){
  682+        if (!ISPTR(q->n_type) && !ISARY(q->n_type)) {
665683                 if (q->n_op != ICON || q->n_lval != 0)
 666684                         werror("illegal combination of pointer and integer");
 667685         } else {
 668686                 d1 = p->n_left->n_df;
 669687                 d2 = p->n_right->n_df;
<> 688+                if (t1 == t2) {
  689+                        if (p->n_left->n_sue != p->n_right->n_sue)
  690+                                werror("illegal structure pointer combination");
  691+                        return;
  692+                }
670693                 for (;;) {
<>671 -                        if( t1 == t2 ) {;
 672 -                                if (p->n_left->n_sue != p->n_right->n_sue) {
 673 -                                        werror("illegal structure pointer combination");
 674 -                                }
 675 -                                return;
 676 -                        }
 677 -                        if (ISARY(t1) || ISPTR(t1) ) {
 678 -                                if( !ISARY(t2) && !ISPTR(t2) ) break;
  694+                        if (ISARY(t1) || ISPTR(t1)) {
  695+                                if (!ISARY(t2) && !ISPTR(t2))
  696+                                        break;
679697                                 if (ISARY(t1) && ISARY(t2) && d1->ddim != d2->ddim) {
 680698                                         werror("illegal array size combination");
 681699                                         return;
 682700                                 }
<>683 -                                if( ISARY(t1) ) ++d1;
 684 -                                if( ISARY(t2) ) ++d2; ++d2;
  701+                                if (ISARY(t1))
  702+                                        ++d1;
  703+                                if (ISARY(t2))
  704+                                        ++d2;
685705                         } else if (ISFTN(t1)) {
 686706                                 if (chkftn(d1->dfun, d2->dfun)) {
 687707                                         werror("illegal function "
     
 !
690710                                 }
 691711                                 ++d1;
 692712                                 ++d2;
<>693 -                        } else break;
  713+                        } else
  714+                                break;
694715                         t1 = DECREF(t1);
 695716                         t2 = DECREF(t2);
 696717                 }
     
 !
12711292                 if( mt12 & MSTR ) return( LVAL+NCVT+TYPL+OTHER );
 12721293         case CAST:
 12731294                 if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
<> 1295+                else if(mt1&MENU && mt2&MDBI) return( TYPL+LVAL+TYMATCH );
  1296+                else if(mt2&MENU && mt1&MDBI) return( TYPL+LVAL+TYMATCH );
<_12741297                 else if( (mt1&MENU)||(mt2&MENU) )
 12751298                         return( LVAL+NCVT+TYPL+PTMATCH+PUN );
 12761299                 else if( mt1 & MPTR) return( LVAL+PTMATCH+PUN );
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-21 18:19 +0100