ASSERT_MSG: hash

This commit is contained in:
Jan Nieuwenhuizen 2019-10-26 08:12:48 +02:00
parent b2bcf6456c
commit 6166d194ea
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 9 additions and 6 deletions

View File

@ -46,24 +46,27 @@ hashq_ (SCM x, long size)
int int
hash_ (SCM x, long size) hash_ (SCM x, long size)
{ {
if (TYPE (x) == TSTRING) if (TYPE (x) != TSTRING)
return hash_cstring (cell_bytes (STRING (x)), size); {
assert_msg (0, "0"); eputs ("hash_ failed, not a string:");
return hashq_ (x, size); display_error_ (x);
assert_msg (0, "0");
}
return hash_cstring (cell_bytes (STRING (x)), size);
} }
SCM SCM
hashq (SCM x, SCM size) hashq (SCM x, SCM size)
{ {
eputs ("hashq not supporteed\n");
assert_msg (0, "0"); assert_msg (0, "0");
return make_number (hashq_ (x, VALUE (size)));
} }
SCM SCM
hash (SCM x, SCM size) hash (SCM x, SCM size)
{ {
eputs ("hash not supporteed\n");
assert_msg (0, "0"); assert_msg (0, "0");
return make_number (hash_ (x, VALUE (size)));
} }
SCM SCM