From e02bfc916743a0327d76144b32b6ec6381e5907f Mon Sep 17 00:00:00 2001 From: eunhhu Date: Wed, 30 Sep 2026 15:51:32 +0100 Subject: Let a value's 8 bytes hold a number or an integer Before i64 (016 stage 2): a state's value, a record field's default, a list cell's number, the interpreter's stack slot and an instruction's constant become unions of a double and an int64_t (PureValue, anonymous unions in PureCell, Slot and PureOp). LOAD and STORE, and a list cell made from the stack, copy the bits; everything else reads .num as before. No behaviour changes: every check passes as it did. --- serve/message-json.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'serve') diff --git a/serve/message-json.c b/serve/message-json.c index 0ace68f..afbd541 100644 --- a/serve/message-json.c +++ b/serve/message-json.c @@ -349,7 +349,7 @@ static const char *rows_of(PureJsonMessage *b, unsigned char *json, size_t size, for (unsigned k = 0; k < record->count; ++k) { uint32_t at_field = record->first + k; if (m->record_field_text[at_field]) { - uint32_t constant = (uint32_t)m->record_field_default[at_field]; + uint32_t constant = (uint32_t)m->record_field_default[at_field].num; PureSpan text = given[k] ? texts[k] : (PureSpan){m->constant_data + m->constant_offset[constant], m->constant_length[constant]}; if (!rows_room(b, 4 + text.size)) return "memory"; @@ -357,7 +357,7 @@ static const char *rows_of(PureJsonMessage *b, unsigned char *json, size_t size, if (text.size) memcpy(b->rows + b->rows_size + 4, text.data, text.size); b->rows_size += 4 + text.size; } else { - double value = given[k] ? numbers[k] : m->record_field_default[at_field]; + double value = given[k] ? numbers[k] : m->record_field_default[at_field].num; uint64_t bits; memcpy(&bits, &value, 8); if (!rows_room(b, 8)) return "memory"; -- cgit v1.2.3