more use of MOO_STORE_OOP

This commit is contained in:
hyunghwan.chung 2018-12-23 16:54:17 +00:00
parent 3e623c6677
commit e97ca41d8c
2 changed files with 8 additions and 8 deletions

View File

@ -116,7 +116,7 @@ static moo_oop_association_t find_or_upsert (moo_t* moo, moo_oop_dic_t dic, moo_
moo_equal_oochars(MOO_OBJ_GET_CHAR_SLOT(key), MOO_OBJ_GET_CHAR_SLOT(ass->key), MOO_OBJ_GET_SIZE(key)))
{
/* the value of MOO_NULL indicates no insertion or update. */
if (value) MOO_STORE_OOP (moo, &ass->value, value); /*ass->value = value;*/ /* update */
if (value) MOO_STORE_OOP (moo, &ass->value, value); /* update */
return ass;
}
@ -165,7 +165,7 @@ static moo_oop_association_t find_or_upsert (moo_t* moo, moo_oop_dic_t dic, moo_
bucket = expand_bucket(moo, dic->bucket);
if (!bucket) goto oops;
dic->bucket = bucket;
MOO_STORE_OOP (moo, &dic->bucket, bucket);
/* recalculate the index for the expanded bucket */
index = hv % MOO_OBJ_GET_SIZE(dic->bucket);
@ -179,8 +179,8 @@ static moo_oop_association_t find_or_upsert (moo_t* moo, moo_oop_dic_t dic, moo_
ass = (moo_oop_association_t)moo_instantiate(moo, moo->_association, MOO_NULL, 0);
if (!ass) goto oops;
MOO_STORE_OOP (moo, &ass->key, (moo_oop_t)key); /*ass->key = (moo_oop_t)key; */
MOO_STORE_OOP (moo, &ass->value, value); /*ass->value = value;*/
MOO_STORE_OOP (moo, &ass->key, (moo_oop_t)key);
MOO_STORE_OOP (moo, &ass->value, value);
/* the current tally must be less than the maximum value. otherwise,
* it overflows after increment below */

View File

@ -333,8 +333,8 @@ static moo_oop_process_t make_process (moo_t* moo, moo_oop_context_t c)
/* assign a process id to the process */
alloc_pid (moo, proc);
proc->initial_context = c;
proc->current_context = c;
MOO_STORE_OOP (moo, (moo_oop_t*)&proc->initial_context, (moo_oop_t)c);
MOO_STORE_OOP (moo, (moo_oop_t*)&proc->current_context, (moo_oop_t)c);
proc->sp = MOO_SMOOI_TO_OOP(-1);
proc->perr = MOO_ERROR_TO_OOP(MOO_ENOERR);
proc->perrmsg = moo->_nil;
@ -369,7 +369,7 @@ static MOO_INLINE void sleep_active_process (moo_t* moo, int state)
MOO_LOG3 (moo, MOO_LOG_IC | MOO_LOG_DEBUG, "Processor - process[%zd] %hs->%hs in sleep_active_process\n", MOO_OOP_TO_SMOOI(moo->processor->active->id), proc_state_to_string(MOO_OOP_TO_SMOOI(moo->processor->active->state)), proc_state_to_string(state));
#endif
moo->processor->active->current_context = moo->active_context;
MOO_STORE_OOP (moo, (moo_oop_t*)&moo->processor->active->current_context, (moo_oop_t)moo->active_context);
moo->processor->active->state = MOO_SMOOI_TO_OOP(state);
}
@ -382,7 +382,7 @@ static MOO_INLINE void wake_process (moo_t* moo, moo_oop_process_t proc)
MOO_ASSERT (moo, proc->state == MOO_SMOOI_TO_OOP(PROC_STATE_RUNNABLE));
proc->state = MOO_SMOOI_TO_OOP(PROC_STATE_RUNNING);
moo->processor->active = proc;
MOO_STORE_OOP (moo, (moo_oop_t*)&moo->processor->active, (moo_oop_t)proc);
/* load the stack pointer from 'proc'.
* moo->processor->active points to 'proc' now. */