Show
Ignore:
Timestamp:
08/11/07 04:53:46 (16 months ago)
Author:
krobillard
Message:

Removed slice! datatype - series now have an end.
Added slice test.
ur_makeBinary() now takes pointer argument.
Fixed bug in _makeComponent().
Fixed compiler warnings. Minor optimization to if/.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/make.c

    r447 r450  
    163163    UIndex binN = 0; 
    164164 
    165     if( ur_seriesMem( ut, cell, &cpA, &cpB ) ) 
     165    if( ur_binaryMem( ut, cell, &cpA, &cpB ) ) 
    166166    { 
    167167        int size; 
     
    13041304 
    13051305 
     1306/* 
    13061307static void _setSliceRange( UCell* cell, UIndex a, UIndex b ) 
    13071308{ 
    13081309    if( a < b ) 
    13091310    { 
    1310         cell->slice.it  = a; 
    1311         cell->slice.end = b; 
     1311        cell->series.it  = a; 
     1312        cell->series.end = b; 
    13121313    } 
    13131314    else 
    13141315    { 
    1315         cell->slice.it  = a; 
    1316         cell->slice.end = b; 
    1317     } 
    1318 } 
     1316        cell->series.it  = a; 
     1317        cell->series.end = b; 
     1318    } 
     1319} 
     1320*/ 
    13191321 
    13201322 
     
    16631665            UIndex binN; 
    16641666 
     1667#if 0 
     1668#ifdef LANG_THUNE 
     1669            if( argc == 2 ) 
     1670            { 
     1671                UCell* pc = ur_s_prev(tos); 
     1672 
     1673                ur_initType(res, UT_STRING); 
     1674                ur_sliceDT(res) = ur_type(tos); 
     1675                res->series.n = tos->series.n; 
     1676 
     1677                if( ur_is(tos, UT_STRING) ) 
     1678                    ur_encoding(res) = ur_encoding(tos); 
     1679                if( ur_isASeries(pc) ) 
     1680                { 
     1681                    _setSliceRange( res, pc->series.it, tos->series.it ); 
     1682                } 
     1683                else if( ur_is(pc, UT_COORD) ) 
     1684                { 
     1685                    int a, b; 
     1686 
     1687                    a = pc->coord.elem[0]; 
     1688                    b = pc->coord.elem[1]; 
     1689                    if( a < 1 ) 
     1690                        a = 0; 
     1691                    else 
     1692                        --a; 
     1693                    if( b < 1 ) 
     1694                    { 
     1695                        UString* str = ur_bin(tos); 
     1696                        b += ur_sliceEnd(tos, str); 
     1697                    } 
     1698                    else 
     1699                        --b; 
     1700 
     1701                    _setSliceRange( res, a, b ); 
     1702                } 
     1703            } 
     1704            else 
     1705#endif 
     1706#endif 
    16651707            if( ur_is(tos, UT_INT) ) 
    16661708            { 
     
    17731815            res->err.messageStr = tos->series.n; 
    17741816            res->err.traceBlk   = ur_makeBlock( 8 ); 
    1775             break; 
    1776  
    1777         case UT_SLICE: 
    1778             if( ur_isASeries(tos) ) 
    1779             { 
    1780                 ur_initType(res, UT_SLICE); 
    1781                 ur_sliceDT(res) = ur_type(tos); 
    1782                 res->series.n = tos->series.n; 
    1783  
    1784                 if( ur_is(tos, UT_STRING) ) 
    1785                     ur_encoding(res) = ur_encoding(tos); 
    1786  
    1787                 if( argc == 2 ) 
    1788                 { 
    1789                     UCell* pc = ur_s_prev(tos); 
    1790                     if( ur_isASeries(pc) ) 
    1791                     { 
    1792                         _setSliceRange( res, pc->series.it, tos->series.it ); 
    1793                     } 
    1794                     else if( ur_is(pc, UT_COORD) ) 
    1795                     { 
    1796                         _setSliceRange( res, pc->coord.elem[0] - 1, 
    1797                                              pc->coord.elem[1] - 1 ); 
    1798                     } 
    1799                 } 
    1800                 else 
    1801                 { 
    1802                     res->slice.it  = tos->series.it; 
    1803                     res->slice.end = -1; 
    1804                 } 
    1805             } 
    18061817            break; 
    18071818