]> granicus.if.org Git - postgresql/commitdiff
Consistently use PG_INT(16|32|64)_(MIN|MAX).
authorAndres Freund <andres@anarazel.de>
Wed, 13 Dec 2017 02:15:22 +0000 (18:15 -0800)
committerAndres Freund <andres@anarazel.de>
Wed, 13 Dec 2017 02:19:13 +0000 (18:19 -0800)
Per buildfarm animal woodlouse.

contrib/btree_gist/btree_cash.c
contrib/btree_gist/btree_int2.c
contrib/btree_gist/btree_int4.c
contrib/btree_gist/btree_int8.c
src/backend/utils/adt/int.c
src/backend/utils/adt/int8.c
src/backend/utils/adt/numeric.c

index 18f45f2750be542568f2827192f1a0411661248e..894d0a266559b5ce4c34937642b7d56e837d88d6 100644 (file)
@@ -101,7 +101,7 @@ cash_dist(PG_FUNCTION_ARGS)
        Cash            ra;
 
        if (pg_sub_s64_overflow(a, b, &r) ||
-               r == INT64_MIN)
+               r == PG_INT64_MIN)
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("money out of range")));
index c2af4cd566d5ab26f73dc0ea00a7618ea65f6c16..7674e2d292bb90fe2d1f5e026a21451569d8f85d 100644 (file)
@@ -100,7 +100,7 @@ int2_dist(PG_FUNCTION_ARGS)
        int16           ra;
 
        if (pg_sub_s16_overflow(a, b, &r) ||
-               r == INT16_MIN)
+               r == PG_INT16_MIN)
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("smallint out of range")));
index f2b6dec6607a5c498348c822c3195655989fefd2..80005ab65d964e12b5bd6f90a180a51ab637ee8f 100644 (file)
@@ -101,7 +101,7 @@ int4_dist(PG_FUNCTION_ARGS)
        int32           ra;
 
        if (pg_sub_s32_overflow(a, b, &r) ||
-               r == INT32_MIN)
+               r == PG_INT32_MIN)
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("integer out of range")));
index 16db0028b7a69777fdc2c704d347a4c462b0886c..b0fd3e1277d07c15a2d4e581adcda4b08a72cac8 100644 (file)
@@ -101,7 +101,7 @@ int8_dist(PG_FUNCTION_ARGS)
        int64           ra;
 
        if (pg_sub_s64_overflow(a, b, &r) ||
-               r == INT64_MIN)
+               r == PG_INT64_MIN)
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("bigint out of range")));
index 36ba86ca734bede4415d10fd0c6a00664e5aaa0f..d6eb16a907b947146e8e1187912675a3b6e2cebd 100644 (file)
@@ -794,7 +794,7 @@ int2div(PG_FUNCTION_ARGS)
         */
        if (arg2 == -1)
        {
-               if (unlikely(arg1 == INT16_MIN))
+               if (unlikely(arg1 == PG_INT16_MIN))
                        ereport(ERROR,
                                        (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                         errmsg("smallint out of range")));
@@ -1018,7 +1018,7 @@ int4abs(PG_FUNCTION_ARGS)
        int32           arg1 = PG_GETARG_INT32(0);
        int32           result;
 
-       if (unlikely(arg1 == INT32_MIN))
+       if (unlikely(arg1 == PG_INT32_MIN))
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("integer out of range")));
@@ -1032,7 +1032,7 @@ int2abs(PG_FUNCTION_ARGS)
        int16           arg1 = PG_GETARG_INT16(0);
        int16           result;
 
-       if (unlikely(arg1 == INT16_MIN))
+       if (unlikely(arg1 == PG_INT16_MIN))
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("smallint out of range")));
index bc8dad5c5d892aecb5c3acc38fd3d326c7bac5f8..42bb6ebe2f1f7c7c0b6136a22bd841e991b7ef06 100644 (file)
@@ -103,7 +103,7 @@ scanint8(const char *str, bool errorOK, int64 *result)
 
        if (!neg)
        {
-               if (unlikely(tmp == INT64_MIN))
+               if (unlikely(tmp == PG_INT64_MIN))
                        goto out_of_range;
                tmp = -tmp;
        }
@@ -564,7 +564,7 @@ int8div(PG_FUNCTION_ARGS)
         */
        if (arg2 == -1)
        {
-               if (unlikely(arg1 == INT64_MIN))
+               if (unlikely(arg1 == PG_INT64_MIN))
                        ereport(ERROR,
                                        (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                         errmsg("bigint out of range")));
@@ -588,7 +588,7 @@ int8abs(PG_FUNCTION_ARGS)
        int64           arg1 = PG_GETARG_INT64(0);
        int64           result;
 
-       if (unlikely(arg1 == INT64_MIN))
+       if (unlikely(arg1 == PG_INT64_MIN))
                ereport(ERROR,
                                (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                 errmsg("bigint out of range")));
@@ -822,7 +822,7 @@ int84div(PG_FUNCTION_ARGS)
         */
        if (arg2 == -1)
        {
-               if (unlikely(arg1 == INT64_MIN))
+               if (unlikely(arg1 == PG_INT64_MIN))
                        ereport(ERROR,
                                        (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                         errmsg("bigint out of range")));
@@ -964,7 +964,7 @@ int82div(PG_FUNCTION_ARGS)
         */
        if (arg2 == -1)
        {
-               if (unlikely(arg1 == INT64_MIN))
+               if (unlikely(arg1 == PG_INT64_MIN))
                        ereport(ERROR,
                                        (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
                                         errmsg("bigint out of range")));
index e9a6ca3535d862893ac86a50adf3e429992533c4..983098870157d432810a30f964dcbee2982ee565 100644 (file)
@@ -6226,7 +6226,7 @@ numericvar_to_int64(const NumericVar *var, int64 *result)
 
        if (!neg)
        {
-               if (unlikely(val == INT64_MIN))
+               if (unlikely(val == PG_INT64_MIN))
                        return false;
                val = -val;
        }