Skip to content

Commit

Permalink
remove variable shadowing in emit and vm
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Oct 24, 2023
1 parent d8c37aa commit fc2ef40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/core/chuck_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,15 +1886,15 @@ t_CKBOOL emit_engine_emit_exp( Chuck_Emitter * emit, a_Exp exp, t_CKBOOL doAddRe
if( isobj( emit->env, exp->func_call.ret_type ) )
{
// the return needs to be released (later at the end of the stmt that contains this)
Chuck_Instr_Stmt_Start * start = emit->stmt_stack.size() ? emit->stmt_stack.back() : NULL;
Chuck_Instr_Stmt_Start * onStack = emit->stmt_stack.size() ? emit->stmt_stack.back() : NULL;
// check it
if( start )
if( onStack )
{
t_CKUINT offset = 0;
// acquire next offset
if( !start->nextOffset( offset ) ) return FALSE;
if( !onStack->nextOffset( offset ) ) return FALSE;
// append instruction
emit->append( new Chuck_Instr_Stmt_Remember_Object( start, offset ) );
emit->append( new Chuck_Instr_Stmt_Remember_Object( onStack, offset ) );
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/core/chuck_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,12 +1488,12 @@ static void ckvm_process_watcher( t_CKBOOL add, list<Chuck_VM_Shreds_Watcher> &
// name: subscribe_watcher() | 1.5.1.5
// desc: subscribe shreds watcher callback
//-----------------------------------------------------------------------------
void Chuck_VM::subscribe_watcher( f_shreds_watcher cb, t_CKUINT options, void * data )
void Chuck_VM::subscribe_watcher( f_shreds_watcher cb, t_CKUINT options, void * userdata )
{
// check
if( !cb ) return;
// watcher bundle
Chuck_VM_Shreds_Watcher w( cb, data );
Chuck_VM_Shreds_Watcher w( cb, userdata );
// check options and subscribe the watcher
ckvm_process_watcher( options & CKVM_SHREDS_WATCH_SPORK, m_shreds_watchers_spork, w );
ckvm_process_watcher( options & CKVM_SHREDS_WATCH_REMOVE, m_shreds_watchers_remove, w );
Expand Down
2 changes: 1 addition & 1 deletion src/core/chuck_vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ struct Chuck_VM : public Chuck_Object

public:
// subscribe shreds watcher callback | 1.5.1.5
void subscribe_watcher( f_shreds_watcher cb, t_CKUINT options, void * data = NULL );
void subscribe_watcher( f_shreds_watcher cb, t_CKUINT options, void * userdata = NULL );
// notify watchers | 1.5.1.5
void notify_watchers( ckvmShredsWatcherFlag which, Chuck_VM_Shred * shred,
std::list<Chuck_VM_Shreds_Watcher> & v );
Expand Down

0 comments on commit fc2ef40

Please sign in to comment.