Changeset 30 for trunk/orca/op.c

Show
Ignore:
Timestamp:
02/08/06 00:06:15 (3 years ago)
Author:
jvargas
Message:

Added tuple support to orOpAdd

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/op.c

    r25 r30  
    5959        a = b; 
    6060    } 
     61    else if( a->type == OT_TUPLE ) 
     62    { 
     63        if( b->type == OT_TUPLE ) 
     64        { 
     65                        int tmp; 
     66                        OValue* res; 
     67                         
     68                        res = orRESULT; 
     69                        orSetTF( res, OT_TUPLE ); 
     70 
     71                        res->argc = a->argc > b->argc ? a->argc : b->argc; 
     72                         
     73                        for( uint8_t i = 0; i < OR_TUPLE_MAX; i++ ) 
     74                        { 
     75                                tmp = a->tuple[i] + b->tuple[i]; 
     76                                res->tuple[i] = tmp > 255 ? 255 : tmp; 
     77                        } 
     78                         
     79                        return; 
     80        } 
    6181#if 0 
    62     else if( a->type == OT_TUPLE ) 
    63     { 
    64         if( b->type == OT_TUPLE ) 
    65         { 
    66         } 
    6782        else if( b->type == OT_INTEGER ) 
    6883        { 
    69         } 
    70     } 
     84                        orResult( OT_TUPLE, b->integer ); 
     85                        return; 
     86        } 
     87                else if( b->type == OT_INTEGER ) 
     88        { 
     89                        orResult( OT_TUPLE, b->integer ); 
     90                        return; 
     91        } 
    7192#endif 
     93                a = b; 
     94    } 
    7295    else if( a->type == OT_TIME ) 
    7396    {