Go to the source code of this file.
|
static bool | pg_add_s16_overflow (int16 a, int16 b, int16 *result) |
|
static bool | pg_sub_s16_overflow (int16 a, int16 b, int16 *result) |
|
static bool | pg_mul_s16_overflow (int16 a, int16 b, int16 *result) |
|
static bool | pg_add_s32_overflow (int32 a, int32 b, int32 *result) |
|
static bool | pg_sub_s32_overflow (int32 a, int32 b, int32 *result) |
|
static bool | pg_mul_s32_overflow (int32 a, int32 b, int32 *result) |
|
static bool | pg_add_s64_overflow (int64 a, int64 b, int64 *result) |
|
static bool | pg_sub_s64_overflow (int64 a, int64 b, int64 *result) |
|
static bool | pg_mul_s64_overflow (int64 a, int64 b, int64 *result) |
|
static bool | pg_add_u16_overflow (uint16 a, uint16 b, uint16 *result) |
|
static bool | pg_sub_u16_overflow (uint16 a, uint16 b, uint16 *result) |
|
static bool | pg_mul_u16_overflow (uint16 a, uint16 b, uint16 *result) |
|
static bool | pg_add_u32_overflow (uint32 a, uint32 b, uint32 *result) |
|
static bool | pg_sub_u32_overflow (uint32 a, uint32 b, uint32 *result) |
|
static bool | pg_mul_u32_overflow (uint32 a, uint32 b, uint32 *result) |
|
static bool | pg_add_u64_overflow (uint64 a, uint64 b, uint64 *result) |
|
static bool | pg_sub_u64_overflow (uint64 a, uint64 b, uint64 *result) |
|
static bool | pg_mul_u64_overflow (uint64 a, uint64 b, uint64 *result) |
|
◆ pg_add_s16_overflow()
Definition at line 47 of file int.h.
49 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
50 return __builtin_add_overflow(
a,
b, result);
static void PGresult * res
References a, b, PG_INT16_MAX, PG_INT16_MIN, and res.
Referenced by int2pl().
◆ pg_add_s32_overflow()
Definition at line 104 of file int.h.
106 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
107 return __builtin_add_overflow(
a,
b, result);
109 int64
res = (int64)
a + (int64)
b;
References a, b, PG_INT32_MAX, PG_INT32_MIN, and res.
Referenced by AdjustDays(), AdjustFractDays(), AdjustFractYears(), AdjustMonths(), AdjustYears(), array_append(), ArrayCheckBoundsSafe(), bit_overlay(), bitsubstring(), bytea_overlay(), bytea_substring(), detoast_attr_slice(), generate_series_step_int4(), in_range_int2_int4(), in_range_int4_int4(), int24pl(), int42pl(), int4inc(), int4pl(), interval_justify_days(), interval_justify_hours(), interval_justify_interval(), lpad(), repeat(), rpad(), text_format_parse_digits(), text_overlay(), text_substring(), translate(), and width_bucket_float8().
◆ pg_add_s64_overflow()
static bool pg_add_s64_overflow |
( |
int64 |
a, |
|
|
int64 |
b, |
|
|
int64 * |
result |
|
) |
| |
|
inlinestatic |
Definition at line 161 of file int.h.
163 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
164 return __builtin_add_overflow(
a,
b, result);
165 #elif defined(HAVE_INT128)
166 int128
res = (int128)
a + (int128)
b;
173 *result = (int64)
res;
References a, b, PG_INT64_MAX, PG_INT64_MIN, and res.
Referenced by AdjustFractMicroseconds(), DecodeInterval(), evalStandardFunc(), generate_series_step_int8(), in_range_int4_int8(), in_range_int8_int8(), int28pl(), int48pl(), int64_multiply_add(), int82pl(), int84pl(), int8inc(), int8pl(), interval_part_common(), and itm2interval().
◆ pg_add_u16_overflow()
Definition at line 266 of file int.h.
268 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
269 return __builtin_add_overflow(
a,
b, result);
References a, b, and res.
◆ pg_add_u32_overflow()
Definition at line 321 of file int.h.
323 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
324 return __builtin_add_overflow(
a,
b, result);
References a, b, and res.
◆ pg_add_u64_overflow()
static bool pg_add_u64_overflow |
( |
uint64 |
a, |
|
|
uint64 |
b, |
|
|
uint64 * |
result |
|
) |
| |
|
inlinestatic |
◆ pg_mul_s16_overflow()
◆ pg_mul_s32_overflow()
Definition at line 140 of file int.h.
142 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
143 return __builtin_mul_overflow(
a,
b, result);
145 int64
res = (int64)
a * (int64)
b;
References a, b, PG_INT32_MAX, PG_INT32_MIN, and res.
Referenced by AdjustDays(), AdjustYears(), int24mul(), int42mul(), int4lcm(), int4mul(), lpad(), repeat(), rpad(), text_format_parse_digits(), text_substring(), and translate().
◆ pg_mul_s64_overflow()
static bool pg_mul_s64_overflow |
( |
int64 |
a, |
|
|
int64 |
b, |
|
|
int64 * |
result |
|
) |
| |
|
inlinestatic |
Definition at line 215 of file int.h.
217 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
218 return __builtin_mul_overflow(
a,
b, result);
219 #elif defined(HAVE_INT128)
220 int128
res = (int128)
a * (int128)
b;
227 *result = (int64)
res;
243 a != 0 &&
a != 1 &&
b != 0 &&
b != 1 &&
References a, b, PG_INT32_MAX, PG_INT32_MIN, PG_INT64_MAX, PG_INT64_MIN, and res.
Referenced by cash_in(), DecodeInterval(), evalStandardFunc(), int28mul(), int48mul(), int64_div_fast_to_numeric(), int64_multiply_add(), int82mul(), int84mul(), int8lcm(), int8mul(), interval_part_common(), itm2interval(), numericvar_to_int64(), and strtoint64().
◆ pg_mul_u16_overflow()
Definition at line 300 of file int.h.
302 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
303 return __builtin_mul_overflow(
a,
b, result);
References a, b, PG_UINT16_MAX, and res.
◆ pg_mul_u32_overflow()
Definition at line 355 of file int.h.
357 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
358 return __builtin_mul_overflow(
a,
b, result);
360 uint64
res = (uint64)
a * (uint64)
b;
References a, b, PG_UINT32_MAX, and res.
◆ pg_mul_u64_overflow()
static bool pg_mul_u64_overflow |
( |
uint64 |
a, |
|
|
uint64 |
b, |
|
|
uint64 * |
result |
|
) |
| |
|
inlinestatic |
◆ pg_sub_s16_overflow()
◆ pg_sub_s32_overflow()
Definition at line 122 of file int.h.
124 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
125 return __builtin_sub_overflow(
a,
b, result);
127 int64
res = (int64)
a - (int64)
b;
References a, b, PG_INT32_MAX, PG_INT32_MIN, and res.
Referenced by array_prepend(), int24mi(), int42mi(), int4_dist(), and int4mi().
◆ pg_sub_s64_overflow()
static bool pg_sub_s64_overflow |
( |
int64 |
a, |
|
|
int64 |
b, |
|
|
int64 * |
result |
|
) |
| |
|
inlinestatic |
Definition at line 188 of file int.h.
190 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
191 return __builtin_sub_overflow(
a,
b, result);
192 #elif defined(HAVE_INT128)
193 int128
res = (int128)
a - (int128)
b;
200 *result = (int64)
res;
References a, b, PG_INT64_MAX, PG_INT64_MIN, and res.
Referenced by cash_dist(), cash_in(), evalStandardFunc(), int28mi(), int48mi(), int82mi(), int84mi(), int8_dist(), int8dec(), int8mi(), numericvar_to_int64(), strtoint64(), timestamp_mi(), and TimestampDifferenceMilliseconds().
◆ pg_sub_u16_overflow()
Definition at line 284 of file int.h.
286 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
287 return __builtin_sub_overflow(
a,
b, result);
References a, and b.
◆ pg_sub_u32_overflow()
Definition at line 339 of file int.h.
341 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
342 return __builtin_sub_overflow(
a,
b, result);
References a, and b.
◆ pg_sub_u64_overflow()
static bool pg_sub_u64_overflow |
( |
uint64 |
a, |
|
|
uint64 |
b, |
|
|
uint64 * |
result |
|
) |
| |
|
inlinestatic |
Definition at line 394 of file int.h.
396 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
397 return __builtin_sub_overflow(
a,
b, result);
References a, and b.