core: Prepare for M2-Planet: hash.c.
* src/hash.c: Rewrite C constructs not supported by M2-Planet.
This commit is contained in:
parent
5d7885159b
commit
ddc495916b
|
@ -28,7 +28,7 @@ int
|
|||
hash_cstring (char const *s, long size)
|
||||
{
|
||||
int hash = s[0] * 37;
|
||||
if (s[0] && s[1])
|
||||
if (s[0] != 0 && s[1] != 0)
|
||||
hash = hash + s[1] * 43;
|
||||
assert (size);
|
||||
hash = hash % size;
|
||||
|
@ -183,7 +183,8 @@ hash_table_printer (SCM table)
|
|||
fdputc (' ', __stdout);
|
||||
SCM buckets = struct_ref_ (table, 4);
|
||||
fdputs ("buckets: ", __stdout);
|
||||
for (int i = 0; i < LENGTH (buckets); i++)
|
||||
int i;
|
||||
for (i = 0; i < LENGTH (buckets); i = i + 1)
|
||||
{
|
||||
SCM e = vector_ref_ (buckets, i);
|
||||
if (e != cell_unspecified)
|
||||
|
@ -203,7 +204,7 @@ hash_table_printer (SCM table)
|
|||
}
|
||||
|
||||
SCM
|
||||
make_hashq_type () ///((internal))
|
||||
make_hashq_type () /*:((internal)) */
|
||||
{
|
||||
SCM record_type = cell_symbol_record_type; // FIXME
|
||||
SCM fields = cell_nil;
|
||||
|
@ -217,7 +218,7 @@ make_hashq_type () ///((internal))
|
|||
SCM
|
||||
make_hash_table_ (long size)
|
||||
{
|
||||
if (!size)
|
||||
if (size == 0)
|
||||
size = 100;
|
||||
SCM hashq_type = make_hashq_type ();
|
||||
|
||||
|
|
10
src/lib.c
10
src/lib.c
|
@ -281,14 +281,14 @@ write_port_ (SCM x, SCM p)
|
|||
}
|
||||
|
||||
SCM
|
||||
fdisplay_ (SCM x, int fd, int write_p) ///((internal))
|
||||
fdisplay_ (SCM x, int fd, int write_p) /**((internal))*/
|
||||
{
|
||||
g_depth = 5;
|
||||
return display_helper (x, 0, "", fd, write_p);
|
||||
}
|
||||
|
||||
SCM
|
||||
exit_ (SCM x) ///((name . "exit"))
|
||||
exit_ (SCM x) /**((name . "exit"))*/
|
||||
{
|
||||
assert (TYPE (x) == TNUMBER);
|
||||
exit (VALUE (x));
|
||||
|
@ -306,7 +306,7 @@ frame_printer (SCM frame)
|
|||
}
|
||||
|
||||
SCM
|
||||
make_frame_type () ///((internal))
|
||||
make_frame_type () /**((internal))*/
|
||||
{
|
||||
SCM record_type = cell_symbol_record_type; // FIXME
|
||||
SCM fields = cell_nil;
|
||||
|
@ -331,7 +331,7 @@ make_frame (SCM stack, long index)
|
|||
}
|
||||
|
||||
SCM
|
||||
make_stack_type () ///((internal))
|
||||
make_stack_type () /**((internal))*/
|
||||
{
|
||||
SCM record_type = cell_symbol_record_type; // FIXME
|
||||
SCM fields = cell_nil;
|
||||
|
@ -342,7 +342,7 @@ make_stack_type () ///((internal))
|
|||
}
|
||||
|
||||
SCM
|
||||
make_stack (SCM stack) ///((arity . n))
|
||||
make_stack (SCM stack) /**((arity . n))*/
|
||||
{
|
||||
SCM stack_type = make_stack_type ();
|
||||
long size = (STACK_SIZE - g_stack) / FRAME_SIZE;
|
||||
|
|
Loading…
Reference in New Issue