diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-06-04 09:51:15 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-06-04 09:51:15 +0200 |
commit | c021082abcc9d94c2e94679f6729265fe65529a3 (patch) | |
tree | e0c8d7160d9a725911edafc80ab0bceeec35e159 /cooker/call.c | |
parent | 15c01cbd4b1fabe929cb93226f6295e88b0c04c4 (diff) | |
download | seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar.gz seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar.bz2 seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar.lz seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar.xz seitan-c021082abcc9d94c2e94679f6729265fe65529a3.tar.zst seitan-c021082abcc9d94c2e94679f6729265fe65529a3.zip |
cooker: Generic attributes and ATTR_SIZE
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'cooker/call.c')
-rw-r--r-- | cooker/call.c | 28 |
1 files changed, 8 insertions, 20 deletions
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); } |