Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
math_extras.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Facebook.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_SYS_MATH_EXTRAS_H_
18#define ZEPHYR_INCLUDE_SYS_MATH_EXTRAS_H_
19
20#include <zephyr/types.h>
21#include <stdbool.h>
22#include <stddef.h>
23
34static bool size_add_overflow(size_t a, size_t b, size_t *result);
47static bool size_mul_overflow(size_t a, size_t b, size_t *result);
73
74#endif /* ZEPHYR_INCLUDE_SYS_MATH_EXTRAS_H_ */
static bool u16_mul_overflow(uint16_t a, uint16_t b, uint16_t *result)
static int u64_count_trailing_zeros(uint64_t x)
static bool u64_mul_overflow(uint64_t a, uint64_t b, uint64_t *result)
static bool u32_add_overflow(uint32_t a, uint32_t b, uint32_t *result)
static bool u32_mul_overflow(uint32_t a, uint32_t b, uint32_t *result)
static int u32_count_trailing_zeros(uint32_t x)
static bool u16_add_overflow(uint16_t a, uint16_t b, uint16_t *result)
static bool size_mul_overflow(size_t a, size_t b, size_t *result)
static bool size_add_overflow(size_t a, size_t b, size_t *result)
static int u32_count_leading_zeros(uint32_t x)
static int u64_count_leading_zeros(uint64_t x)
static bool u64_add_overflow(uint64_t a, uint64_t b, uint64_t *result)
Inline implementation of functions declared in math_extras.h.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Definition: errno.c:36