Changeset 427 for branches/thune/thread_safe/eval.c
- Timestamp:
- 07/07/07 04:41:31 (17 months ago)
- Files:
-
- 1 modified
-
branches/thune/thread_safe/eval.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/eval.c
r426 r427 24 24 25 25 26 extern UContext ur_ global;26 extern UContext ur_thrGlobal; 27 27 extern UContext ur_envGlobal; 28 28 … … 66 66 int wrdN; 67 67 68 global = (ut->env->blocks.arr.used) ? &ur_envGlobal : &ur_ global;68 global = (ut->env->blocks.arr.used) ? &ur_envGlobal : &ur_thrGlobal; 69 69 70 70 wrdN = ur_lookup( global, UR_ATOM_KERNEL_OPS ); … … 358 358 359 359 360 #define _throwUnset(th,cell) _throwUnsetF(th,cell," unset")361 #define _throwUnbound(th,cell) _throwUnsetF(th,cell," unbound")360 #define _throwUnset(th,cell) _throwUnsetF(th,cell,"is unset") 361 #define _throwUnbound(th,cell) _throwUnsetF(th,cell,"is unbound") 362 362 363 363 static void _throwUnsetF( UThread* ut, const UCell* wcell, const char* umsg ) … … 368 368 ur_atomStr( ur_atom(wcell), str ); 369 369 ur_termCStr( str ); 370 ur_throwErr( UR_ERR_SCRIPT, "word '%s is%s", str->ptr.c, umsg );370 ur_throwErr( UR_ERR_SCRIPT, "word '%s %s", str->ptr.c, umsg ); 371 371 } 372 372 … … 413 413 ++it; 414 414 } 415 _throwUnsetF( ut, pc, " out-of-scope local" );415 _throwUnsetF( ut, pc, "is out-of-scope local" ); 416 416 return 0; 417 417 } … … 419 419 if( pc->word.wordBlk != ut->localWordBlk ) 420 420 { 421 _throwUnsetF( ut, pc, " out-of-scope local" );421 _throwUnsetF( ut, pc, "is out-of-scope local" ); 422 422 return 0; 423 423 } … … 431 431 } 432 432 433 _throwUnsetF( ut, pc, " Invalid bind mask" );433 _throwUnsetF( ut, pc, "has invalid bind mask" ); 434 434 return 0; 435 435 } … … 452 452 { 453 453 case UR_BIND_THREAD: 454 // ur_blockPtr( pc->word.valBlk ) 455 blk = (((UBlock*) ut->blocks.arr.ptr.v) + pc->word.valBlk); 454 blk = tBlockPtr( pc->word.valBlk ); 456 455 dest = blk->ptr.cells + wrdN; 457 456 break; 458 457 459 458 case UR_BIND_GLOBAL: 460 // ur_blockPtr( pc->word.valBlk ) 461 blk = (((UBlock*) ut->env->blocks.arr.ptr.v) - pc->word.valBlk); 462 dest = blk->ptr.cells + wrdN; 463 break; 459 _throwUnsetF( ut, pc, "is in shared global storage" ); 460 return 0; 464 461 465 462 case UR_BIND_LOCAL: … … 476 473 ++it; 477 474 } 478 _throwUnsetF( ut, pc, " out-of-scope local" );475 _throwUnsetF( ut, pc, "is out-of-scope local" ); 479 476 return 0; 480 477 } … … 482 479 #ifdef UR_CONFIG_DATAFLOW 483 480 case UR_BIND_PLUG: 484 // Assuming there are no global components.481 // Using tBlockPtr - assuming there are no global components. 485 482 ur_setPlug( ut, tBlockPtr(pc->word.valBlk), wrdN, val ); 486 483 return 1; … … 488 485 489 486 default: 490 _throwUnsetF( ut, pc, " Invalid bind mask" );487 _throwUnsetF( ut, pc, "has invalid bind mask" ); 491 488 return 0; 492 489 } … … 520 517 if( end != cmd ) 521 518 { 522 blkN = ur_tokenize( ut, cmd, end , 0);519 blkN = ur_tokenize( ut, cmd, end ); 523 520 if( blkN ) 524 521 { … … 984 981 if( tos->word.valBlk == BLK_GLOBAL_VAL ) 985 982 { 986 tos->word.index = ur_internWord( &ur_ global, ur_atom(tos) );983 tos->word.index = ur_internWord( &ur_thrGlobal, ur_atom(tos) ); 987 984 } 988 985 else
