Changeset 25
- Timestamp:
- 02/06/06 23:30:15 (3 years ago)
- Location:
- trunk/orca
- Files:
-
- 18 modified
-
TODO (modified) (1 diff)
-
bytecode.c (modified) (3 diffs)
-
context.c (modified) (7 diffs)
-
files.c (modified) (7 diffs)
-
gl/dlist.c (modified) (12 diffs)
-
gl/gx.c (modified) (8 diffs)
-
gl/project.r (modified) (1 diff)
-
math.c (modified) (2 diffs)
-
math3d.c (modified) (1 diff)
-
op.c (modified) (2 diffs)
-
ovalue.c (modified) (44 diffs)
-
ovalue.h (modified) (3 diffs)
-
parse.c (modified) (9 diffs)
-
print.c (modified) (10 diffs)
-
qt/project.r (modified) (2 diffs)
-
qt/qorca.cpp (modified) (11 diffs)
-
series.c (modified) (82 diffs)
-
unix/os.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/TODO
r22 r25 27 27 * Words are stored in single string. 28 28 * UCell union 29 * Series.which/index -> series.n/it30 29 * Value structure hidden more using macros (ur_int(), etc.) 31 30 * Tokenizer has no nested block limit. -
trunk/orca/bytecode.c
r1 r25 142 142 { 143 143 OBlock* blk = orBLOCKS + val->index; 144 OValue* it = blk->values + val->series.i ndex;144 OValue* it = blk->values + val->series.it; 145 145 OValue* end = blk->values + blk->used; 146 146 int len = end - it; … … 176 176 { 177 177 OString* str = orSTRINGS + val->index; 178 int len = str->used - val->series.i ndex;178 int len = str->used - val->series.it; 179 179 180 180 if( len > 255 ) … … 197 197 *cp++ = len & 0xff; 198 198 199 memCpy( cp, str->charArray + val->series.i ndex, len );199 memCpy( cp, str->charArray + val->series.it, len ); 200 200 } 201 201 break; -
trunk/orca/context.c
r1 r25 298 298 if( (it->type == OT_BLOCK) || (it->type == OT_PAREN) ) 299 299 { 300 OBlock* blk = orCopyBlock( it->index, it->series.i ndex, 1 );300 OBlock* blk = orCopyBlock( it->index, it->series.it, 1 ); 301 301 orSetSeries( copy, orBlockN(blk), 0 ); 302 302 } … … 696 696 697 697 blk = orBLOCK( a1 ); 698 it = blk->values + a1->series.i ndex;698 it = blk->values + a1->series.it; 699 699 end = blk->values + blk->used; 700 700 … … 725 725 orRefPop( 1 ); 726 726 727 orEvalBlock( orBlockPtr( a2->index ), a2->series.i ndex);727 orEvalBlock( orBlockPtr( a2->index ), a2->series.it ); 728 728 } 729 729 … … 975 975 OValue* a2 = a1 + 1; 976 976 OIndex serN = a2->index; 977 OIndex si = a2->series.i ndex;977 OIndex si = a2->series.it; 978 978 OIndex send; 979 979 OIndex body = (a1 + 2)->index; 980 OIndex bi = (a1 + 2)->series.i ndex;980 OIndex bi = (a1 + 2)->series.it; 981 981 OValue saveA1; 982 982 … … 984 984 { 985 985 blk = orBLOCK( a1 ); 986 wval = blk->values + a1->series.i ndex;986 wval = blk->values + a1->series.it; 987 987 wend = blk->values + blk->used; 988 988 … … 1085 1085 orResultNONE; 1086 1086 1087 if( a2->series.i ndex)1087 if( a2->series.it ) 1088 1088 { 1089 1089 OValue* begin; … … 1094 1094 blk = orBLOCK(a2); 1095 1095 begin = blk->values; 1096 it = begin + a2->series.i ndex;1096 it = begin + a2->series.it; 1097 1097 1098 1098 while( it->LIST_NEXT > 0 ) -
trunk/orca/files.c
r2 r25 82 82 OString* str = orSTRING(a1); 83 83 orCTermStr( str ); 84 if( orIsDir( str->charArray + a1->series.i ndex) > -1 )84 if( orIsDir( str->charArray + a1->series.it ) > -1 ) 85 85 logic = 1; 86 86 orResult( OT_LOGIC, logic ); … … 93 93 OString* str = orSTRING(a1); 94 94 orCTermStr( str ); 95 size = orFileSize( str->charArray + a1->series.i ndex);95 size = orFileSize( str->charArray + a1->series.it ); 96 96 if( size < 0 ) 97 97 { … … 110 110 OString* str = orSTRING(a1); 111 111 orCTermStr( str ); 112 status = orIsDir( str->charArray + a1->series.i ndex);112 status = orIsDir( str->charArray + a1->series.it ); 113 113 if( status < 0 ) 114 114 status = 0; … … 122 122 OString* str = orSTRING(a1); 123 123 orCTermStr( str ); 124 status = orFileModified( str->charArray + a1->series.i ndex, orRESULT );124 status = orFileModified( str->charArray + a1->series.it, orRESULT ); 125 125 if( status < 0 ) 126 126 { … … 254 254 orCTermStr( str ); 255 255 256 fn = str->charArray + a1->series.i ndex;256 fn = str->charArray + a1->series.it; 257 257 n = orIsDir( fn ); 258 258 if( n < 0 ) … … 506 506 507 507 str = orSTRING(a1); 508 len = str->used - a1->series.i ndex;508 len = str->used - a1->series.it; 509 509 blen = len + (len / 99) + 600; 510 510 bin = orMakeString( blen /*+ 4*/ ); … … 513 513 { 514 514 ret = BZ2_bzBuffToBuffCompress( bin->charArray /*+ 4*/, &blen, 515 str->charArray + a1->series.i ndex, len,515 str->charArray + a1->series.it, len, 516 516 3, 0, 0 ); 517 517 if( ret == BZ_OUTBUFF_FULL ) -
trunk/orca/gl/dlist.c
r1 r25 313 313 case DLP_TEXT_STR: 314 314 // TODO: Hold string. 315 RP_ADD_ARG( ROP_TEXT, 0, cbp.values[1].series.i ndex);315 RP_ADD_ARG( ROP_TEXT, 0, cbp.values[1].series.it ); 316 316 pc->list = cbp.values[1].index; 317 317 RP_INC; … … 327 327 case DLP_VERTS: 328 328 // TODO: Hold block. 329 RP_ADD_ARG( ROP_VERTS, 0, cbp.values[1].series.i ndex);329 RP_ADD_ARG( ROP_VERTS, 0, cbp.values[1].series.it ); 330 330 pc->list = cbp.values[1].index; 331 331 RP_INC; … … 334 334 case DLP_NORMALS: 335 335 // TODO: Hold block. 336 RP_ADD_ARG( ROP_NORMALS, 0, cbp.values[1].series.i ndex);336 RP_ADD_ARG( ROP_NORMALS, 0, cbp.values[1].series.it ); 337 337 pc->list = cbp.values[1].index; 338 338 RP_INC; … … 341 341 case DLP_COLORS: 342 342 // TODO: Hold block. 343 RP_ADD_ARG( ROP_COLORS, 0, cbp.values[1].series.i ndex);343 RP_ADD_ARG( ROP_COLORS, 0, cbp.values[1].series.it ); 344 344 pc->list = cbp.values[1].index; 345 345 RP_INC; … … 348 348 case DLP_UVS: 349 349 // TODO: Hold block. 350 RP_ADD_ARG( ROP_UVS, 0, cbp.values[1].series.i ndex);350 RP_ADD_ARG( ROP_UVS, 0, cbp.values[1].series.it ); 351 351 pc->list = cbp.values[1].index; 352 352 RP_INC; … … 355 355 case DLP_QUADS: 356 356 // TODO: Hold block. 357 RP_ADD_ARG( ROP_QUADS, 0, cbp.values[2].series.i ndex);357 RP_ADD_ARG( ROP_QUADS, 0, cbp.values[2].series.it ); 358 358 pc->list = cbp.values[2].index; 359 359 RP_INC; … … 364 364 case DLP_TRIS: 365 365 // TODO: Hold block. 366 RP_ADD_ARG( ROP_TRIS, 0, cbp.values[2].series.i ndex);366 RP_ADD_ARG( ROP_TRIS, 0, cbp.values[2].series.it ); 367 367 pc->list = cbp.values[2].index; 368 368 RP_INC; … … 373 373 case DLP_STRIP: 374 374 // TODO: Hold block. 375 RP_ADD_ARG( ROP_TRISTRIP, 0, cbp.values[2].series.i ndex);375 RP_ADD_ARG( ROP_TRISTRIP, 0, cbp.values[2].series.it ); 376 376 pc->list = cbp.values[2].index; 377 377 RP_INC; … … 382 382 case DLP_FAN: 383 383 // TODO: Hold block. 384 RP_ADD_ARG( ROP_TRIFAN, 0, cbp.values[2].series.i ndex);384 RP_ADD_ARG( ROP_TRIFAN, 0, cbp.values[2].series.it ); 385 385 pc->list = cbp.values[2].index; 386 386 RP_INC; … … 391 391 case DLP_POINTS: 392 392 // TODO: Hold block. 393 RP_ADD_ARG( ROP_POINTS, 0, cbp.values[2].series.i ndex);393 RP_ADD_ARG( ROP_POINTS, 0, cbp.values[2].series.it ); 394 394 pc->list = cbp.values[2].index; 395 395 RP_INC; … … 400 400 case DLP_LINES: 401 401 // TODO: Hold block. 402 RP_ADD_ARG( ROP_LINES, 0, cbp.values[2].series.i ndex);402 RP_ADD_ARG( ROP_LINES, 0, cbp.values[2].series.it ); 403 403 pc->list = cbp.values[2].index; 404 404 RP_INC; … … 510 510 orArrayInit( &prog, sizeof(RenderWord), orSeriesLen(blk,a2) ); 511 511 512 error = compileProg( blk->values + a2->series.i ndex,512 error = compileProg( blk->values + a2->series.it, 513 513 blk->values + blk->used, &prog ); 514 514 if( error ) -
trunk/orca/gl/gx.c
r1 r25 197 197 iv[ INPUT_MY ].integer = gView->height - event->y - 1; 198 198 199 orEvalBlock( orBLOCKS + blkV->index, blkV->series.i ndex);199 orEvalBlock( orBLOCKS + blkV->index, blkV->series.it ); 200 200 gxHandleError(); 201 201 } … … 214 214 iv[ INPUT_MY ].integer = gView->height - event->y - 1; 215 215 216 orEvalBlock( orBLOCKS + blkV->index, blkV->series.i ndex);216 orEvalBlock( orBLOCKS + blkV->index, blkV->series.it ); 217 217 gxHandleError(); 218 218 } … … 244 244 } 245 245 246 orEvalBlock( orBLOCKS + blkV->index, blkV->series.i ndex);246 orEvalBlock( orBLOCKS + blkV->index, blkV->series.it ); 247 247 gxHandleError(); 248 248 } … … 262 262 iv[ INPUT_DY ].integer = event->y; 263 263 264 orEvalBlock( orBLOCKS + blkV->index, blkV->series.i ndex);264 orEvalBlock( orBLOCKS + blkV->index, blkV->series.it ); 265 265 gxHandleError(); 266 266 } … … 276 276 if( hval ) 277 277 { 278 orEvalBlock( orBLOCKS + hval->index, hval->series.i ndex);278 orEvalBlock( orBLOCKS + hval->index, hval->series.it ); 279 279 gxHandleError(); 280 280 } … … 291 291 if( hval ) 292 292 { 293 orEvalBlock( orBLOCKS + hval->index, hval->series.i ndex);293 orEvalBlock( orBLOCKS + hval->index, hval->series.it ); 294 294 gxHandleError(); 295 295 } … … 662 662 orArrayInit( &prog, sizeof(RenderWord), blk->used ); 663 663 664 error = compileProg( blk->values + a1->series.i ndex,664 error = compileProg( blk->values + a1->series.it, 665 665 blk->values + blk->used, &prog ); 666 666 if( error ) … … 1480 1480 void keyHandlerNative( OValue* a1 ) 1481 1481 { 1482 if( validKeyHandlerBlock( a1->index, a1->series.i ndex) )1483 { 1484 OBlock* blk2 = orCopyBlock( a1->index, a1->series.i ndex, 0 );1482 if( validKeyHandlerBlock( a1->index, a1->series.it ) ) 1483 { 1484 OBlock* blk2 = orCopyBlock( a1->index, a1->series.it, 0 ); 1485 1485 mapKeyAtoms( blk2 ); 1486 1486 orSetSeries( a1, orBlockN(blk2), 0 ); -
trunk/orca/gl/project.r
r1 r25 11 11 include_from %.. 12 12 include_from %../util 13 libs_from %.. %orca 13 libs_from %.. %orca0 14 14 15 15 macx [ -
trunk/orca/math.c
r1 r25 138 138 { 139 139 rn = genrand_int32(); 140 used -= a1->series.i ndex;141 a1->series.i ndex+= rn % used;140 used -= a1->series.it; 141 a1->series.it += rn % used; 142 142 return; 143 143 } … … 280 280 case OT_BITSET: 281 281 { 282 OString* bin = orCopyString( a1->index, a1->series.i ndex);282 OString* bin = orCopyString( a1->index, a1->series.it ); 283 283 uint8_t* it = bin->byteArray; 284 284 uint8_t* end = bin->byteArray + bin->used; -
trunk/orca/math3d.c
r1 r25 279 279 280 280 OBlock* blk = orBLOCK(blkV); 281 OValue* it = blk->values + blkV->series.i ndex;281 OValue* it = blk->values + blkV->series.it; 282 282 OValue* end = blk->values + blk->used; 283 283 float* vend = vec + count; -
trunk/orca/op.c
r1 r25 437 437 case OT_SETPATH: 438 438 // TODO: compare all values. 439 if( (a-> index == b->index) &&440 (a->series.i ndex == b->series.index) )439 if( (a->series.n == b->series.n) && 440 (a->series.it == b->series.it) ) 441 441 logic = 1; 442 442 break; … … 568 568 else if( orIsSeries(a->type) ) 569 569 { 570 if( (a-> index == b->index) &&571 (a->series.i ndex == b->series.index) )570 if( (a->series.n == b->series.n) && 571 (a->series.it == b->series.it) ) 572 572 logic = 1; 573 573 } -
trunk/orca/ovalue.c
r3 r25 617 617 OContext ctx; 618 618 OString* str = orSTRING( from ); 619 int start = from->series.i ndex;619 int start = from->series.it; 620 620 621 621 orGlobalCtx( ctx ); … … 658 658 { 659 659 OString* str = orSTRING(from); 660 char* it = str->charArray + from->series.i ndex;660 char* it = str->charArray + from->series.it; 661 661 char* end = str->charArray + str->used; 662 662 const char* fin; … … 677 677 { 678 678 OString* str = orSTRING(from); 679 char* it = str->charArray + from->series.i ndex;679 char* it = str->charArray + from->series.it; 680 680 char* end = str->charArray + str->used; 681 681 const char* fin; … … 690 690 { 691 691 OBlock* blk = orBLOCK( from ); 692 OValue* it = blk->values + from->series.i ndex;692 OValue* it = blk->values + from->series.it; 693 693 OValue* end = blk->values + blk->used; 694 694 if( (end - it) == 2 && … … 709 709 { 710 710 OBlock* blk = orBLOCK( from ); 711 OValue* it = blk->values + from->series.i ndex;711 OValue* it = blk->values + from->series.it; 712 712 OValue* end = blk->values + blk->used; 713 713 uint8_t* tuple = res->tuple; … … 771 771 { 772 772 OContext ctx; 773 if( orMakeObject( orBLOCK(a2), a2->series.i ndex, &ctx ) )773 if( orMakeObject( orBLOCK(a2), a2->series.it, &ctx ) ) 774 774 { 775 775 orSetTF( a1, OT_OBJECT ); … … 787 787 { 788 788 case OT_STRING: 789 bin = orMakeCharset( orSTRING(a2), a2->series.i ndex);789 bin = orMakeCharset( orSTRING(a2), a2->series.it ); 790 790 break; 791 791 792 792 case OT_BINARY: 793 bin = orCopyString( a2->index, a2->series.i ndex);793 bin = orCopyString( a2->index, a2->series.it ); 794 794 break; 795 795 796 796 case OT_BLOCK: 797 bin = _makeBitset( orBLOCK(a2), a2->series.i ndex);797 bin = _makeBitset( orBLOCK(a2), a2->series.it ); 798 798 break; 799 799 } … … 811 811 { 812 812 OBlock* blk = orBLOCK( a2 ); 813 OValue* it = blk->values + a2->series.i ndex;813 OValue* it = blk->values + a2->series.it; 814 814 OValue* end = blk->values + blk->used; 815 815 int len = end - it; … … 884 884 { 885 885 OContext ctx; 886 if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.i ndex) )886 if( orMakeClone( &a1->ctx, &ctx, a2->index, a2->series.it ) ) 887 887 { 888 888 orSetTF( a1, OT_OBJECT ); … … 955 955 orSetSeries( res, orBlockN(blk), 0 ); 956 956 957 if( bin->used > a2->series.i ndex)957 if( bin->used > a2->series.it ) 958 958 { 959 959 OIndex len; 960 960 const uint8_t* code; 961 code = bin->byteArray + a2->series.i ndex;961 code = bin->byteArray + a2->series.it; 962 962 if( orByteCodeBlock( &code, &len ) ) 963 963 orRevaluateByteCodes( code, len, blk ); … … 987 987 OString* str; 988 988 OBlock* blk = orBLOCK(a2); 989 OValue* it = blk->values + a2->series.i ndex;989 OValue* it = blk->values + a2->series.it; 990 990 OValue* end = blk->values + blk->used; 991 991 … … 1182 1182 { 1183 1183 OString* str = orSTRING( a1 ); 1184 blk = orTokenize( str->charArray + a1->series.i ndex,1184 blk = orTokenize( str->charArray + a1->series.it, 1185 1185 str->charArray + str->used ); 1186 1186 if( blk ) … … 1316 1316 if( orIs(a1, OT_BLOCK) || orIs(a1, OT_PAREN) ) 1317 1317 { 1318 orEvalBlock( orBLOCK( a1 ), a1->series.i ndex);1318 orEvalBlock( orBLOCK( a1 ), a1->series.it ); 1319 1319 } 1320 1320 else if( orIs(a1, OT_FILE) ) … … 1407 1407 { 1408 1408 OBlock* blk = orBLOCK(a1); 1409 OValue* it = blk->values + a1->series.i ndex;1409 OValue* it = blk->values + a1->series.it; 1410 1410 OValue* end = blk->values + blk->used; 1411 1411 while( it != end ) … … 1477 1477 { 1478 1478 OValue* a2 = a1 + 1; 1479 orEvalBlock( orBLOCK( a2 ), a2->series.i ndex);1479 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1480 1480 return; 1481 1481 } … … 1491 1491 { 1492 1492 OValue* a2 = a1 + 1; 1493 orEvalBlock( orBLOCK( a2 ), a2->series.i ndex);1493 orEvalBlock( orBLOCK( a2 ), a2->series.it ); 1494 1494 return; 1495 1495 } … … 1506 1506 --blkArg; 1507 1507 } 1508 orEvalBlock( orBLOCK( blkArg ), blkArg->series.i ndex);1508 orEvalBlock( orBLOCK( blkArg ), blkArg->series.it ); 1509 1509 } 1510 1510 … … 1518 1518 ++a1; 1519 1519 body = a1->index; 1520 bi = a1->series.i ndex;1520 bi = a1->series.it; 1521 1521 1522 1522 while( n > 0 ) … … 1537 1537 OValue* a3 = a1 + 2; 1538 1538 OIndex body = a3->index; 1539 OIndex bi = a3->series.i ndex;1539 OIndex bi = a3->series.it; 1540 1540 1541 1541 orWordVal(
