diff options
Diffstat (limited to 'include/expression.h')
-rw-r--r-- | include/expression.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/expression.h b/include/expression.h index 59fa5f3d..4b968796 100644 --- a/include/expression.h +++ b/include/expression.h @@ -96,19 +96,31 @@ enum symbol_types { * struct expr_ctx - type context for symbol parsing during evaluation * * @dtype: expected datatype + * @byteorder: expected byteorder * @len: expected len */ struct expr_ctx { const struct datatype *dtype; + enum byteorder byteorder; unsigned int len; }; +static inline void __expr_set_context(struct expr_ctx *ctx, + const struct datatype *dtype, + enum byteorder byteorder, + unsigned int len) +{ + ctx->dtype = dtype; + ctx->byteorder = byteorder; + ctx->len = len; +} + static inline void expr_set_context(struct expr_ctx *ctx, const struct datatype *dtype, unsigned int len) { - ctx->dtype = dtype; - ctx->len = len; + __expr_set_context(ctx, dtype, + dtype ? dtype->byteorder : BYTEORDER_INVALID, len); } /** |