removed unnecessary code in some initialization code.
added errnum to some open functions
This commit is contained in:
@ -1146,7 +1146,7 @@ int Awk::open ()
|
||||
|
||||
qse_awk_errnum_t errnum;
|
||||
this->awk = qse_awk_open (this->getMmgr(), QSE_SIZEOF(xtn_t), &prm, &errnum);
|
||||
if (this->awk == QSE_NULL)
|
||||
if (!this->awk)
|
||||
{
|
||||
this->setError (errnum);
|
||||
return -1;
|
||||
|
@ -94,7 +94,7 @@ static int fnc_file_to_file (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||
|
||||
/* result = sed::file_to_file ("s/ABC/123/g", input_file, output_file [, option_string]) */
|
||||
|
||||
sed = qse_sed_openstdwithmmgr (qse_awk_rtx_getmmgr(rtx), 0);
|
||||
sed = qse_sed_openstdwithmmgr (qse_awk_rtx_getmmgr(rtx), 0, QSE_NULL);
|
||||
if (sed == QSE_NULL)
|
||||
{
|
||||
ret = -2;
|
||||
@ -150,7 +150,7 @@ static int fnc_str_to_str (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
|
||||
qse_cstr_t outstr;
|
||||
int i = 0, ret = 0, n;
|
||||
|
||||
sed = qse_sed_openstdwithmmgr (qse_awk_rtx_getmmgr(rtx), 0);
|
||||
sed = qse_sed_openstdwithmmgr (qse_awk_rtx_getmmgr(rtx), 0, QSE_NULL);
|
||||
if (sed == QSE_NULL)
|
||||
{
|
||||
ret = -2;
|
||||
|
@ -454,7 +454,8 @@ qse_awk_t* qse_awk_openstdwithmmgr (qse_mmgr_t* mmgr, qse_size_t xtnsize, qse_aw
|
||||
|
||||
/* initialize extension */
|
||||
xtn = (xtn_t*) QSE_XTN (awk);
|
||||
QSE_MEMSET (xtn, 0, QSE_SIZEOF(*xtn));
|
||||
/* the extension area has been cleared in qse_awk_open().
|
||||
* QSE_MEMSET (xtn, 0, QSE_SIZEOF(*xtn));*/
|
||||
|
||||
/* add intrinsic global variables and functions */
|
||||
if (add_globals(awk) <= -1 ||
|
||||
|
Reference in New Issue
Block a user