Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb31a9d7

Browse files
committed
Suppress compiler warning about no function return value.
Compilers that don't know that ereport(ERROR) doesn't returncomplained about the new coding in scanint8() introduced bycommit101c7ee. Tweak coding to avoid the warning.Per buildfarm.
1 parentc04d35f commitb31a9d7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

‎src/backend/utils/adt/int8.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ scanint8(const char *str, bool errorOK, int64 *result)
8181

8282
/* require at least one digit */
8383
if (unlikely(!isdigit((unsignedchar)*ptr)))
84-
{
8584
gotoinvalid_syntax;
86-
}
8785

8886
/* process digits */
8987
while (*ptr&&isdigit((unsignedchar)*ptr))
@@ -108,26 +106,25 @@ scanint8(const char *str, bool errorOK, int64 *result)
108106
gotoout_of_range;
109107
tmp=-tmp;
110108
}
111-
*result=tmp;
112109

110+
*result=tmp;
113111
return true;
114112

115113
out_of_range:
116-
if (errorOK)
117-
return false;
118-
else
114+
if (!errorOK)
119115
ereport(ERROR,
120116
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
121117
errmsg("value \"%s\" is out of range for type %s",
122118
str,"bigint")));
119+
return false;
120+
123121
invalid_syntax:
124-
if (errorOK)
125-
return false;
126-
else
122+
if (!errorOK)
127123
ereport(ERROR,
128124
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
129125
errmsg("invalid input syntax for integer: \"%s\"",
130126
str)));
127+
return false;
131128
}
132129

133130
/* int8in()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp