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