From a70e9a0f76cf40e42b2c74207e4604f984653125 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 17 Jul 2006 14:27:09 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/func.c | 8 +++++++- ase/awk/rex.c | 33 ++++++++++++++++++++++++++++++++- ase/awk/val.c | 4 ++-- ase/test/awk/t14.awk | 2 +- 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ase/awk/func.c b/ase/awk/func.c index 6b557489..212f8aa1 100644 --- a/ase/awk/func.c +++ b/ase/awk/func.c @@ -1,5 +1,5 @@ /* - * $Id: func.c,v 1.12 2006-07-17 06:19:35 bacon Exp $ + * $Id: func.c,v 1.13 2006-07-17 14:27:09 bacon Exp $ */ #include @@ -226,7 +226,13 @@ static int __bfn_sin (void* run) if (n == 0) rv = (xp_real_t)lv; +#if (XP_SIZEOF_LONG_DOUBLE != 0) + v = xp_awk_makerealval (run, (xp_real_t)sinl(rv)); +#elif (XP_SIZEOF_DOUBLE != 0) v = xp_awk_makerealval (run, (xp_real_t)sin(rv)); +#else + #error unsupported floating-point data type +#endif if (v == XP_NULL) { xp_awk_seterrnum (run, XP_AWK_ENOMEM); diff --git a/ase/awk/rex.c b/ase/awk/rex.c index 4527c9a4..854d0a23 100644 --- a/ase/awk/rex.c +++ b/ase/awk/rex.c @@ -1,5 +1,5 @@ /* - * $Id: rex.c,v 1.1 2006-07-17 06:21:39 bacon Exp $ + * $Id: rex.c,v 1.2 2006-07-17 14:27:09 bacon Exp $ */ #include @@ -9,6 +9,37 @@ #include #endif +enum +{ + CMD_ORD_CHAR, + CMD_ANY_CHAR, + CMD_CHAR_RANGE, + CMD_CHAR_CLASS +}; + +enum +{ + CMD_CHAR_CLASS_PUNCT, + CMD_CHAR_CLASS_SPACE, + CMD_CHAR_CLASS_DIGIT, + CMD_CHAR_CLASS_ALNUM +}; + +struct __code +{ + unsigned char cmd; + unsigned char bflag; /* bound flag */ + xp_char_t lbound; + xp_char_t ubound; +}; + +#define PC_CMD(rex,base) (rex)->code[(base)].dc.cmd +#define PC_BFLAG(rex,base) (rex)->code[(base)].dc.bflag +#define PC_LBOUND(rex,base) (rex)->code[(base)].dc.lbound +#define PC_UBOUND(rex,base) (rex)->code[(base)].dc.ubound +#define PC_VALUE(rex,base) (rex)->code[(base)].cc + + xp_awk_rex_t* xp_awk_rex_open (xp_awk_rex_t* rex) { if (rex == XP_NULL) diff --git a/ase/awk/val.c b/ase/awk/val.c index 1fcfd547..10eee78c 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c,v 1.43 2006-07-17 06:19:35 bacon Exp $ + * $Id: val.c,v 1.44 2006-07-17 14:27:09 bacon Exp $ */ #include @@ -440,7 +440,7 @@ xp_char_t* xp_awk_valtostr ( tbuf, xp_countof(tbuf), XP_T("%f"), (double)((xp_awk_val_real_t*)v)->val); #else - #error Unsupported floating-point data type + #error unsupported floating-point data type #endif if (buf == XP_NULL) diff --git a/ase/test/awk/t14.awk b/ase/test/awk/t14.awk index bfc92708..5bb69639 100644 --- a/ase/test/awk/t14.awk +++ b/ase/test/awk/t14.awk @@ -22,4 +22,4 @@ global x, y; print "===================="; } -END { system ("dir /w/p"); print sin(90.0); } +END { system ("dir /w/p"); print sin(270); }