Compilers that don't know that ereport(ERROR) doesn't return
complained about the new coding in scanint8() introduced by
commit
101c7ee3e. Tweak coding to avoid the warning.
Per buildfarm.
/* require at least one digit */
if (unlikely(!isdigit((unsigned char) *ptr)))
- {
goto invalid_syntax;
- }
/* process digits */
while (*ptr && isdigit((unsigned char) *ptr))
goto out_of_range;
tmp = -tmp;
}
- *result = tmp;
+ *result = tmp;
return true;
out_of_range:
- if (errorOK)
- return false;
- else
+ if (!errorOK)
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("value \"%s\" is out of range for type %s",
str, "bigint")));
+ return false;
+
invalid_syntax:
- if (errorOK)
- return false;
- else
+ if (!errorOK)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for integer: \"%s\"",
str)));
+ return false;
}
/* int8in()