diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-05 16:37:56 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-05 16:37:56 -0500 |
commit | f2e244503477184717e0d9029c93fd6bcba2fa40 (patch) | |
tree | 462bf643f1dc601b43578a0ea9db64e7c9ca9f0f | |
parent | c171453f6b78c005c12fb8471256ef18b79ee9a9 (diff) |
fixed 32-bit compilation warning
-rw-r--r-- | copy.c | 2 | ||||
-rw-r--r-- | instance_table.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -46,7 +46,7 @@ static void copy_val(Allocator *a, Value *out, Value *in, Type *t) { *out = *in; break; case TYPE_ARR: { - size_t bytes = t->arr.n * compiler_sizeof(t->arr.of); + size_t bytes = (size_t)t->arr.n * compiler_sizeof(t->arr.of); out->arr = allocr_malloc(a, bytes); memcpy(out->arr, in->arr, bytes); } break; diff --git a/instance_table.c b/instance_table.c index 979d030..33a7eba 100644 --- a/instance_table.c +++ b/instance_table.c @@ -330,8 +330,8 @@ static Instance *instance_table_adda(Allocator *a, HashTable *h, Value v, Type * } h->data = new_data; h->occupied = new_occupied; - allocr_free(a, old_occupied, h->cap * sizeof *old_occupied); - allocr_free(a, old_data, h->cap * sizeof *old_data); + allocr_free(a, old_occupied, (size_t)h->cap * sizeof *old_occupied); + allocr_free(a, old_data, (size_t)h->cap * sizeof *old_data); h->cap = new_cap; } Instance **data = h->data; |