From 15b54482241083d52b6e9857a66fecbf915d467d Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 8 Jun 2023 20:05:18 +0200 Subject: cooker: Full support for flags and masks, assorted fixes Signed-off-by: Stefano Brivio --- cooker/emit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cooker/emit.c') diff --git a/cooker/emit.c b/cooker/emit.c index 107b2ce..d4ca97b 100644 --- a/cooker/emit.c +++ b/cooker/emit.c @@ -425,12 +425,14 @@ static struct gluten_offset emit_data_do(struct gluten_ctx *g, case U32: if (add) { *(int *)p |= value->v_int; - debug(" C#%i |= (%s) %i", - ret.offset, type_str[type], value->v_int); + debug(" C#%i |= (%s) %i (0x%04x)", + ret.offset, type_str[type], + value->v_num, value->v_num); } else { *(int *)p = value->v_int; - debug(" C#%i := (%s) %i", - ret.offset, type_str[type], value->v_int); + debug(" C#%i := (%s) %i (0x%04x)", + ret.offset, type_str[type], + value->v_num, value->v_num); } break; @@ -475,9 +477,7 @@ static struct gluten_offset emit_data_do(struct gluten_ctx *g, struct gluten_offset emit_data(struct gluten_ctx *g, enum type type, size_t str_len, union value *value) { - struct gluten_offset offset = { .type = OFFSET_NULL, .offset = 0 }; - - return emit_data_do(g, offset, type, str_len, value, false); + return emit_data_do(g, NULL_OFFSET, type, str_len, value, false); } struct gluten_offset emit_data_at(struct gluten_ctx *g, -- cgit v1.2.3