From 716fd0f03d9429bb16f4714936ccdee95f7743fe Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 19 May 2005 15:08:04 +0000 Subject: [PATCH] *** empty log message *** --- ase/stx/hash.c | 30 ++---------------------------- ase/stx/hash.h | 5 +---- ase/stx/makefile.lcc | 2 +- ase/stx/memory.c | 3 +-- ase/stx/stx.c | 33 +-------------------------------- ase/test/stx/makefile.lcc | 2 +- ase/test/stx/stx.c | 2 +- 7 files changed, 8 insertions(+), 69 deletions(-) diff --git a/ase/stx/hash.c b/ase/stx/hash.c index 7505b131..f92d3a16 100644 --- a/ase/stx/hash.c +++ b/ase/stx/hash.c @@ -1,5 +1,5 @@ /* - * $Id: hash.c,v 1.12 2005-05-18 04:01:51 bacon Exp $ + * $Id: hash.c,v 1.13 2005-05-19 15:04:21 bacon Exp $ */ #include @@ -41,32 +41,6 @@ xp_stx_word_t xp_stx_hash_lookup ( return stx->nil; /* not found */ } -xp_stx_word_t xp_stx_hash_lookup_symbol ( - xp_stx_t* stx, xp_stx_word_t table, - xp_stx_word_t hash, const xp_stx_char_t* key_str) -{ - xp_stx_word_t link, key; - - xp_assert (XP_STX_TYPE(stx,table) == XP_STX_INDEXED); - - hash = hash % XP_STX_SIZE(stx,table); - link = XP_STX_AT(stx,table,hash); - - while (link != stx->nil) { - key = XP_STX_AT(stx,link,XP_STX_PAIRLINK_KEY); - - if (XP_STX_CLASS(stx,key) == stx->class_symbol && - xp_stx_strxcmp ( - &XP_STX_CHARAT(stx,key,0), - XP_STX_SIZE(stx,key), key_str) == 0) { - return link; - } - link = XP_STX_AT(stx,link,XP_STX_PAIRLINK_LINK); - } - - return stx->nil; /* not found */ -} - void xp_stx_hash_insert ( xp_stx_t* stx, xp_stx_word_t table, xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value) @@ -79,7 +53,7 @@ void xp_stx_hash_insert ( link = XP_STX_AT(stx,table,hash); if (link == stx->nil) { - XP_STX_AT(stx,table,hash) = + XP_STX_AT(stx,table,hash) = xp_stx_new_pairlink (stx, key, value); } else { diff --git a/ase/stx/hash.h b/ase/stx/hash.h index 20b9fb7e..3832344b 100644 --- a/ase/stx/hash.h +++ b/ase/stx/hash.h @@ -1,5 +1,5 @@ /* - * $Id: hash.h,v 1.6 2005-05-18 04:01:51 bacon Exp $ + * $Id: hash.h,v 1.7 2005-05-19 15:04:21 bacon Exp $ */ #ifndef _XP_STX_HASH_H_ @@ -22,9 +22,6 @@ xp_stx_word_t xp_stx_new_plink ( xp_stx_word_t xp_stx_hash_lookup ( xp_stx_t* stx, xp_stx_word_t table, xp_stx_word_t hash, xp_stx_word_t key); -xp_stx_word_t xp_stx_hash_lookup_symbol ( - xp_stx_t* stx, xp_stx_word_t table, - xp_stx_word_t hash, const xp_stx_char_t* key_str); void xp_stx_hash_insert ( xp_stx_t* stx, xp_stx_word_t table, xp_stx_word_t hash, xp_stx_word_t key, xp_stx_word_t value); diff --git a/ase/stx/makefile.lcc b/ase/stx/makefile.lcc index 2b1d6b7f..6a485fe5 100644 --- a/ase/stx/makefile.lcc +++ b/ase/stx/makefile.lcc @@ -3,7 +3,7 @@ OBJS = stx.obj memory.obj object.obj symbol.obj hash.obj misc.obj context.obj OUT = xpstx.lib CC = lcc -CFLAGS = -I../.. +CFLAGS = -I../.. -g2 LDFLAGS = LIBS = diff --git a/ase/stx/memory.c b/ase/stx/memory.c index 9a930c20..ab97ab87 100644 --- a/ase/stx/memory.c +++ b/ase/stx/memory.c @@ -1,5 +1,5 @@ /* - * $Id: memory.c,v 1.8 2005-05-18 16:34:51 bacon Exp $ + * $Id: memory.c,v 1.9 2005-05-19 15:04:21 bacon Exp $ */ #include @@ -78,7 +78,6 @@ xp_stx_word_t xp_stx_memory_alloc (xp_stx_memory_t* mem, xp_stx_word_t nbytes) mem->free = (xp_stx_object_t**)*slot; *slot = object; -xp_printf (XP_TEXT("returning %d\n"), slot - mem->slots); return (xp_stx_word_t)(slot - mem->slots); } diff --git a/ase/stx/stx.c b/ase/stx/stx.c index 56f2a407..77dc6875 100644 --- a/ase/stx/stx.c +++ b/ase/stx/stx.c @@ -1,5 +1,5 @@ /* - * $Id: stx.c,v 1.19 2005-05-18 16:34:51 bacon Exp $ + * $Id: stx.c,v 1.20 2005-05-19 15:04:21 bacon Exp $ */ #include @@ -57,14 +57,11 @@ int xp_stx_bootstrap (xp_stx_t* stx) xp_stx_word_t class_Object, class_Class; xp_stx_word_t tmp; -xp_printf (XP_TEXT("bootstreap\n")); __create_bootstrapping_objects (stx); -xp_printf (XP_TEXT("bootstreap over\n")); /* more initialization */ XP_STX_CLASS(stx,stx->symbol_table) = xp_stx_new_class (stx, XP_STX_TEXT("SymbolTable")); -xp_printf (XP_TEXT("bootstreap 1111\n")); XP_STX_CLASS(stx,stx->smalltalk) = xp_stx_new_class (stx, XP_STX_TEXT("SystemDictionary")); @@ -144,7 +141,6 @@ static void __create_bootstrapping_objects (xp_stx_t* stx) class_PairlinkMeta = /* Pairlink class */ xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); - /* (Symlink class) setClass: Metaclass */ XP_STX_CLASS(stx,class_SymlinkMeta) = stx->class_metaclass; /* (Symbol class) setClass: Metaclass */ @@ -163,33 +159,6 @@ static void __create_bootstrapping_objects (xp_stx_t* stx) /* Pairlink setClass: (Pairlink class) */ XP_STX_CLASS(stx,stx->class_pairlink) = class_PairlinkMeta; - stx->class_symlink = /* Symlink */ - xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); - stx->class_symbol = /* Symbol */ - xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); - stx->class_metaclass = /* Metaclass */ - xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); - stx->class_pairlink = /* Pairlink */ - xp_stx_alloc_object(stx,XP_STX_CLASS_SIZE); - - /* (Symlink class) setClass: Metaclass */ - XP_STX_CLASS(stx,class_SymlinkMeta) = stx->class_metaclass; - /* (Symbol class) setClass: Metaclass */ - XP_STX_CLASS(stx,class_SymbolMeta) = stx->class_metaclass; - /* (Metaclass class) setClass: Metaclass */ - XP_STX_CLASS(stx,class_MetaclassMeta) = stx->class_metaclass; - /* (Pairlink class) setClass: Metaclass */ - XP_STX_CLASS(stx,class_PairlinkMeta) = stx->class_metaclass; - - /* Symlink setClass: (Symlink class) */ - XP_STX_CLASS(stx,stx->class_symlink) = class_SymlinkMeta; - /* Symbol setClass: (Symbol class) */ - XP_STX_CLASS(stx,stx->class_symbol) = class_SymbolMeta; - /* Metaclass setClass: (Metaclass class) */ - XP_STX_CLASS(stx,stx->class_metaclass) = class_MetaclassMeta; - /* Pairlink setClass: (Metaclass class) */ - XP_STX_CLASS(stx,stx->class_pairlink) = class_PairlinkMeta; - /* (Symlink class) setSpec: CLASS_SIZE */ XP_STX_AT(stx,class_SymlinkMeta,XP_STX_CLASS_SPEC) = XP_STX_TO_SMALLINT(XP_STX_CLASS_SIZE); diff --git a/ase/test/stx/makefile.lcc b/ase/test/stx/makefile.lcc index b2dc6aa9..49d12dee 100644 --- a/ase/test/stx/makefile.lcc +++ b/ase/test/stx/makefile.lcc @@ -3,7 +3,7 @@ OBJS = stx.obj OUT = stx.exe CC = lcc -CFLAGS = -I../../.. +CFLAGS = -I../../.. -g2 #LDFLAGS = -L../../../xp/bas -L../../../xp/stx #LIBS = -lxpstx -lxpbas LIBS = ..\..\..\xp\bas\xpbas.lib ..\..\..\xp\stx\xpstx.lib diff --git a/ase/test/stx/stx.c b/ase/test/stx/stx.c index c8c49098..a7306c17 100644 --- a/ase/test/stx/stx.c +++ b/ase/test/stx/stx.c @@ -27,7 +27,7 @@ int xp_main (int argc, xp_char_t* argv[]) xp_stx_word_t i; if (argc != 2) { // TODO: argument processing - xp_printf (XP_TEXT("Usage: %s [-f imageFile] MainClass"), argv[0]); + xp_printf (XP_TEXT("Usage: %s [-f imageFile] MainClass\n"), argv[0]); return -1; }