minor code touch-up again

This commit is contained in:
hyung-hwan 2020-04-17 17:19:34 +00:00
parent 53b76934d9
commit 3bae71b21f
3 changed files with 15 additions and 14 deletions

View File

@ -1047,6 +1047,7 @@ int Hawk::Value::setIndexedStr (const Index& idx, const hawk_bch_t* str, bool nu
int Hawk::Value::setIndexedStr (Run* r, const Index& idx, const hawk_bch_t* str, bool numeric)
{
hawk_val_t* tmp;
tmp = numeric? hawk_rtx_makenumorstrvalwithbchars(r->rtx, str, hawk_count_bcstr(str)):
hawk_rtx_makestrvalwithbcstr(r->rtx, str);
if (HAWK_UNLIKELY(!tmp))
@ -1823,17 +1824,17 @@ int Hawk::init_runctx ()
rio.console = consoleHandler;
hawk_rtx_t* rtx = hawk_rtx_open(this->hawk, HAWK_SIZEOF(rxtn_t), &rio);
if (rtx == HAWK_NULL)
if (HAWK_UNLIKELY(!rtx))
{
this->retrieveError();
return -1;
}
rtx->_instsize += HAWK_SIZEOF(rxtn_t);
runctx.rtx = rtx;
this->runctx.rtx = rtx;
rxtn_t* rxtn = GET_RXTN(rtx);
rxtn->run = &runctx;
rxtn->run = &this->runctx;
return 0;
}

View File

@ -1336,7 +1336,7 @@ public:
///
const Hawk::Run* getRunContext () const
{
return &runctx;
return &this->runctx;
}
///
@ -1348,7 +1348,7 @@ public:
///
Hawk::Run* getRunContext ()
{
return &runctx;
return &this->runctx;
}
///

View File

@ -132,7 +132,7 @@ static hawk_sio_t* open_sio_std (Hawk* hawk, HawkStd::Run* run, hawk_sio_std_t s
int HawkStd::open ()
{
int n = Hawk::open();
if (n == -1) return n;
if (HAWK_UNLIKELY(n <= -1)) return n;
this->gbl_argc = this->addGlobal(HAWK_T("ARGC"));
this->gbl_argv = this->addGlobal(HAWK_T("ARGV"));