From 1bd41fc6c048cb65d0eed15ebda346cc80d93cea Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Tue, 3 Sep 2019 07:03:42 +0000 Subject: [PATCH] move a variable declartion to the top of a block --- moo/lib/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moo/lib/exec.c b/moo/lib/exec.c index a29050f..d827768 100644 --- a/moo/lib/exec.c +++ b/moo/lib/exec.c @@ -3009,6 +3009,8 @@ static moo_pfrc_t pf_semaphore_unsignal (moo_t* moo, moo_mod_t* mod, moo_ooi_t n } else if (sem->subtype == MOO_SMOOI_TO_OOP(MOO_SEMAPHORE_SUBTYPE_IO)) { + moo_oop_process_t wp; /* waiting process */ + /* the semaphore is associated with IO */ MOO_ASSERT (moo, MOO_OOP_IS_SMOOI(sem->u.io.index) && MOO_OOP_TO_SMOOI(sem->u.io.index) >= 0); MOO_ASSERT (moo, MOO_OOP_IS_SMOOI(sem->u.io.type)); @@ -3029,7 +3031,6 @@ static moo_pfrc_t pf_semaphore_unsignal (moo_t* moo, moo_mod_t* mod, moo_ooi_t n * waiting on this IO semaphore, the process now is treated * as if it's waiting on a plain semaphore. let's adjust * the number of processes waiting on IO semaphores */ - moo_oop_process_t wp; /* waiting process */ for (wp = sem->waiting.first; (moo_oop_t)wp != moo->_nil; wp = wp->sem_wait.next) { MOO_ASSERT (moo, moo->sem_io_wait_count > 0);