Changeset 54
- Timestamp:
- 02/17/06 15:30:01 (3 years ago)
- Location:
- trunk/orca
- Files:
-
- 15 modified
-
ChangeLog (modified) (2 diffs)
-
bytecode.c (modified) (3 diffs)
-
context.c (modified) (18 diffs)
-
error.c (modified) (6 diffs)
-
gl/dlist.c (modified) (8 diffs)
-
gl/gx.c (modified) (13 diffs)
-
gl/joystick.c (modified) (6 diffs)
-
gl/ttf_load.c (modified) (2 diffs)
-
math.c (modified) (14 diffs)
-
math3d.c (modified) (2 diffs)
-
op.c (modified) (39 diffs)
-
ovalue.c (modified) (34 diffs)
-
print.c (modified) (12 diffs)
-
series.c (modified) (31 diffs)
-
util/cbparse.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/ChangeLog
r2 r54 2 2 3 3 4 V0.0.23 - ?? January 20054 V0.0.23 - ?? February 2005 5 5 6 6 * Foreach no longer creates a new context. Use 'rebol in config.r to … … 8 8 * Script header is now required. 9 9 * Implemented do/args. 10 * Most math operators now work on tuples. 10 11 * Bugfixes. 11 12 -
trunk/orca/bytecode.c
r42 r54 75 75 case OT_INTEGER: 76 76 { 77 int i = val->integer;77 int i = orInt(val); 78 78 if( i > 255 ) 79 79 { … … 103 103 104 104 end = cp + 8; 105 li = *((uint64_t*) & val->num.decimal);105 li = *((uint64_t*) &orDecimal(val)); 106 106 while( cp != end ) 107 107 { … … 117 117 RESERVE( 2 ); 118 118 *cp++ = val->type; 119 *cp = val->integer& 0xff;119 *cp = orInt(val) & 0xff; 120 120 break; 121 121 -
trunk/orca/context.c
r45 r54 158 158 while( it != end ) 159 159 { 160 if( it->word.atom== atom )160 if( orAtom(it) == atom ) 161 161 return it - wordBlk->values; 162 162 ++it; … … 232 232 while( it != end ) 233 233 { 234 if( it->word.atom== atom )234 if( orAtom(it) == atom ) 235 235 return it - wblk->values; 236 236 ++it; … … 264 264 // Word might be redefined mulitple times so we have to 265 265 // orLookup() first. 266 wrdN = orLookup( ctx, it->word.atom);266 wrdN = orLookup( ctx, orAtom(it) ); 267 267 if( wrdN < 0 ) 268 wrdN = orInternA( wordBlk, it->word.atom);268 wrdN = orInternA( wordBlk, orAtom(it) ); 269 269 } 270 270 ++it; … … 444 444 if( it->type == OT_SETWORD ) 445 445 { 446 if( orLookup( orig, it->word.atom) < 0 )446 if( orLookup( orig, orAtom(it) ) < 0 ) 447 447 ++wcount; 448 448 } … … 506 506 { 507 507 int wrdN; 508 wrdN = orLookup( ctx, val->word.atom);508 wrdN = orLookup( ctx, orAtom(val) ); 509 509 if( wrdN > -1 ) 510 510 { … … 571 571 (it->type == OT_GETWORD) ) 572 572 { 573 if( ( it->word.atom== orEnv->atom_func) ||574 ( it->word.atom== orEnv->atom_does) )573 if( (orAtom(it) == orEnv->atom_func) || 574 (orAtom(it) == orEnv->atom_does) ) 575 575 return 1; 576 576 } … … 681 681 vblk = orBlockPtr( ctx.wblkN ); 682 682 683 if( a1->type == OT_WORD)684 { 685 wrdN = orLookup( &ctx, a1->word.atom);683 if( orIs(a1, OT_WORD) ) 684 { 685 wrdN = orLookup( &ctx, orAtom(a1) ); 686 686 if( wrdN > -1 ) 687 687 { … … 689 689 } 690 690 } 691 else if( a1->type == OT_BLOCK)691 else if( orIs(a1, OT_BLOCK) ) 692 692 { 693 693 OBlock* blk = orBLOCK( a1 ); … … 696 696 while( it != end ) 697 697 { 698 if( it->type == OT_WORD)699 { 700 wrdN = orLookup( &ctx, a1->word.atom);698 if( orIs(it, OT_WORD) ) 699 { 700 wrdN = orLookup( &ctx, orAtom(a1) ); 701 701 if( wrdN > -1 ) 702 702 { … … 720 720 OIndex wrdN; 721 721 722 wrdN = orLookup( &a1->ctx, a2->word.atom);722 wrdN = orLookup( &a1->ctx, orAtom(a2) ); 723 723 if( wrdN < 0 ) 724 724 { … … 730 730 // a1->context remains unchanged. 731 731 a1->word.index = wrdN; 732 a1->word.atom = a2->word.atom;732 orAtom(a1) = orAtom(a2); 733 733 } 734 734 } … … 754 754 { 755 755 orMakeContext( &ctx, 1 ); 756 orInternA( orBlockPtr( ctx.wblkN ), a1->word.atom);756 orInternA( orBlockPtr( ctx.wblkN ), orAtom(a1) ); 757 757 } 758 758 else … … 770 770 { 771 771 if( it->type == OT_WORD ) 772 orInternA( blk, it->word.atom);772 orInternA( blk, orAtom(it) ); 773 773 ++it; 774 774 } … … 846 846 if( it->type == OT_WORD ) 847 847 { 848 orInternA( blk, it->word.atom);848 orInternA( blk, orAtom(it) ); 849 849 } 850 850 else … … 861 861 { 862 862 orMakeContext( &ctx, 1 ); 863 orInternA( orBlockPtr( ctx.wblkN ), a1->word.atom);863 orInternA( orBlockPtr( ctx.wblkN ), orAtom(a1) ); 864 864 } 865 865 … … 942 942 { 943 943 for( rlen = 0; rlen < vlen; ++rlen ) 944 (wval + rlen)->integer= str->charArray[ si++ ];944 orInt(wval + rlen) = str->charArray[ si++ ]; 945 945 946 946 orEvalBlock( orBlockPtr( body ), bi ); … … 956 956 while( si < str->used ) 957 957 { 958 wval->integer= str->charArray[ si++ ];958 orInt(wval) = str->charArray[ si++ ]; 959 959 ++wval; 960 960 } … … 1127 1127 { 1128 1128 orSetTF( val, OT_CHAR ); 1129 val->integer= str->charArray[ si ];1129 orInt(val) = str->charArray[ si ]; 1130 1130 } 1131 1131 else -
trunk/orca/error.c
r42 r54 68 68 OBlock* vblk = orBlockPtr( ctx.vblkN ); 69 69 val = vblk->values + wrd; 70 if( val->type == OT_OBJECT)70 if( orIs(val, OT_OBJECT) ) 71 71 { 72 72 ctx = val->ctx; 73 73 blk = 0; 74 74 } 75 else if( val->type == OT_BLOCK)75 else if( orIs(val, OT_BLOCK) ) 76 76 { 77 77 orGlobalCtx( ctx ); … … 111 111 void orDisarmNative( OValue* a1 ) 112 112 { 113 if( a1->type == OT_ERROR)113 if( orIs(a1, OT_ERROR) ) 114 114 { 115 115 OValue* val; … … 119 119 OT_WORD, orEnv->atom_error, 120 120 OR_LPATH_END ); 121 if( val && (val->type ==OT_OBJECT) )121 if( val && orIs(val, OT_OBJECT) ) 122 122 { 123 123 int errType; … … 155 155 OR_LPATH_END ); 156 156 ++val; 157 if( tval && tval->type == OT_BLOCK)157 if( tval && orIs(tval, OT_BLOCK) ) 158 158 { 159 159 OBlock* blk = orBLOCK(tval); … … 165 165 } 166 166 orSetTF( val, OT_INTEGER ); 167 val->integer= errType;167 orInt(val) = errType; 168 168 end_type: 169 169 … … 171 171 ++val; 172 172 orSetTF( val, OT_INTEGER ); 173 val->integer= a1->error.msg;173 orInt(val) = a1->error.msg; 174 174 */ 175 175 -
trunk/orca/gl/dlist.c
r43 r54 113 113 { 114 114 if( val->type == OT_DECIMAL ) 115 return (GLfloat) val->num.decimal;115 return (GLfloat) orDecimal(val); 116 116 else if( val->type == OT_INTEGER ) 117 return (GLfloat) val->integer;117 return (GLfloat) orInt(val); 118 118 return 0.0f; 119 119 } … … 132 132 else if( val->type == OT_DECIMAL ) 133 133 { 134 GLfloat f = (GLfloat) val->num.decimal;134 GLfloat f = (GLfloat) orDecimal(val); 135 135 pc[0].f = pc[1].f = pc[2].f = f; 136 136 } 137 137 else if( val->type == OT_INTEGER ) 138 138 { 139 GLfloat f = (GLfloat) val->integer;139 GLfloat f = (GLfloat) orInt(val); 140 140 pc[0].f = pc[1].f = pc[2].f = f; 141 141 } … … 238 238 pc = ((RenderWord*) prog->buf) + prog->used; 239 239 240 switch( match->integer)240 switch( orInt(match) ) 241 241 { 242 242 case DLP_CALL_INT: … … 508 508 return; 509 509 } 510 key = a1->integer;510 key = orInt(a1); 511 511 } 512 512 else … … 573 573 { 574 574 case PRIM_KEY_VERTEX: 575 vindex = idx->integer* 3;575 vindex = orInt(idx) * 3; 576 576 getVector( 3, gEnv.state.vertVals + vindex, vec ); 577 577 glVertex3dv( vec ); … … 580 580 581 581 case PRIM_KEY_NORMAL: 582 vindex = idx->integer* 3;582 vindex = orInt(idx) * 3; 583 583 getVector( 3, gEnv.state.normVals + vindex, vec ); 584 584 glNormal3dv( vec ); … … 588 588 case PRIM_KEY_COLOR: 589 589 { 590 OValue* cval = gEnv.state.colorVals + idx->integer;590 OValue* cval = gEnv.state.colorVals + orInt(idx); 591 591 if( orIs(cval, OT_TUPLE) ) 592 592 { … … 600 600 601 601 case PRIM_KEY_UV0: 602 vindex = idx->integer* 2;602 vindex = orInt(idx) * 2; 603 603 getVector( 2, gEnv.state.uvVals + vindex, vec ); 604 604 //printf( "KR UV0 %g %g\n", vec[0], vec[1] ); -
trunk/orca/gl/gx.c
r42 r54 325 325 { 326 326 if( val->type == OT_DECIMAL ) 327 *vec++ = val->num.decimal;327 *vec++ = orDecimal(val); 328 328 else if( val->type == OT_INTEGER ) 329 *vec++ = (GLdouble) val->integer;329 *vec++ = (GLdouble) orInt(val); 330 330 else 331 331 *vec++ = 0.0; … … 704 704 if( a1->type == OT_INTEGER ) 705 705 { 706 glCallList( a1->integer);706 glCallList( orInt(a1) ); 707 707 } 708 708 else 709 709 { 710 DrawListResource* res = gxDList( a1->integer);710 DrawListResource* res = gxDList( orInt(a1) ); 711 711 if( res && res->prog ) 712 712 gxRunRenderProgram( res->prog ); … … 736 736 else 737 737 { 738 mode.id = a1->integer;738 mode.id = orInt(a1); 739 739 mode.width = 0; 740 740 mode.height = 0; … … 832 832 if( it->type == OT_WORD ) 833 833 { 834 cp = orAtomCString( it->word.atom);834 cp = orAtomCString( orAtom(it) ); 835 835 strLen = 0; 836 836 while( cp[ strLen ] ) … … 840 840 else if( it->type == OT_CHAR ) 841 841 { 842 ch = it->integer;842 ch = orInt(it); 843 843 if( ! ch ) 844 844 ch = -1; … … 1115 1115 { 1116 1116 if( val->type == OT_INTEGER ) 1117 *dim = (double) val->integer;1117 *dim = (double) orInt(val); 1118 1118 else if( val->type == OT_DECIMAL ) 1119 *dim = val->num.decimal;1119 *dim = orDecimal(val); 1120 1120 else 1121 1121 { … … 1134 1134 #define toDecimal(idx,dim) \ 1135 1135 if( val->type == OT_DECIMAL ) \ 1136 num[idx] = val->num.decimal* dim; \1136 num[idx] = orDecimal(val) * dim; \ 1137 1137 else if( val->type == OT_INTEGER ) \ 1138 num[idx] = (double) val->integer; \1138 num[idx] = (double) orInt(val); \ 1139 1139 else return 0; 1140 1140 … … 1268 1268 if( a1->type == OT_WORD ) 1269 1269 { 1270 if( a1->word.atom== gEnv.atom_model )1270 if( orAtom(a1) == gEnv.atom_model ) 1271 1271 { 1272 1272 gxStateModel(); 1273 1273 } 1274 else if( a1->word.atom== gEnv.atom_solid )1274 else if( orAtom(a1) == gEnv.atom_solid ) 1275 1275 { 1276 1276 gxStateSolid(); … … 1389 1389 { 1390 1390 if( it->type == OT_DECIMAL ) 1391 *pf += (float) it->num.decimal;1391 *pf += (float) orDecimal(it); 1392 1392 else if( it->type == OT_INTEGER ) 1393 *pf += (float) it->integer;1393 *pf += (float) orInt(it); 1394 1394 1395 1395 ++pf; … … 1412 1412 1413 1413 if( a3->type == OT_DECIMAL ) 1414 angle = a3->num.decimal;1414 angle = orDecimal(a3); 1415 1415 else if( a3->type == OT_INTEGER ) 1416 angle = (double) a3->integer;1416 angle = (double) orInt(a3); 1417 1417 else 1418 1418 angle = 0.0; … … 1429 1429 void keyRepeatNative( OValue* a1 ) 1430 1430 { 1431 glv_filterRepeatKeys( gView, a1->integer);1431 glv_filterRepeatKeys( gView, orInt(a1) ); 1432 1432 } 1433 1433 … … 1554 1554 1555 1555 if( a1->type == OT_INTEGER ) 1556 key = a1->integer;1556 key = orInt(a1); 1557 1557 else 1558 1558 key = gxHashString(a1); … … 1579 1579 1580 1580 if( a1->type == OT_INTEGER ) 1581 id = a1->integer;1581 id = orInt(a1); 1582 1582 else if( a1->type == OT_WORD ) 1583 id = a1->word.atom;1583 id = orAtom(a1); 1584 1584 1585 1585 if( orRefineSet(REF_RG_FREE) ) -
trunk/orca/gl/joystick.c
r1 r54 70 70 val = cblk->values + JV_FD; 71 71 orSetTF( val, OT_INTEGER ); 72 val->integer= fd;72 orInt(val) = fd; 73 73 74 74 i = orMakeCString( name, -1 ); … … 79 79 val = cblk->values + JV_AXIS_COUNT; 80 80 orSetTF( val, OT_INTEGER ); 81 val->integer= axes;81 orInt(val) = axes; 82 82 83 83 val = cblk->values + JV_BTN_COUNT; 84 84 orSetTF( val, OT_INTEGER ); 85 val->integer= buttons;85 orInt(val) = buttons; 86 86 87 87 blk = orMakeBlock( axes + buttons ); … … 92 92 { 93 93 orSetTF( val, OT_INTEGER ); 94 val->integer= 0;94 orInt(val) = 0; 95 95 ++val; 96 96 } … … 119 119 if( orIs( val, OT_INTEGER ) ) 120 120 { 121 fd = val->integer;121 fd = orInt(val); 122 122 if( fd > -1 ) 123 123 { … … 141 141 val = vblk->values + JV_FD; 142 142 143 if( orIs( val, OT_INTEGER ) && ( val->integer> -1) )143 if( orIs( val, OT_INTEGER ) && (orInt(val) > -1) ) 144 144 { 145 145 int axes; … … 148 148 OBlock* blk; 149 149 150 fd = val->integer;150 fd = orInt(val); 151 151 152 152 val = vblk->values + JV_AXIS_COUNT; 153 axes = val->integer;153 axes = orInt(val); 154 154 155 155 val = vblk->values + JV_INPUT; -
trunk/orca/gl/ttf_load.c
r37 r54 636 636 tf = &res->tfont; 637 637 638 psize = (a1 + 2)->integer;638 psize = orInt(a1 + 2); 639 639 if( psize < 1 ) 640 640 psize = 20; … … 657 657 if( arg->type == OT_INTEGER ) 658 658 { 659 tf->tex_width = arg->integer;660 tf->tex_height = arg->integer;659 tf->tex_width = orInt(arg); 660 tf->tex_height = orInt(arg); 661 661 } 662 662 else -
trunk/orca/math.c
r42 r54 42 42 double n; \ 43 43 if( a1->type == OT_DECIMAL ) { \ 44 n = a1->num.decimal; \44 n = orDecimal(a1); \ 45 45 } else { \ 46 n = (double) a1->integer; \46 n = (double) orInt(a1); \ 47 47 orSetTF( a1, OT_DECIMAL ); \ 48 48 } \ 49 49 if( orRefineSet(REF_RADIANS) ) \ 50 a1->num.decimal= func( n ); \50 orDecimal(a1) = func( n ); \ 51 51 else \ 52 a1->num.decimal= func( DEG_TO_RAD * n );52 orDecimal(a1) = func( DEG_TO_RAD * n ); 53 53 54 54 … … 94 94 if( a1->type == OT_DECIMAL ) 95 95 { 96 n = a1->num.decimal;96 n = orDecimal(a1); 97 97 } 98 98 else 99 99 { 100 n = (double) a1->integer;100 n = (double) orInt(a1); 101 101 orSetTF( a1, OT_DECIMAL ); 102 102 } 103 a1->num.decimal= mathSqrt( n );103 orDecimal(a1) = mathSqrt( n ); 104 104 } 105 105 … … 114 114 { 115 115 unsigned long seed; 116
