X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fprint.c;h=3a5866ad0f29234031a7b28aec51d60434578582;hb=58a5ffdfec139a0c9d399f603b77a764ae8607f7;hp=64a6115360db417b4ac8a9102c67e42175835fa6;hpb=8d55156675587a770c5654362bcbd3d2a98e4aa9;p=muddle-interpreter.git diff --git a/src/print.c b/src/print.c index 64a6115..3a5866a 100644 --- a/src/print.c +++ b/src/print.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2017 Keziah Wesley +Copyright (C) 2017-2018 Keziah Wesley You can redistribute and/or modify this file under the terms of the GNU Affero General Public License as published by the Free Software @@ -27,12 +27,12 @@ License along with this file. If not, see static void print_vector_body (const vector_object * o) { - const object *p = OBJECT_OF_HEAP_PTR (o->body); + const object *p = HEAP_OBJECT (o->val.body); if (!p) return; - if (o->len) + if (o->val.len) print_object (&p[0]); - for (uint32_t i = 1; i < o->len; i++) + for (uint32_t i = 1; i < o->val.len; i++) { printf (" "); print_object (&p[i]); @@ -42,7 +42,7 @@ print_vector_body (const vector_object * o) static void print_list_body (const list_object * o) { - const pool_object *p = POOL_OBJECT (o->head); + const pool_object *p = POOL_OBJECT (o->val.head); if (!p) return; print_object ((const object *) p); @@ -59,10 +59,10 @@ print_object (const object * o) switch (o->type) { case EVALTYPE_FIX32: - printf ("%u", o->fix32.val); + printf ("%d", o->fix32.val.n); break; case EVALTYPE_FIX64: - printf ("%lu", o->fix64.val); + printf ("%ld", o->fix64.val.n); break; case EVALTYPE_LIST: printf ("(");