aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/show-parse.c
diff options
authorDave Olien <dmo@osdl.org>2003-06-24 13:45:24 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:54 -0700
commit79ebcc247b65968e936e8521ef12ee6fb6d8ea79 (patch)
tree10c530feba1214659100ea373c8fa1147232da78 /show-parse.c
parentd36c1c2bd4e0ad4ee0ec5b7c71021c35c11291c9 (diff)
downloadsparse-dev-79ebcc247b65968e936e8521ef12ee6fb6d8ea79.tar.gz
[PATCH] another minor sparse change adding opnames.
Add more operations to the name list. Without these additions, the "and" operator is displayed as a null pointer. In the original code, the "&" operator was within the name[] array, but didnt' have a string assigned to it. So printf() displayed it as the string "null". While I was at it, I added other operation names to the table.
Diffstat (limited to 'show-parse.c')
-rw-r--r--show-parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/show-parse.c b/show-parse.c
index 71564f1e..f05309ae 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -607,7 +607,8 @@ static int show_binop(struct expression *expr)
static const char *name[] = {
['+'] = "add", ['-'] = "sub",
['*'] = "mul", ['/'] = "div",
- ['%'] = "mod"
+ ['%'] = "mod", ['&'] = "and",
+ ['|'] = "lor", ['^'] = "xor"
};
unsigned int op = expr->op;