diff --git a/src/codegen.c b/src/codegen.c index b3ed76de..c2db013d 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -146,7 +146,7 @@ new_analyze_state(pic_state *pic) push_scope(state, pic_nil_value()); global_tbl = pic->global_tbl; - for (it = xh_begin(global_tbl); ! xh_isend(&it); xh_next(global_tbl, &it)) { + for (xh_begin(global_tbl, &it); ! xh_isend(&it); xh_next(&it)) { xh_put(state->scope->var_tbl, it.e->key, 0); } diff --git a/src/macro.c b/src/macro.c index 8c9b4bd6..e63adf0f 100644 --- a/src/macro.c +++ b/src/macro.c @@ -186,8 +186,7 @@ pic_import(pic_state *pic, pic_value spec) if (! lib) { pic_error(pic, "library not found"); } - it = xh_begin(lib->exports); - while (! xh_isend(&it)) { + for (xh_begin(lib->exports, &it); ! xh_isend(&it); xh_next(&it)) { #if DEBUG if (it.e->val >= 0) { printf("* importing %s as %s\n", it.e->key, pic_symbol_name(pic, (pic_sym)it.e->val)); @@ -212,7 +211,6 @@ pic_import(pic_state *pic, pic_value spec) xh_put(senv->tbl, it.e->key, ~idx); senv->xlen++; } - xh_next(lib->exports, &it); } }