db: fix how parameter math works
When I tested these changes I had two major problems:
1) We sometimes record both the implied range and the comparison so it
looks like, "1-s32max<$1" which is unparsable.
2) smatch_parse_call_math.c doesn't support range lists only exact figures
so if the parameter is a range list then we don't store anything and it
is less information than we had before.
The fix for this is to go back to putting [] characters in the format like
this, "1-s32max[<$1]" or "1-s32max[$0 + 4]".
Eventually I will want to make smatch_parse_call_math.c handle range lists
but that can be done later.
There are several other minor bugs fixed in this change.
I made parse_call_math() ignore the final ']'. So now it takes strings
like "$0 + $1]". It's sort of a bogus string but that's fine.
I removed a duplicate check in returned_member_callback() and I removed an
unused variable in smatch_extra.c.
In smatch_db.c I said that if we knew the value was a literal then don't
bother looking it up in terms of parameter math. Also I made some
variables const.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>