summaryrefslogtreecommitdiff
path: root/tools/d2c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c')
-rw-r--r--tools/d2c/args/manager.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/d2c/args/manager.c b/tools/d2c/args/manager.c
index 8706694..980bc6c 100644
--- a/tools/d2c/args/manager.c
+++ b/tools/d2c/args/manager.c
@@ -1095,14 +1095,33 @@ bool define_arg_expr(const arg_expr_t *expr, int fd, const coding_bits *bits, co
switch (expr->un_op)
{
case CUO_NOT:
- dprintf(fd, "!");
+ dprintf(fd, "(");
break;
default:
result = false;
break;
}
- result &= define_arg_expr(expr->un_expr, fd, bits, list);
+ if (result)
+ result = define_arg_expr(expr->un_expr, fd, bits, list);
+
+ if (result)
+ result = compute_arg_expr_size(expr, bits, list, &max_size);
+
+ if (result)
+ switch (expr->un_op)
+ {
+ case CUO_NOT:
+ dprintf(fd, " ^ ");
+ if (max_size >= 64)
+ dprintf(fd, "0xffffffffffffffff");
+ else
+ dprintf(fd, "0x%x", (1 << max_size) - 1);
+ dprintf(fd, ")");
+ break;
+ default:
+ break;
+ }
break;