From c021082abcc9d94c2e94679f6729265fe65529a3 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 4 Jun 2023 09:51:15 +0200 Subject: cooker: Generic attributes and ATTR_SIZE Signed-off-by: Stefano Brivio --- cooker/call.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'cooker/call.c') diff --git a/cooker/call.c b/cooker/call.c index 6182a5b..d44ff6f 100644 --- a/cooker/call.c +++ b/cooker/call.c @@ -142,27 +142,15 @@ static union value parse_field(struct gluten_ctx *g, struct arg *args, case INT: case LONG: case U32: - if (f->flags == SIZE && !dry_run) { - unsigned i; - - for (i = 0; args[i].f.type; i++) { - if (args[i].pos == f->desc.d_arg_size) - break; - } - if (!args[i].f.type) - die("no argument found for SIZE field"); - - v.v_num = args[i].f.size; + if (f->flags == SIZE) { + v.v_num = value_get_size(g, f->desc.d_size); + } else if (f->flags == FLAGS) { + /* fetch/combine expr algebra loop */ + v.v_num = value_get_num(f->desc.d_num, jvalue); + } else if (f->flags == MASK) { + /* calculate mask first */ + v.v_num = value_get_num(f->desc.d_num, jvalue); } else { - if (f->flags == FLAGS) { - /* fetch/combine expr algebra loop */ - ; - } - if (f->flags == MASK) { - /* calculate mask first */ - ; - } - v.v_num = value_get_num(f->desc.d_num, jvalue); } -- cgit v1.2.3