Content-Length: 520785 | pFad | http://github.com/tonybelloni/postgres/commit/f512a6e1323eefa843a063e466babb96d7bfb4ce

13 Consistently use PG_INT(16|32|64)_(MIN|MAX). · tonybelloni/postgres@f512a6e · GitHub
Skip to content

Commit f512a6e

Browse files
committed
Consistently use PG_INT(16|32|64)_(MIN|MAX).
Per buildfarm animal woodlouse.
1 parent 4c6744e commit f512a6e

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

contrib/btree_gist/btree_cash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cash_dist(PG_FUNCTION_ARGS)
101101
Cash ra;
102102

103103
if (pg_sub_s64_overflow(a, b, &r) ||
104-
r == INT64_MIN)
104+
r == PG_INT64_MIN)
105105
ereport(ERROR,
106106
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
107107
errmsg("money out of range")));

contrib/btree_gist/btree_int2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int2_dist(PG_FUNCTION_ARGS)
100100
int16 ra;
101101

102102
if (pg_sub_s16_overflow(a, b, &r) ||
103-
r == INT16_MIN)
103+
r == PG_INT16_MIN)
104104
ereport(ERROR,
105105
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
106106
errmsg("smallint out of range")));

contrib/btree_gist/btree_int4.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int4_dist(PG_FUNCTION_ARGS)
101101
int32 ra;
102102

103103
if (pg_sub_s32_overflow(a, b, &r) ||
104-
r == INT32_MIN)
104+
r == PG_INT32_MIN)
105105
ereport(ERROR,
106106
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
107107
errmsg("integer out of range")));

contrib/btree_gist/btree_int8.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int8_dist(PG_FUNCTION_ARGS)
101101
int64 ra;
102102

103103
if (pg_sub_s64_overflow(a, b, &r) ||
104-
r == INT64_MIN)
104+
r == PG_INT64_MIN)
105105
ereport(ERROR,
106106
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
107107
errmsg("bigint out of range")));

src/backend/utils/adt/int.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ int2div(PG_FUNCTION_ARGS)
794794
*/
795795
if (arg2 == -1)
796796
{
797-
if (unlikely(arg1 == INT16_MIN))
797+
if (unlikely(arg1 == PG_INT16_MIN))
798798
ereport(ERROR,
799799
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
800800
errmsg("smallint out of range")));
@@ -1018,7 +1018,7 @@ int4abs(PG_FUNCTION_ARGS)
10181018
int32 arg1 = PG_GETARG_INT32(0);
10191019
int32 result;
10201020

1021-
if (unlikely(arg1 == INT32_MIN))
1021+
if (unlikely(arg1 == PG_INT32_MIN))
10221022
ereport(ERROR,
10231023
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
10241024
errmsg("integer out of range")));
@@ -1032,7 +1032,7 @@ int2abs(PG_FUNCTION_ARGS)
10321032
int16 arg1 = PG_GETARG_INT16(0);
10331033
int16 result;
10341034

1035-
if (unlikely(arg1 == INT16_MIN))
1035+
if (unlikely(arg1 == PG_INT16_MIN))
10361036
ereport(ERROR,
10371037
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
10381038
errmsg("smallint out of range")));

src/backend/utils/adt/int8.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ scanint8(const char *str, bool errorOK, int64 *result)
103103

104104
if (!neg)
105105
{
106-
if (unlikely(tmp == INT64_MIN))
106+
if (unlikely(tmp == PG_INT64_MIN))
107107
goto out_of_range;
108108
tmp = -tmp;
109109
}
@@ -564,7 +564,7 @@ int8div(PG_FUNCTION_ARGS)
564564
*/
565565
if (arg2 == -1)
566566
{
567-
if (unlikely(arg1 == INT64_MIN))
567+
if (unlikely(arg1 == PG_INT64_MIN))
568568
ereport(ERROR,
569569
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
570570
errmsg("bigint out of range")));
@@ -588,7 +588,7 @@ int8abs(PG_FUNCTION_ARGS)
588588
int64 arg1 = PG_GETARG_INT64(0);
589589
int64 result;
590590

591-
if (unlikely(arg1 == INT64_MIN))
591+
if (unlikely(arg1 == PG_INT64_MIN))
592592
ereport(ERROR,
593593
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
594594
errmsg("bigint out of range")));
@@ -822,7 +822,7 @@ int84div(PG_FUNCTION_ARGS)
822822
*/
823823
if (arg2 == -1)
824824
{
825-
if (unlikely(arg1 == INT64_MIN))
825+
if (unlikely(arg1 == PG_INT64_MIN))
826826
ereport(ERROR,
827827
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
828828
errmsg("bigint out of range")));
@@ -964,7 +964,7 @@ int82div(PG_FUNCTION_ARGS)
964964
*/
965965
if (arg2 == -1)
966966
{
967-
if (unlikely(arg1 == INT64_MIN))
967+
if (unlikely(arg1 == PG_INT64_MIN))
968968
ereport(ERROR,
969969
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
970970
errmsg("bigint out of range")));

src/backend/utils/adt/numeric.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6226,7 +6226,7 @@ numericvar_to_int64(const NumericVar *var, int64 *result)
62266226

62276227
if (!neg)
62286228
{
6229-
if (unlikely(val == INT64_MIN))
6229+
if (unlikely(val == PG_INT64_MIN))
62306230
return false;
62316231
val = -val;
62326232
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/f512a6e1323eefa843a063e466babb96d7bfb4ce

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy