Commit c1719013 by Richard Kenner

(lookup_field): Use HOST_WIDE_INT instead of long or int when we want

integer wide enough to hold a pointer difference.

From-SVN: r5345
parent 72db60c6
...@@ -1056,7 +1056,7 @@ lookup_field (type, component) ...@@ -1056,7 +1056,7 @@ lookup_field (type, component)
top = TYPE_LANG_SPECIFIC (type)->len; top = TYPE_LANG_SPECIFIC (type)->len;
while (top - bot > 1) while (top - bot > 1)
{ {
int cmp; HOST_WIDE_INT cmp;
half = (top - bot + 1) >> 1; half = (top - bot + 1) >> 1;
field = field_array[bot+half]; field = field_array[bot+half];
...@@ -1081,7 +1081,7 @@ lookup_field (type, component) ...@@ -1081,7 +1081,7 @@ lookup_field (type, component)
continue; continue;
} }
cmp = (long)DECL_NAME (field) - (long)component; cmp = (HOST_WIDE_INT) DECL_NAME (field) - (HOST_WIDE_INT) component;
if (cmp == 0) if (cmp == 0)
break; break;
if (cmp < 0) if (cmp < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment