diff --git a/ase/awk/awk.h b/ase/awk/awk.h index ccc1975f..da3d7e3f 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.209 2007-03-10 15:29:54 bacon Exp $ + * $Id: awk.h,v 1.210 2007-03-10 15:32:54 bacon Exp $ * * {License} */ @@ -469,10 +469,6 @@ void ase_awk_setrunerror ( ase_awk_run_t* run, int errnum, ase_size_t errlin, const ase_cstr_t* errarg, ase_size_t argcnt); -void ase_awk_setrunerror_old ( - ase_awk_run_t* run, int errnum, - ase_size_t errlin, const ase_char_t* msg); - /* functions to manipulate built-in functions */ void* ase_awk_addbfn ( ase_awk_t* awk, const ase_char_t* name, ase_size_t name_len, diff --git a/ase/awk/err.c b/ase/awk/err.c index adee863e..ced50a3a 100644 --- a/ase/awk/err.c +++ b/ase/awk/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.93 2007-03-10 15:29:54 bacon Exp $ + * $Id: err.c,v 1.94 2007-03-10 15:32:54 bacon Exp $ * * {License} */ @@ -469,17 +469,3 @@ void ase_awk_setrunerror ( return; } } - -void ase_awk_setrunerror_old ( - ase_awk_run_t* run, int errnum, - ase_size_t errlin, const ase_char_t* errmsg) -{ - run->errnum = errnum; - run->errlin = errlin; - - if (errmsg == ASE_NULL) run->errmsg[0] = ASE_T('\0'); - else if (errmsg != run->errmsg) - { - ase_strxcpy (run->errmsg, ASE_COUNTOF(run->errmsg), errmsg); - } -} diff --git a/ase/awk/jni.c b/ase/awk/jni.c index 81bf562e..879c96b4 100644 --- a/ase/awk/jni.c +++ b/ase/awk/jni.c @@ -1,5 +1,5 @@ /* - * $Id: jni.c,v 1.72 2007-03-06 14:51:52 bacon Exp $ + * $Id: jni.c,v 1.73 2007-03-10 15:32:54 bacon Exp $ * * {License} */ @@ -1354,7 +1354,6 @@ static int __handle_bfn ( jobjectArray args; jobject arg, ret; ase_awk_val_t* v; - ase_char_t msg_nomem[MSG_SIZE]; ase_awk_t* awk; run_data = ase_awk_getruncustomdata (run); @@ -1364,19 +1363,13 @@ static int __handle_bfn ( env = run_data->env; obj = run_data->obj; - ase_sprintf ( - msg_nomem, ASE_COUNTOF(msg_nomem), - ASE_T("out of memory in handling %.*s"), - fnl, fnm); - if (fnl > 0 && ASE_SIZEOF(jchar) != ASE_SIZEOF(ase_char_t)) { ase_size_t i; jchar* tmp = (jchar*) malloc (ASE_SIZEOF(jchar)*fnl); if (tmp == NULL) { - ase_awk_setrunerror_old ( - run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1393,14 +1386,14 @@ static int __handle_bfn ( { if (is_debug(awk)) (*env)->ExceptionDescribe (env); (*env)->ExceptionClear (env); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } name_utf = (*env)->GetStringUTFChars (env, name, JNI_FALSE); if (name_utf == NULL) { (*env)->DeleteLocalRef (env, name); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1427,7 +1420,7 @@ static int __handle_bfn ( { if (is_debug(awk)) (*env)->ExceptionDescribe (env); (*env)->ExceptionClear (env); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1467,7 +1460,7 @@ static int __handle_bfn ( if (tmp == NULL) { (*env)->DeleteLocalRef (env, args); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1494,7 +1487,7 @@ static int __handle_bfn ( (*env)->ExceptionClear (env); } (*env)->DeleteLocalRef (env, args); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1529,7 +1522,7 @@ static int __handle_bfn ( if (v == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1545,7 +1538,7 @@ static int __handle_bfn ( if (v == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1561,7 +1554,7 @@ static int __handle_bfn ( if (v == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1576,7 +1569,7 @@ static int __handle_bfn ( if (v == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1591,7 +1584,7 @@ static int __handle_bfn ( if (v == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1608,7 +1601,7 @@ static int __handle_bfn ( if (ptr == NULL) { (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1621,7 +1614,7 @@ static int __handle_bfn ( { (*env)->ReleaseStringChars (env, ret, ptr); (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; } @@ -1638,7 +1631,7 @@ static int __handle_bfn ( { (*env)->ReleaseStringChars (env, ret, ptr); (*env)->DeleteLocalRef (env, ret); - ase_awk_setrunerror_old (run, ASE_AWK_ENOMEM, 0, msg_nomem); + ase_awk_setrunerrnum (run, ASE_AWK_ENOMEM); return -1; }