From db6b46b0a9c64a827cfd9e14f61d1a50814c174c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 17 Feb 2007 15:27:19 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/run.c | 4 +++- ase/awk/val.c | 4 ++-- ase/lsp/descrip.mms | 3 ++- ase/lsp/eval.c | 10 +++++----- ase/lsp/obj.h | 18 +++++++++--------- ase/lsp/print.c | 26 ++++++++++++++++---------- 6 files changed, 37 insertions(+), 28 deletions(-) diff --git a/ase/awk/run.c b/ase/awk/run.c index aaed7145..50f5fbaa 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.327 2007-02-12 03:10:48 bacon Exp $ + * $Id: run.c,v 1.328 2007-02-17 15:26:58 bacon Exp $ * * {License} */ @@ -6483,6 +6483,8 @@ ase_char_t* ase_awk_format ( ASE_T("%ld"), (long)width #elif ASE_SIZEOF_INT > 0 ASE_T("%d"), (int)width + #else + #error unsupported size #endif ); if (n == -1) diff --git a/ase/awk/val.c b/ase/awk/val.c index 3876700f..4ae190c3 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c,v 1.107 2007-02-03 10:51:14 bacon Exp $ + * $Id: val.c,v 1.108 2007-02-17 15:26:58 bacon Exp $ * * {License} */ @@ -786,7 +786,7 @@ void ase_awk_dprintval (ase_awk_run_t* run, ase_awk_val_t* val) __DPRINTF (ASE_T("%d"), (int)((ase_awk_val_int_t*)val)->val); #else - #error unsupported integer size + #error unsupported size #endif break; diff --git a/ase/lsp/descrip.mms b/ase/lsp/descrip.mms index 1f0931cc..95564785 100644 --- a/ase/lsp/descrip.mms +++ b/ase/lsp/descrip.mms @@ -8,7 +8,8 @@ CFLAGS = /include="../.." #CFLAGS = /pointer_size=long /include="../.." aselsp.olb : $(objects) - $(LIBR)/create $(MMS$TARGET) $(objects) + $(LIBR)/create $(MMS$TARGET) *.obj +# $(LIBR)/create $(MMS$TARGET) $(objects) lsp.obj depends_on lsp.c name.obj depends_on name.c diff --git a/ase/lsp/eval.c b/ase/lsp/eval.c index c9e99bb2..948784f7 100644 --- a/ase/lsp/eval.c +++ b/ase/lsp/eval.c @@ -1,5 +1,5 @@ /* - * $Id: eval.c,v 1.26 2007-02-11 07:36:54 bacon Exp $ + * $Id: eval.c,v 1.27 2007-02-17 15:27:19 bacon Exp $ * * {License} */ @@ -45,7 +45,7 @@ ase_lsp_obj_t* ase_lsp_eval (ase_lsp_t* lsp, ase_lsp_obj_t* obj) { if (lsp->opt_undef_symbol) { - ase_char_t* arg[1]; + const ase_char_t* arg[1]; arg[0] = ASE_LSP_SYMPTR(obj); @@ -138,7 +138,7 @@ static ase_lsp_obj_t* eval_cons (ase_lsp_t* lsp, ase_lsp_obj_t* cons) if (func == ASE_NULL) { /* the symbol's function definition is void */ - ase_char_t* arg[1]; + const ase_char_t* arg[1]; arg[0] = ASE_LSP_SYMPTR(car); ase_lsp_seterror ( @@ -160,7 +160,7 @@ static ase_lsp_obj_t* eval_cons (ase_lsp_t* lsp, ase_lsp_obj_t* cons) } else { - ase_char_t* arg[1]; + const ase_char_t* arg[1]; arg[0] = ASE_LSP_SYMPTR(car); ase_lsp_seterror ( @@ -172,7 +172,7 @@ static ase_lsp_obj_t* eval_cons (ase_lsp_t* lsp, ase_lsp_obj_t* cons) } else { - ase_char_t* arg[1]; + const ase_char_t* arg[1]; arg[0] = ASE_LSP_SYMPTR(car); ase_lsp_seterror ( diff --git a/ase/lsp/obj.h b/ase/lsp/obj.h index a14ef701..d010342f 100644 --- a/ase/lsp/obj.h +++ b/ase/lsp/obj.h @@ -1,5 +1,5 @@ /* - * $Id: obj.h,v 1.16 2007-02-03 10:51:53 bacon Exp $ + * $Id: obj.h,v 1.17 2007-02-17 15:27:19 bacon Exp $ * * {License} */ @@ -80,7 +80,7 @@ struct ase_lsp_obj_real_t struct ase_lsp_obj_sym_t { ase_lsp_objhdr_t hdr; -#if !defined(__BORLANDC__) && !defined(_MSC_VER) +#if defined(__GNUC__) ase_char_t buffer[0]; #endif }; @@ -88,7 +88,7 @@ struct ase_lsp_obj_sym_t struct ase_lsp_obj_str_t { ase_lsp_objhdr_t hdr; -#if !defined(__BORLANDC__) && !defined(_MSC_VER) +#if defined(__GNUC__) ase_char_t buffer[0]; #endif }; @@ -134,17 +134,17 @@ struct ase_lsp_obj_prim_t #define ASE_LSP_IVAL(x) (((ase_lsp_obj_int_t*)x)->value) #define ASE_LSP_RVAL(x) (((ase_lsp_obj_real_t*)x)->value) -#if defined(__BORLANDC__) || defined(_MSC_VER) -#define ASE_LSP_SYMPTR(x) ((ase_char_t*)(((ase_lsp_obj_sym_t*)x) + 1)) +#if defined(__GNUC__) + #define ASE_LSP_SYMPTR(x) (((ase_lsp_obj_sym_t*)x)->buffer) #else -#define ASE_LSP_SYMPTR(x) (((ase_lsp_obj_sym_t*)x)->buffer) + #define ASE_LSP_SYMPTR(x) ((ase_char_t*)(((ase_lsp_obj_sym_t*)x) + 1)) #endif #define ASE_LSP_SYMLEN(x) ((((ase_lsp_obj_sym_t*)x)->hdr.size - sizeof(ase_lsp_obj_t)) / sizeof(ase_char_t) - 1) -#if defined(__BORLANDC__) || defined(_MSC_VER) -#define ASE_LSP_STRPTR(x) ((ase_char_t*)(((ase_lsp_obj_str_t*)x) + 1)) +#if defined(__GNUC__) + #define ASE_LSP_STRPTR(x) (((ase_lsp_obj_str_t*)x)->buffer) #else -#define ASE_LSP_STRPTR(x) (((ase_lsp_obj_str_t*)x)->buffer) + #define ASE_LSP_STRPTR(x) ((ase_char_t*)(((ase_lsp_obj_str_t*)x) + 1)) #endif #define ASE_LSP_STRLEN(x) ((((ase_lsp_obj_str_t*)x)->hdr.size - sizeof(ase_lsp_obj_t)) / sizeof(ase_char_t) - 1) diff --git a/ase/lsp/print.c b/ase/lsp/print.c index 9458fd52..76857b30 100644 --- a/ase/lsp/print.c +++ b/ase/lsp/print.c @@ -1,5 +1,5 @@ /* - * $Id: print.c,v 1.23 2007-02-13 06:00:20 bacon Exp $ + * $Id: print.c,v 1.24 2007-02-17 15:27:19 bacon Exp $ * * {License} */ @@ -43,18 +43,24 @@ static int __print (ase_lsp_t* lsp, const ase_lsp_obj_t* obj, ase_bool_t prt_con break; case ASE_LSP_OBJ_INT: - #if defined(__BORLANDC__) || defined(_MSC_VER) - lsp->prmfns.sprintf ( - buf, ASE_COUNTOF(buf), - ASE_T("%I64d"), (__int64)ASE_LSP_IVAL(obj)); - #elif defined(vax) || defined(__vax) || defined(_SCO_DS) - lsp->prmfns.sprintf ( - buf, ASE_COUNTOF(buf), - ASE_T("%ld"), (long)ASE_LSP_IVAL(obj)); - #else + #if ASE_SIZEOF_LONG_LONG > 0 lsp->prmfns.sprintf ( buf, ASE_COUNTOF(buf), ASE_T("%lld"), (long long)ASE_LSP_IVAL(obj)); + #elif ASE_SIZEOF___INT64 > 0 + lsp->prmfns.sprintf ( + buf, ASE_COUNTOF(buf), + ASE_T("%I64d"), (__int64)ASE_LSP_IVAL(obj)); + #elif ASE_SIZEOF_LONG > 0 + lsp->prmfns.sprintf ( + buf, ASE_COUNTOF(buf), + ASE_T("%ld"), (long)ASE_LSP_IVAL(obj)); + #elif ASE_SIZEOF_INT > 0 + lsp->prmfns.sprintf ( + buf, ASE_COUNTOF(buf), + ASE_T("%d"), (int)ASE_LSP_IVAL(obj)); + #else + #error unsupported size #endif OUTPUT_STR (lsp, buf); break;