2 * SPDX-License-Identifier: MIT
4 * Copyright 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 bool bt_safe_to_mul_int64(int64_t a
, int64_t b
)
13 if (a
== 0 || b
== 0) {
17 return a
< INT64_MAX
/ b
;
21 bool bt_safe_to_mul_uint64(uint64_t a
, uint64_t b
)
23 if (a
== 0 || b
== 0) {
27 return a
< UINT64_MAX
/ b
;
31 bool bt_safe_to_add_int64(int64_t a
, int64_t b
)
33 return a
<= INT64_MAX
- b
;
37 bool bt_safe_to_add_uint64(uint64_t a
, uint64_t b
)
39 return a
<= UINT64_MAX
- b
;
This page took 0.032213 seconds and 4 git commands to generate.