cprim_closeEnoughAux (cprim c1, cprim c2, bool deep)
{
if (c1 == c2) return TRUE;
-
+
DPRINTF (("cprim close: %s / %s", cprim_unparse (c1), cprim_unparse (c2)));
if (c1 == CTX_ANYINTEGRAL)
if (c1 == CTX_UNSIGNEDINTEGRAL)
{
- if (context_getFlag (FLG_MATCHANYINTEGRAL)
- || context_getFlag (FLG_IGNOREQUALS))
+ /* We allow signed ints to match any integral if matchanyintegral is set */
+ if (context_getFlag (FLG_MATCHANYINTEGRAL)) {
+ return (cprim_isAnyInt (c2)
+ || (cprim_isAnyChar (c2) && context_msgCharInt ()));
+ }
+
+ if (context_getFlag (FLG_IGNOREQUALS))
{
if (context_getFlag (FLG_IGNORESIGNS))
{
if (c1 == CTX_SIGNEDINTEGRAL)
{
- if (context_getFlag (FLG_MATCHANYINTEGRAL)
- || context_getFlag (FLG_IGNOREQUALS))
+ /* We allow signed ints to match any integral if matchanyintegral is set */
+ if (context_getFlag (FLG_MATCHANYINTEGRAL)) {
+ return (cprim_isAnyInt (c2)
+ || (cprim_isAnyChar (c2) && context_msgCharInt ()));
+ }
+
+ if (context_getFlag (FLG_IGNOREQUALS))
{
return (cprim_isAnyInt (c2)
|| (cprim_isAnyChar (c2) && context_msgCharInt ()));
case 'i':
case 'd':
+ expecttype = ctype_makePointer (ctype_combine (ctype_int, modtype));
+ /*@switchbreak@*/ break;
+
case 'x':
case 'X': /* unsigned int */
- expecttype = ctype_makePointer (ctype_combine (ctype_int, modtype));
+ expecttype = ctype_makePointer (ctype_combine (ctype_uint, modtype));
/*@switchbreak@*/ break;
case 'e':
f->guards = guardSet_union (f->guards, a->guards);
DPRINTF (("match arg: %s / %s", ctype_unparse (ct), ctype_unparse (a->typ)));
-
+
if (!(exprNode_matchArgType (ct, a)))
{
DPRINTF (("Args mismatch!"));
}
else if (ctype_isArbitraryIntegral (ctype_realType (ut1)))
{
+ DPRINTF (("HERE: %s", ctype_unparse (ctype_realType (ut2))));
+
if (ctype_isArbitraryIntegral (ctype_realType (ut2)))
{
hcode = FLG_MATCHANYINTEGRAL;
}
- else if (ctype_match (ut2, ctype_ulint))
+ else if (ctype_equal (ut2, ctype_ulint))
{
hcode = FLG_LONGUNSIGNEDINTEGRAL;
}
- else if (ctype_match (ut2, ctype_lint))
+ else if (ctype_equal (ut2, ctype_lint))
{
hcode = FLG_LONGINTEGRAL;
}
else if (ctype_isInt (ut2))
{
hcode = FLG_MATCHANYINTEGRAL;
- }
+ }
else
{
- ;
+ hcode = FLG_TYPE;
}
}
else if (ctype_isArbitraryIntegral (ctype_realType (ut2)))