From 53ddf5477dd32077e15f69c875f5a53f0e0ab93c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 26 Aug 2006 16:30:53 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/func.c | 6 +++--- ase/awk/makefile.tcc | 2 +- ase/test/awk/awk.c | 13 ++++++++++--- ase/test/awk/t15.awk | 3 +-- ase/test/awk/t16.awk | 2 +- ase/test/awk/t31.awk | 2 +- ase/types.h | 11 +++++++++-- 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ase/awk/func.c b/ase/awk/func.c index 8194845c..bc5bbc0f 100644 --- a/ase/awk/func.c +++ b/ase/awk/func.c @@ -1,5 +1,5 @@ /* - * $Id: func.c,v 1.32 2006-08-26 15:28:08 bacon Exp $ + * $Id: func.c,v 1.33 2006-08-26 16:30:53 bacon Exp $ */ #include @@ -826,9 +826,9 @@ static int __bfn_sin (xp_awk_t* awk, void* run) if (n == 0) rv = (xp_real_t)lv; -#if (XP_SIZEOF_LONG_DOUBLE != 0) +#if (XP_SIZEOF_REAL == XP_SIZEOF_LONG_DOUBLE) v = xp_awk_makerealval (run, (xp_real_t)sinl(rv)); -#elif (XP_SIZEOF_DOUBLE != 0) +#elif (XP_SIZEOF_REAL == XP_SIZEOF_DOUBLE) v = xp_awk_makerealval (run, (xp_real_t)sin(rv)); #else #error unsupported floating-point data type diff --git a/ase/awk/makefile.tcc b/ase/awk/makefile.tcc index d4b5868b..692f2208 100644 --- a/ase/awk/makefile.tcc +++ b/ase/awk/makefile.tcc @@ -1,4 +1,4 @@ -SRCS = awk.c err.c tree.c tab.c map.c parse.c run.c sa.c val.c misc.c +SRCS = awk.c err.c tree.c tab.c map.c parse.c run.c sa.c val.c misc.c extio.c rex.c OBJS = $(SRCS:.c=.obj) OUT = xpawk.lib diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index f0265bf4..3a661c32 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.76 2006-08-26 15:28:08 bacon Exp $ + * $Id: awk.c,v 1.77 2006-08-26 16:30:53 bacon Exp $ */ #include @@ -169,7 +169,7 @@ static xp_ssize_t process_source ( static xp_ssize_t dump_source ( int cmd, void* arg, xp_char_t* data, xp_size_t size) { - struct src_io* src_io = (struct src_io*)arg; + /*struct src_io* src_io = (struct src_io*)arg;*/ if (cmd == XP_AWK_IO_OPEN || cmd == XP_AWK_IO_CLOSE) return 0; else if (cmd == XP_AWK_IO_WRITE) @@ -528,7 +528,7 @@ static void __on_run_end (xp_awk_t* awk, void* handle, int errnum, void* arg) { xp_printf (XP_T("AWK PRORAM ABOUT TO END WITH AN ERROR - %d - %s\n"), errnum, xp_awk_geterrstr (errnum)); } - else xp_printf (XP_T("AWK PRORAM ENDED SUCCESSFUL\n")); + else xp_printf (XP_T("AWK PRORAM ENDED SUCCESSFULLY\n")); app_awk = NULL; app_run = NULL; @@ -557,6 +557,13 @@ static int __main (int argc, xp_char_t* argv[]) XP_AWK_SHADING | XP_AWK_IMPLICIT | XP_AWK_SHIFT | XP_AWK_EXTIO | XP_AWK_BLOCKLESS | XP_AWK_STRINDEXONE; + if (argc <= 1) + { + xp_awk_close (awk); + xp_printf (XP_T("Usage: %s [-m] source_file [data_file]\n"), argv[0]); + return -1; + } + for (i = 1; i < argc; i++) { #if defined(__STAND_ALONE) && !defined(_WIN32) diff --git a/ase/test/awk/t15.awk b/ase/test/awk/t15.awk index 61313af7..6765587d 100644 --- a/ase/test/awk/t15.awk +++ b/ase/test/awk/t15.awk @@ -1,5 +1,4 @@ -BEGIN -{ +BEGIN { local a, b; a = 12; diff --git a/ase/test/awk/t16.awk b/ase/test/awk/t16.awk index 534131b7..d383b877 100644 --- a/ase/test/awk/t16.awk +++ b/ase/test/awk/t16.awk @@ -1 +1 @@ -{ $0=" "; print NF; print "a" $0 "b"; x = $1; } +{ /*$0=" "; */ print NF; print "a" $0 "b"; x = $1; } diff --git a/ase/test/awk/t31.awk b/ase/test/awk/t31.awk index 40979e9d..a98a5db1 100644 --- a/ase/test/awk/t31.awk +++ b/ase/test/awk/t31.awk @@ -1,2 +1,2 @@ -BEGIN { /*RS="";*/ } +BEGIN { RS=""; } { print $0; } diff --git a/ase/types.h b/ase/types.h index 828b7284..e4551bdf 100644 --- a/ase/types.h +++ b/ase/types.h @@ -1,5 +1,5 @@ /* - * $Id: types.h,v 1.53 2006-08-26 15:28:08 bacon Exp $ + * $Id: types.h,v 1.54 2006-08-26 16:30:52 bacon Exp $ */ #ifndef _XP_TYPES_H_ @@ -190,9 +190,16 @@ typedef xp_int_t xp_ssize_t; typedef xp_uint_t xp_word_t; /* floating-point number */ -#if XP_SIZEOF_LONG_DOUBLE > XP_SIZEOF_DOUBLE +#if defined(__FreeBSD__) + /* TODO: check if the support for long double is complete. + * if so, use long double for xp_real_t */ + #define XP_SIZEOF_REAL XP_SIZEOF_DOUBLE + typedef double xp_real_t; +#elif XP_SIZEOF_LONG_DOUBLE > XP_SIZEOF_DOUBLE + #define XP_SIZEOF_REAL XP_SIZEOF_LONG_DOUBLE typedef long double xp_real_t; #else + #define XP_SIZEOF_REAL XP_SIZEOF_DOUBLE typedef double xp_real_t; #endif