Graphviz 13.0.0~dev.20250402.0402
|
arithmetic overflow helpers More...
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
static bool | sadd_overflow (int a, int b, int *res) |
static bool | u64add_overflow (uint64_t a, uint64_t b, uint64_t *res) |
static bool | u64mul_overflow (uint64_t a, uint64_t b, uint64_t *res) |
Replace this with stdckdint.h when moving to C23.
Definition in file overflow.h.
|
inlinestatic |
add two integers, checking for overflow
a | Operand 1 |
b | Operand 2 |
res | [out] Result on success |
Definition at line 22 of file overflow.h.
References NULL.
Referenced by x_cutval().
|
inlinestatic |
add two 64-bit unsigned integers, checking for overflow
a | Operand 1 |
b | Operand 2 |
res | [out] Result on success |
Definition at line 51 of file overflow.h.
References NULL.
Referenced by uadd().
|
inlinestatic |
multiply two 64-bit unsigned integers, checking for overflow
a | Operand 1 |
b | Operand 2 |
res | [out] Result on success |
Definition at line 77 of file overflow.h.
References NULL.
Referenced by umul().