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

Commitf512a6e

Browse files
committed
Consistently use PG_INT(16|32|64)_(MIN|MAX).
Per buildfarm animal woodlouse.
1 parent4c6744e commitf512a6e

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

‎contrib/btree_gist/btree_cash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cash_dist(PG_FUNCTION_ARGS)
101101
Cashra;
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int2_dist(PG_FUNCTION_ARGS)
100100
int16ra;
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int4_dist(PG_FUNCTION_ARGS)
101101
int32ra;
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int8_dist(PG_FUNCTION_ARGS)
101101
int64ra;
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

Lines changed: 3 additions & 3 deletions
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
int32arg1=PG_GETARG_INT32(0);
10191019
int32result;
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
int16arg1=PG_GETARG_INT16(0);
10331033
int16result;
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

Lines changed: 5 additions & 5 deletions
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
gotoout_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
int64arg1=PG_GETARG_INT64(0);
589589
int64result;
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

Lines changed: 1 addition & 1 deletion
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)

[8]ページ先頭

©2009-2025 Movatter.jp