summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane2017-12-17 05:41:41 +0000
committerTom Lane2017-12-17 05:41:41 +0000
commitb31a9d7dd3bf8435fddf404c4b75236d0ea76d78 (patch)
treec57daeae33437c4e3dad138510e667d96ddc8ecf /src
parentc04d35f442a8c4fd5a20103b31839ec52fce3046 (diff)
Suppress compiler warning about no function return value.
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/int8.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c
index a8e22008525..24c91508936 100644
--- a/src/backend/utils/adt/int8.c
+++ b/src/backend/utils/adt/int8.c
@@ -81,9 +81,7 @@ scanint8(const char *str, bool errorOK, int64 *result)
/* require at least one digit */
if (unlikely(!isdigit((unsigned char) *ptr)))
- {
goto invalid_syntax;
- }
/* process digits */
while (*ptr && isdigit((unsigned char) *ptr))
@@ -108,26 +106,25 @@ scanint8(const char *str, bool errorOK, int64 *result)
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()