diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-10 11:47:01 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-10 11:47:01 -0500 |
commit | 88e0b8f6fa3c543959a6b91c6615c6fb65572cae (patch) | |
tree | 1ae517acd5e720c350fd94bcdfb783365497a6c7 | |
parent | 99185ed75bba6c14a996ccf5b6b1b98b823eac0f (diff) |
improved some integer type stuff
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | parse.c | 2 | ||||
-rw-r--r-- | types.h | 4 |
3 files changed, 4 insertions, 4 deletions
@@ -1171,7 +1171,7 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) { } break; case EXPR_LITERAL_INT: assert(e->type.kind == TYPE_BUILTIN); - u64_to_val(v, e->type.builtin, e->intl); + u64_to_val(v, e->type.builtin, (U64)e->intl); break; case EXPR_LITERAL_FLOAT: assert(e->type.kind == TYPE_BUILTIN); @@ -191,7 +191,7 @@ static size_t type_to_str_(Type *t, char *buffer, size_t bufsize) { case TYPE_ARR: { size_t written = str_copy(buffer, bufsize, "["); if (t->flags & TYPE_IS_RESOLVED) { - snprintf(buffer + written, bufsize - written, UINTEGER_FMT, t->arr.n); + snprintf(buffer + written, bufsize - written, PRIu64, t->arr.n); written += strlen(buffer + written); } else { written += str_copy(buffer + written, bufsize - written, "N"); @@ -316,8 +316,8 @@ typedef struct Type { struct { struct Type *of; union { - UInteger n; /* this is NOT set by parse_type; it will be handled by types.c */ - struct Expression *n_expr; + U64 n; /* after typing */ + struct Expression *n_expr; /* before typing */ }; } arr; struct Type *ptr; |