summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-12-22 17:45:48 +0100
committerPatrick McHardy <kaber@trash.net>2015-01-11 08:14:08 +0000
commit9e2271940a081214f045341fa521a6231736bae8 (patch)
treef523937a3fc0f1bfd31f50bc42f5497e0bfb4d2d /src/evaluate.c
parent755d5d4d63450b13e2a0059a63d5cae24c215ac3 (diff)
concat: add concat subtype lookup/id helpers
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 00c6d918..53f3cf0a 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -612,25 +612,22 @@ static int expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
int off = dtype ? dtype->subtypes : 0;
unsigned int flags = EXPR_F_CONSTANT | EXPR_F_SINGLETON;
struct expr *i, *next;
- unsigned int n;
- n = 1;
list_for_each_entry_safe(i, next, &(*expr)->expressions, list) {
if (dtype && off == 0)
return expr_binary_error(ctx->msgs, i, *expr,
"unexpected concat component, "
"expecting %s",
dtype->desc);
- tmp = datatype_lookup((type >> TYPE_BITS * --off) & TYPE_MASK);
+
+ tmp = concat_subtype_lookup(type, --off);
expr_set_context(&ctx->ectx, tmp, tmp->size);
if (list_member_evaluate(ctx, &i) < 0)
return -1;
flags &= i->flags;
- ntype <<= TYPE_BITS;
- ntype |= i->dtype->type;
- n++;
+ ntype = concat_subtype_add(ntype, i->dtype->type);
}
(*expr)->flags |= flags;