diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-10-25 17:53:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-10-25 17:53:40 -0700 |
commit | 0563523eb3cdc046d98013c8f6f7b374f7bb4adb (patch) | |
tree | 78ab7ba4ef23dacfd0373d026b1941b355d842b8 /hash.c | |
parent | 76aca0cdeb648421ebbbfc3c7e14c2d0d1878348 (diff) | |
download | txr-0563523eb3cdc046d98013c8f6f7b374f7bb4adb.tar.gz txr-0563523eb3cdc046d98013c8f6f7b374f7bb4adb.tar.bz2 txr-0563523eb3cdc046d98013c8f6f7b374f7bb4adb.zip |
* hash.c (hash_begin): Use coerce macro instead of raw C cast.
Use cobj_handle so hash argument is validated.
* parser.l (YY_INPUT): Use convert macro instead of raw C cast.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -666,10 +666,9 @@ static struct cobj_ops hash_iter_ops = { val hash_begin(val hash) { val hi_obj; - struct hash_iter *hi; - struct hash *h = (struct hash *) hash->co.handle; + struct hash *h = coerce(struct hash *, cobj_handle(hash, hash_s)); + struct hash_iter *hi = coerce(struct hash_iter *, chk_malloc(sizeof *hi)); - hi = coerce(struct hash_iter *, chk_malloc(sizeof *hi)); hi->next = 0; hi->hash = nil; hi->chain = -1; |