Recovered from cvs revision 2007-11-01 14:01:00

This commit is contained in:
hyung-hwan 2007-11-01 23:01:00 +00:00
parent 1debaa5302
commit e28846adff
4 changed files with 30 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: func.c,v 1.13 2007/10/25 14:43:17 bacon Exp $ * $Id: func.c,v 1.14 2007/10/31 13:56:54 bacon Exp $
* *
* {License} * {License}
*/ */
@ -254,7 +254,7 @@ skip_close:
return 0; return 0;
} }
static int __flush_extio ( static int flush_extio (
ase_awk_run_t* run, int extio, const ase_char_t* name, int n) ase_awk_run_t* run, int extio, const ase_char_t* name, int n)
{ {
int n2; int n2;
@ -337,15 +337,15 @@ static int bfn_fflush (
} }
/* flush the given extio */ /* flush the given extio */
n = __flush_extio ( n = flush_extio (
run, ASE_AWK_EXTIO_FILE, run, ASE_AWK_EXTIO_FILE,
((len0 == 0)? ASE_NULL: str0), 1); ((len0 == 0)? ASE_NULL: str0), 1);
/*if (n == -99) return -1;*/ /*if (n == -99) return -1;*/
n = __flush_extio ( n = flush_extio (
run, ASE_AWK_EXTIO_PIPE, run, ASE_AWK_EXTIO_PIPE,
((len0 == 0)? ASE_NULL: str0), n); ((len0 == 0)? ASE_NULL: str0), n);
/*if (n == -99) return -1;*/ /*if (n == -99) return -1;*/
n = __flush_extio ( n = flush_extio (
run, ASE_AWK_EXTIO_COPROC, run, ASE_AWK_EXTIO_COPROC,
((len0 == 0)? ASE_NULL: str0), n); ((len0 == 0)? ASE_NULL: str0), n);
/*if (n == -99) return -1;*/ /*if (n == -99) return -1;*/

View File

@ -1,5 +1,5 @@
/* /*
* $Id: jni.c,v 1.42 2007/10/30 15:01:31 bacon Exp $ * $Id: jni.c,v 1.43 2007/10/31 13:56:54 bacon Exp $
* *
* {License} * {License}
*/ */
@ -1816,7 +1816,6 @@ static int handle_bfn (
(*env)->CallVoidMethod (env, run_data->context_object, run_data->context_clear); (*env)->CallVoidMethod (env, run_data->context_object, run_data->context_clear);
if ((*env)->ExceptionCheck(env)) if ((*env)->ExceptionCheck(env))
{ {
/* TODO #1: if exception is thrown in clear, it seems to end with a lot of memory leask. PLEASE CHECK THIS */
if (is_debug(awk)) (*env)->ExceptionDescribe (env); if (is_debug(awk)) (*env)->ExceptionDescribe (env);
(*env)->ExceptionClear (env); (*env)->ExceptionClear (env);
ase_awk_setrunerrnum (run, ASE_AWK_EBFNIMPL); ase_awk_setrunerrnum (run, ASE_AWK_EBFNIMPL);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.20 2007/10/28 06:12:37 bacon Exp $ * $Id: run.c,v 1.21 2007/10/31 13:56:54 bacon Exp $
* *
* {License} * {License}
*/ */
@ -5502,13 +5502,25 @@ static ase_awk_val_t* eval_call (
ase_dprintf (ASE_T("got return value\n")); ase_dprintf (ASE_T("got return value\n"));
#endif #endif
v = STACK_RETVAL(run);
if (n == -1)
{
/* if the earlier operations failed and this function
* has to return a error, the return value is just
* destroyed and replaced by nil */
ase_awk_refdownval (run, v);
STACK_RETVAL(run) = ase_awk_val_nil;
}
else
{
/* this trick has been mentioned in run_return. /* this trick has been mentioned in run_return.
* adjust the reference count of the return value. * adjust the reference count of the return value.
* the value must not be freed even if the reference count * the value must not be freed even if the reference count
* is decremented to zero because its reference has been incremented * reached zero because its reference has been incremented
* in run_return regardless of its reference count. */ * in run_return or directly by ase_awk_setretval
v = STACK_RETVAL(run); * regardless of its reference count. */
ase_awk_refdownval_nofree (run, v); ase_awk_refdownval_nofree (run, v);
}
run->stack_top = (ase_size_t)run->stack[run->stack_base+1]; run->stack_top = (ase_size_t)run->stack[run->stack_base+1];
run->stack_base = (ase_size_t)run->stack[run->stack_base+0]; run->stack_base = (ase_size_t)run->stack[run->stack_base+0];

View File

@ -1,5 +1,5 @@
/* /*
* $Id: AseAwkPanel.java,v 1.15 2007/10/30 15:01:31 bacon Exp $ * $Id: AseAwkPanel.java,v 1.16 2007/10/31 13:56:54 bacon Exp $
*/ */
import java.awt.*; import java.awt.*;
@ -107,8 +107,8 @@ public class AseAwkPanel extends Panel
//ret.setIntValue (0); //ret.setIntValue (0);
// //
ret.setIndexedRealValue (1, 111.23); ret.setIndexedRealValue (1, 111.23);
ret.setIndexedStringValue (2, "kdk2kd"); ret.setIndexedStringValue (2, "1111111");
ret.setIndexedStringValue (3, "3dk3kd"); ret.setIndexedStringValue (3, "22222222");
ret.setIndexedIntValue (4, 444); ret.setIndexedIntValue (4, 444);
ret.setIndexedIntValue (5, 55555); ret.setIndexedIntValue (5, 55555);
@ -117,7 +117,8 @@ public class AseAwkPanel extends Panel
Return r2 = new Return (ctx); Return r2 = new Return (ctx);
r.setStringValue ("[[%.6f]]"); r.setStringValue ("[[%.6f]]");
ctx.setGlobal (Context.GLOBAL_CONVFMT, ret); //ctx.setGlobal (Context.GLOBAL_CONVFMT, ret);
ctx.setGlobal (Context.GLOBAL_CONVFMT, r2);
} }
protected int openSource (int mode) protected int openSource (int mode)