From e07442036a7b4770addcbda2b5241ce20389bc7c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 16 Nov 2006 04:44:16 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/awk.h | 7 ++++--- ase/awk/err.c | 15 ++++++++------- ase/awk/run.c | 28 +++++++++++++--------------- ase/awk/val.c | 4 ++-- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ase/awk/awk.h b/ase/awk/awk.h index e4b590c7..d97c62eb 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.140 2006-11-13 09:02:22 bacon Exp $ + * $Id: awk.h,v 1.141 2006-11-16 04:44:15 bacon Exp $ */ #ifndef _ASE_AWK_AWK_H_ @@ -271,9 +271,9 @@ enum ASE_AWK_ENEXTFILE, /* nextfile illegal in BEGIN or END block */ ASE_AWK_EGETLINE, /* getline expected */ ASE_AWK_EPRINTFARG, /* printf must have one or more arguments */ - ASE_AWK_EFMTSEQ, /* wrong formatting sequence */ /* run time error */ + ASE_AWK_EINTERNAL, /* internal error */ ASE_AWK_EDIVBYZERO, /* divide by zero */ ASE_AWK_EOPERAND, /* invalid operand */ ASE_AWK_EPOSIDX, /* wrong position index */ @@ -294,7 +294,8 @@ enum ASE_AWK_EIOIMPL, /* wrong implementation of user io handler */ ASE_AWK_ENOSUCHIO, /* no such io name found */ ASE_AWK_EIOHANDLER, /* io handler has returned an error */ - ASE_AWK_EINTERNAL, /* internal error */ + ASE_AWK_EFMTARG, /* arguments to format string not sufficient */ + ASE_AWK_EFMTCONV, /* recursion detected in format conversion */ /* regular expression error */ ASE_AWK_EREXRPAREN, /* a right parenthesis is expected */ diff --git a/ase/awk/err.c b/ase/awk/err.c index 8864c72b..aad0040e 100644 --- a/ase/awk/err.c +++ b/ase/awk/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.47 2006-11-13 09:02:23 bacon Exp $ + * $Id: err.c,v 1.48 2006-11-16 04:44:16 bacon Exp $ */ #include @@ -81,8 +81,8 @@ const ase_char_t* ase_awk_geterrstr (int errnum) ASE_T("nextfile illegal in BEGIN or END block"), ASE_T("getline expected"), ASE_T("printf requires one or more arguments"), - ASE_T("formatting sequence is wrong"), + ASE_T("internal error that should never have happened"), ASE_T("divide by zero"), ASE_T("invalid operand"), ASE_T("wrong position index"), @@ -103,12 +103,13 @@ const ase_char_t* ase_awk_geterrstr (int errnum) ASE_T("wrong implementation of user-defined io handler"), ASE_T("no such io name found"), ASE_T("io handler has returned an error"), - ASE_T("internal error that should never have happened"), + ASE_T("not sufficient arguments to formatting sequence"), + ASE_T("recursion detected in format conversion"), - ASE_T("a right parenthesis is expected in the regular expression"), - ASE_T("a right bracket is expected in the regular expression"), - ASE_T("a right brace is expected in the regular expression"), - ASE_T("a colon is expected in the regular expression"), + ASE_T("a right parenthesis expected in the regular expression"), + ASE_T("a right bracket expected in the regular expression"), + ASE_T("a right brace expected in the regular expression"), + ASE_T("a colon expected in the regular expression"), ASE_T("invalid character range in the regular expression"), ASE_T("invalid character class in the regular expression"), ASE_T("invalid boundary range in the regular expression"), diff --git a/ase/awk/run.c b/ase/awk/run.c index ed73e1b8..f082224f 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.260 2006-11-15 15:04:41 bacon Exp $ + * $Id: run.c,v 1.261 2006-11-16 04:44:16 bacon Exp $ */ #include @@ -5598,7 +5598,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5658,7 +5658,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5717,7 +5717,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5768,7 +5768,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5809,7 +5809,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5879,7 +5879,7 @@ ase_char_t* ase_awk_sprintf ( if (args == ASE_NULL && stack_arg_idx >= nargs_on_stack) { - run->errnum = ASE_AWK_EPRINTFARG; + run->errnum = ASE_AWK_EFMTARG; return ASE_NULL; } @@ -5911,14 +5911,12 @@ ase_char_t* ase_awk_sprintf ( { ase_size_t l; - /* TODO:XXXXX - if (v == val) - { - ase_awk_refdownval (run, v); - run->errnum = ASE_AWK_EPRINTFARG; - return ASE_NULL; - } - */ + if (v == val) + { + ase_awk_refdownval (run, v); + run->errnum = ASE_AWK_EFMTCONV; + return ASE_NULL; + } p = ase_awk_valtostr (run, v, ASE_AWK_VALTOSTR_CLEAR, ASE_NULL, &l); diff --git a/ase/awk/val.c b/ase/awk/val.c index e55df06a..457bb3c4 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c,v 1.84 2006-11-15 15:04:41 bacon Exp $ + * $Id: val.c,v 1.85 2006-11-16 04:44:16 bacon Exp $ */ #include @@ -593,7 +593,7 @@ static ase_char_t* __val_real_to_str ( //run->awk->syscas.sprintf (tbuf, ase_countof(tbuf), tmp, (double)v->val); tmp = ase_awk_sprintf (run, tmp, tmp_len, (ase_size_t)-1, (ase_awk_nde_t*)v, &tmp_len); - + if (tmp == ASE_NULL) return ASE_NULL; if (buf == ASE_NULL) {