removed unneeded text
This commit is contained in:
@ -3717,6 +3717,7 @@ static int compile_keyword_message (stix_t* stix, int to_super)
|
||||
saved_kwsel_loc = stix->c->tok.loc;
|
||||
saved_kwsel_len = stix->c->mth.kwsels.len;
|
||||
|
||||
/* TODO: optimization for ifTrue: ifFalse: whileTrue: whileFalse .. */
|
||||
do
|
||||
{
|
||||
kw = stix->c->tok.name;
|
||||
|
@ -1653,51 +1653,6 @@ printf ("PRIMITVE VALUE RECEIVER IS NOT A BLOCK CONTEXT\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int prim_block_on_do (stix_t* stix, stix_ooi_t nargs)
|
||||
{
|
||||
int x;
|
||||
stix_oop_oop_t exarr;
|
||||
stix_oop_context_t blkctx;
|
||||
stix_ooi_t i, j;
|
||||
|
||||
STIX_ASSERT (nargs >= 2);
|
||||
|
||||
if ((stix_oow_t)nargs & 1) return 0; /* it expects even number of arguments */
|
||||
|
||||
//for (i = 0; i < nargs; i += 2)
|
||||
//{
|
||||
// exblk = ACTIVE_STACK_GET(stix, stix->sp);
|
||||
// excls = ACTIVE_STACK_GET(stix, stix->sp - 1);
|
||||
//}
|
||||
|
||||
x = __block_value (stix, nargs, 0, 0, &blkctx);
|
||||
if (x <= 0) return x; /* hard failure and soft failure */
|
||||
|
||||
/* TOOD: implement zero-cost exception handling.
|
||||
* this implementation requires allocation of a new array
|
||||
* every time on:do: is executed */
|
||||
|
||||
stix_pushtmp (stix, (stix_oop_t*)&blkctx);
|
||||
exarr = (stix_oop_oop_t)stix_instantiate (stix, stix->_array, STIX_NULL, nargs);
|
||||
stix_poptmp (stix);
|
||||
if (!exarr) return -1; /* hard failure */ /* TOOD: can't this be treated as a soft failure? */
|
||||
|
||||
for (i = nargs, j = 0; i > 0;)
|
||||
{
|
||||
--i;
|
||||
exarr->slot[j++] = ACTIVE_STACK_GET(stix, stix->sp - i);
|
||||
--i;
|
||||
exarr->slot[j++] = ACTIVE_STACK_GET(stix, stix->sp - i);
|
||||
}
|
||||
|
||||
|
||||
#if defined(STIX_DEBUG_EXEC_001)
|
||||
printf ("<<ENTERING BLOCK BY ON:DO:>> SP=%ld\n", (long int)stix->sp);
|
||||
#endif
|
||||
SWITCH_ACTIVE_CONTEXT (stix, (stix_oop_context_t)blkctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int prim_process_resume (stix_t* stix, stix_ooi_t nargs)
|
||||
{
|
||||
stix_oop_t rcv;
|
||||
@ -2595,15 +2550,14 @@ static prim_t primitives[] =
|
||||
{ 2, 2, prim_basic_at_put, "_basic_at_put" },
|
||||
|
||||
|
||||
{ 0, MAX_NARGS, prim_block_value, "_block_value" },
|
||||
{ 0, MAX_NARGS, prim_block_new_process, "_block_new_process" },
|
||||
{ 2, MAX_NARGS, prim_block_on_do, "_block_on_do" },
|
||||
{ 0, MAX_NARGS, prim_block_value, "_block_value" },
|
||||
{ 0, MAX_NARGS, prim_block_new_process, "_block_new_process" },
|
||||
|
||||
{ 0, 0, prim_process_resume, "_process_resume" },
|
||||
{ 0, 0, prim_process_terminate, "_process_terminate" },
|
||||
{ 0, 0, prim_process_yield, "_process_yield" },
|
||||
{ 0, 0, prim_semaphore_signal, "_semaphore_signal" },
|
||||
{ 0, 0, prim_semaphore_wait, "_semaphore_wait" },
|
||||
{ 0, 0, prim_process_resume, "_process_resume" },
|
||||
{ 0, 0, prim_process_terminate, "_process_terminate" },
|
||||
{ 0, 0, prim_process_yield, "_process_yield" },
|
||||
{ 0, 0, prim_semaphore_signal, "_semaphore_signal" },
|
||||
{ 0, 0, prim_semaphore_wait, "_semaphore_wait" },
|
||||
|
||||
{ 1, 1, prim_processor_schedule, "_processor_schedule" },
|
||||
{ 2, 3, prim_processor_add_timed_semaphore, "_processor_add_timed_semaphore" },
|
||||
|
@ -480,18 +480,6 @@
|
||||
/* sizeof(short) */
|
||||
#undef STIX_SIZEOF_SHORT
|
||||
|
||||
/* sizeof(socklen_t) */
|
||||
#undef STIX_SIZEOF_SOCKLEN_T
|
||||
|
||||
/* sizeof(struct sockaddr_in) */
|
||||
#undef STIX_SIZEOF_STRUCT_SOCKADDR_IN
|
||||
|
||||
/* sizeof(struct sockaddr_in6) */
|
||||
#undef STIX_SIZEOF_STRUCT_SOCKADDR_IN6
|
||||
|
||||
/* sizeof(struct sockaddr_un) */
|
||||
#undef STIX_SIZEOF_STRUCT_SOCKADDR_UN
|
||||
|
||||
/* sizeof(void*) */
|
||||
#undef STIX_SIZEOF_VOID_P
|
||||
|
||||
|
@ -56,11 +56,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__) && !defined(__386__)
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
# define STIX_SIZEOF_SHORT 2
|
||||
@ -86,11 +81,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
/* TODO: be more version specific wchar_t may be available in newer BCC */
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
@ -117,11 +107,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__ZTC__) && defined(DOS386)
|
||||
|
||||
/* Zortech in DOSX 386 mode (ztc -mx) */
|
||||
@ -149,11 +134,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -52,11 +52,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 16
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -76,11 +76,6 @@ _M_X64 x64 platform
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 16
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__GNUC__) || defined(__DMC__) || defined(__POCC__)
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
# define STIX_SIZEOF_SHORT 2
|
||||
@ -110,10 +105,6 @@ _M_X64 x64 platform
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 16
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
# define STIX_SIZEOF_SHORT 2
|
||||
@ -147,11 +138,6 @@ _M_X64 x64 platform
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
@ -182,11 +168,6 @@ _M_X64 x64 platform
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
@ -59,11 +59,6 @@
|
||||
/* TODO: check the exact value */
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
/* these two have only to be large enough */
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define STIX_SIZEOF_CHAR 1
|
||||
# define STIX_SIZEOF_SHORT 2
|
||||
@ -88,10 +83,6 @@
|
||||
# define STIX_SIZEOF_MBSTATE_T STIX_SIZEOF_LONG
|
||||
# define STIX_MBLEN_MAX 8
|
||||
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN 32
|
||||
# define STIX_SIZEOF_STRUCT_SOCKADDR_IN6 64
|
||||
# define STIX_SIZEOF_SOCKLEN_T 4
|
||||
|
||||
#else
|
||||
# error Define the size of various data types.
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user