redefined IDXBUFSIZE

This commit is contained in:
hyung-hwan 2014-11-06 17:41:20 +00:00
parent 17b55e20ed
commit a30c831081
2 changed files with 20 additions and 3 deletions

View File

@ -38,15 +38,19 @@
#if defined(QSE_USE_AWK_INTMAX)
typedef qse_intmax_t qse_awk_int_t;
typedef qse_uintmax_t qse_awk_uint_t;
#define QSE_AWK_SIZEOF_INT_T QSE_SIZEZOF_INTMAX_T
#else
typedef qse_long_t qse_awk_int_t;
typedef qse_ulong_t qse_awk_uint_t;
#define QSE_AWK_SIZEOF_INT_T QSE_SIZEZOF_LONG_T
#endif
#if defined(QSE_USE_AWK_FLTMAX)
typedef qse_fltmax_t qse_awk_flt_t;
#define QSE_AWK_SIZEOF_FLT_T QSE_SIZEOF_FLTMAX_T
#else
typedef qse_flt_t qse_awk_flt_t;
#define QSE_AWK_SIZEOF_FLT_T QSE_SIZEOF_FLT_T
#endif
/** \struct qse_awk_t

View File

@ -31,7 +31,20 @@
#define DEF_BUF_CAPA 256
#define RTX_STACK_INCREMENT 512
/* Don't forget to grow IDXBUFSIZE if qse_awk_int_t is very large */
#if (QSE_AWK_SIZEOF_INT_T <= 16) /* 128 bits */
# define IDXBUFSIZE 64
#elif (QSE_AWK_SIZEOF_INT_T <= 32) /* 256 bits */
# define IDXBUFSIZE 128
#elif (QSE_AWK_SIZEOF_INT_T <= 64) /* 512 bits */
# define IDXBUFSIZE 192
#elif (QSE_AWK_SIZEOF_INT_T <= 128) /* 1024 bits */
# define IDXBUFSIZE 384
#elif (QSE_AWK_SIZEOF_INT_T <= 256) /* 2048 bits */
# define IDXBUFSIZE 640
#else
# error unsupported. qse_awk_int_t too big
#endif
#define MMGR(rtx) ((rtx)->awk->mmgr)
@ -6454,7 +6467,7 @@ read_console_again:
skip_read:
tmp = qse_awk_rtx_makeintval (rtx, n);
if (tmp == QSE_NULL) ADJERR_LOC (rtx, &nde->loc);
if (!tmp) ADJERR_LOC (rtx, &nde->loc);
return tmp;
}