aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/metamethods.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-01 12:43:00 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-01 12:43:00 -0400
commit6583fe9b389a6b4698f9364945885e6783506886 (patch)
tree0464456d177eab051b03f29a74218a45b301f174 /src/stdlib/metamethods.c
parent0cfae753aa131f949253f3fba1e3a36c2bde6ac0 (diff)
Convert to using more zero values for `none`
Diffstat (limited to 'src/stdlib/metamethods.c')
-rw-r--r--src/stdlib/metamethods.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/stdlib/metamethods.c b/src/stdlib/metamethods.c
index 6161918c..3eff2dd3 100644
--- a/src/stdlib/metamethods.c
+++ b/src/stdlib/metamethods.c
@@ -6,6 +6,7 @@
#include "lists.h"
#include "metamethods.h"
#include "siphash.h"
+#include "tables.h"
#include "types.h"
#include "util.h"
@@ -50,12 +51,12 @@ List_t generic_serialize(const void *x, const TypeInfo_t *type) {
char *buf = NULL;
size_t size = 0;
FILE *stream = open_memstream(&buf, &size);
- Table_t pointers = {};
+ Table_t pointers = EMPTY_TABLE;
_serialize(x, stream, &pointers, type);
fclose(stream);
List_t bytes = {
.data = GC_MALLOC_ATOMIC(size),
- .length = (int64_t)size,
+ .length = (uint64_t)size,
.stride = 1,
.atomic = 1,
};
@@ -79,7 +80,7 @@ void generic_deserialize(List_t bytes, void *outval, const TypeInfo_t *type) {
if (bytes.stride != 1) List$compact(&bytes, 1);
FILE *input = fmemopen(bytes.data, (size_t)bytes.length, "r");
- List_t pointers = {};
+ List_t pointers = EMPTY_LIST;
_deserialize(input, outval, &pointers, type);
fclose(input);
}