Go to the source code of this file.
◆ Sk32_can_overflow_add()
static constexpr int32_t Sk32_can_overflow_add |
( |
int32_t |
a, |
|
|
int32_t |
b |
|
) |
| |
|
staticconstexpr |
Definition at line 30 of file SkSafe32.h.
30 {
31 return (int32_t)((uint32_t)
a + (uint32_t)
b);
32}
◆ Sk32_can_overflow_sub()
static constexpr int32_t Sk32_can_overflow_sub |
( |
int32_t |
a, |
|
|
int32_t |
b |
|
) |
| |
|
staticconstexpr |
Definition at line 33 of file SkSafe32.h.
33 {
34 return (int32_t)((uint32_t)
a - (uint32_t)
b);
35}
◆ Sk32_sat_add()
static constexpr int32_t Sk32_sat_add |
( |
int32_t |
a, |
|
|
int32_t |
b |
|
) |
| |
|
staticconstexpr |
Definition at line 20 of file SkSafe32.h.
20 {
22}
static constexpr int32_t Sk64_pin_to_s32(int64_t x)
◆ Sk32_sat_sub()
static constexpr int32_t Sk32_sat_sub |
( |
int32_t |
a, |
|
|
int32_t |
b |
|
) |
| |
|
staticconstexpr |
◆ Sk64_pin_to_s32()
static constexpr int32_t Sk64_pin_to_s32 |
( |
int64_t |
x | ) |
|
|
staticconstexpr |
Definition at line 16 of file SkSafe32.h.
16 {
18}
static constexpr int32_t SK_MinS32
static constexpr int32_t SK_MaxS32
◆ SkAbs32()
static int32_t SkAbs32 |
( |
int32_t |
value | ) |
|
|
inlinestatic |
This is a 'safe' abs for 32-bit integers that asserts when undefined behavior would occur. SkTAbs (in SkTemplates.h) is a general purpose absolute-value function.
Definition at line 41 of file SkSafe32.h.
41 {
45 }
47}
static constexpr int32_t SK_NaN32