added --enable-unicode to configure.ac

cleaned up unnecessary code
This commit is contained in:
2018-02-21 07:37:10 +00:00
parent a1ce05a5fb
commit cfdc22ee60
12 changed files with 205 additions and 26 deletions

View File

@ -267,6 +267,8 @@ HAVE_CXX = @HAVE_CXX@
HCL_PROJECT_AUTHOR = @HCL_PROJECT_AUTHOR@
HCL_PROJECT_URL = @HCL_PROJECT_URL@
HCL_SIZEOF_CHAR = @HCL_SIZEOF_CHAR@
HCL_SIZEOF_CHAR16_T = @HCL_SIZEOF_CHAR16_T@
HCL_SIZEOF_CHAR32_T = @HCL_SIZEOF_CHAR32_T@
HCL_SIZEOF_DOUBLE = @HCL_SIZEOF_DOUBLE@
HCL_SIZEOF_FLOAT = @HCL_SIZEOF_FLOAT@
HCL_SIZEOF_INT = @HCL_SIZEOF_INT@

View File

@ -2099,11 +2099,11 @@ static int execute (hcl_t* hcl)
/* it emulates thisContext blockCopy: nargs ofTmprCount: ntmprs */
HCL_ASSERT (hcl, hcl->sp >= 2);
HCL_ASSERT (hcl, HCL_CLASSOF(hcl, HCL_STACK_GETTOP(hcl)) == hcl->_small_integer);
HCL_ASSERT (hcl, HCL_OOP_IS_SMOOI(HCL_STACK_GETTOP(hcl)));
ntmprs = HCL_OOP_TO_SMOOI(HCL_STACK_GETTOP(hcl));
HCL_STACK_POP (hcl);
HCL_ASSERT (hcl, HCL_CLASSOF(hcl, HCL_STACK_GETTOP(hcl)) == hcl->_small_integer);
HCL_ASSERT (hcl, HCL_OOP_IS_SMOOI(HCL_STACK_GETTOP(hcl)));
nargs = HCL_OOP_TO_SMOOI(HCL_STACK_GETTOP(hcl));
HCL_STACK_POP (hcl);

View File

@ -321,7 +321,6 @@ void hcl_gc (hcl_t* hcl)
*(hcl_oop_t*)((hcl_uint8_t*)hcl + syminfo[i].offset) = tmp;
}
hcl->_class = hcl_moveoop (hcl, hcl->_class);
hcl->_character = hcl_moveoop (hcl, hcl->_character);
hcl->_small_integer = hcl_moveoop (hcl, hcl->_small_integer);
hcl->_large_positive_integer = hcl_moveoop (hcl, hcl->_large_positive_integer);

View File

@ -222,6 +222,9 @@
/* link modules statically into the main library */
#undef HCL_ENABLE_STATIC_MODULE
/* Use the unicode character type as the default character type */
#undef HCL_ENABLE_UNICODE
/* Big Endian */
#undef HCL_ENDIAN_BIG
@ -234,6 +237,9 @@
/* MB_LEN_MAX */
#undef HCL_MBLEN_MAX
/* unicode character type */
#undef HCL_OVERRIDE_UCH_TYPE
/* Author */
#undef HCL_PACKAGE_AUTHOR
@ -348,6 +354,12 @@
/* The size of `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of `char16_t', as computed by sizeof. */
#undef SIZEOF_CHAR16_T
/* The size of `char32_t', as computed by sizeof. */
#undef SIZEOF_CHAR32_T
/* The size of `double', as computed by sizeof. */
#undef SIZEOF_DOUBLE

View File

@ -318,20 +318,18 @@ struct hcl_bcs_t
};
typedef struct hcl_bcs_t hcl_bcs_t;
#if 0
typedef hcl_bch_t hcl_ooch_t;
typedef hcl_bci_t hcl_ooci_t;
typedef hcl_bcs_t hcl_oocs_t;
# define HCL_OOCH_IS_BCH
#else
#if defined(HCL_ENABLE_UNICODE)
typedef hcl_uch_t hcl_ooch_t;
typedef hcl_uci_t hcl_ooci_t;
typedef hcl_ucs_t hcl_oocs_t;
# define HCL_OOCH_IS_UCH
#else
typedef hcl_bch_t hcl_ooch_t;
typedef hcl_bci_t hcl_ooci_t;
typedef hcl_bcs_t hcl_oocs_t;
# define HCL_OOCH_IS_BCH
#endif
/* =========================================================================
* TIME-RELATED TYPES
* =========================================================================*/

View File

@ -1006,7 +1006,6 @@ struct hcl_t
/* == NEVER CHANGE THE ORDER OF FIELDS BELOW == */
/* hcl_ignite() assumes this order. make sure to update symnames in ignite_3() */
hcl_oop_t _class; /* Class */
hcl_oop_t _character;
hcl_oop_t _small_integer; /* SmallInteger */
hcl_oop_t _large_positive_integer; /* LargePositiveInteger */

View File

@ -436,7 +436,7 @@ reswitch:
/* get the length */
for (bslen = 0; bsp[bslen]; bslen++);
if (hcl_convbtooochars (hcl, bsp, &bslen, HCL_NULL, &slen) <= -1) goto oops;
if (hcl_convbtooochars(hcl, bsp, &bslen, HCL_NULL, &slen) <= -1) goto oops;
/* slen holds the length after conversion */
n = slen;
@ -505,7 +505,7 @@ reswitch:
/* get the length */
for (uslen = 0; usp[uslen]; uslen++);
if (hcl_convutooochars (hcl, usp, &uslen, HCL_NULL, &slen) <= -1) goto oops;
if (hcl_convutooochars(hcl, usp, &uslen, HCL_NULL, &slen) <= -1) goto oops;
/* slen holds the length after conversion */
n = slen;

View File

@ -468,31 +468,22 @@ int hcl_equalobjs (hcl_t* hcl, hcl_oop_t rcv, hcl_oop_t arg)
case HCL_OOP_TAG_SMOOI:
return HCL_OOP_TO_SMOOI(rcv) == HCL_OOP_TO_SMOOI(arg)? 1: 0;
#if 0
case HCL_OOP_TAG_SMPTR:
return HCL_OOP_TO_SMPTR(rcv) == HCL_OOP_TO_SMPTR(arg)? 1: 0;
#endif
case HCL_OOP_TAG_CHAR:
return HCL_OOP_TO_CHAR(rcv) == HCL_OOP_TO_CHAR(arg)? 1: 0;
#if 0
case HCL_OOP_TAG_ERROR:
return HCL_OOP_TO_ERROR(rcv) == HCL_OOP_TO_ERROR(arg)? 1: 0;
#endif
default:
{
HCL_ASSERT (hcl, HCL_OOP_IS_POINTER(rcv));
if (HCL_OBJ_GET_CLASS(rcv) != HCL_OBJ_GET_CLASS(arg)) return 0; /* different class, not equal */
if (HCL_OBJ_GET_FLAGS_BRAND(rcv) != HCL_OBJ_GET_FLAGS_BRAND(arg)) return 0; /* different class, not equal */
HCL_ASSERT (hcl, HCL_OBJ_GET_FLAGS_TYPE(rcv) == HCL_OBJ_GET_FLAGS_TYPE(arg));
if (HCL_OBJ_GET_CLASS(rcv) == hcl->_class && rcv != arg)
{
/* a class object are supposed to be unique */
return 0;
}
if (HCL_OBJ_GET_SIZE(rcv) != HCL_OBJ_GET_SIZE(arg)) return 0; /* different size, not equal */
switch (HCL_OBJ_GET_FLAGS_TYPE(rcv))