|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Bounds-checked conversion between fixed-width types (ADR-003). More...
Files | |
| file | src/utils/cast/sapi_cast.c |
| Generated from ADR-003's template; see sapi_cast.h for behavior. Every function widens its input to the int64_t/uint64_t matching the source's signedness, then range-checks against the destination's limit macros before performing the explicit cast. | |
Functions | |
| sapi_status_t | sapi_cast_i8_to_i16 (int8_t in, int16_t *out) |
| Checked cast from int8_t to int16_t. | |
| sapi_status_t | sapi_cast_i8_to_i32 (int8_t in, int32_t *out) |
| Checked cast from int8_t to int32_t. | |
| sapi_status_t | sapi_cast_i8_to_i64 (int8_t in, int64_t *out) |
| Checked cast from int8_t to int64_t. | |
| sapi_status_t | sapi_cast_i8_to_u8 (int8_t in, uint8_t *out) |
| Checked cast from int8_t to uint8_t. | |
| sapi_status_t | sapi_cast_i8_to_u16 (int8_t in, uint16_t *out) |
| Checked cast from int8_t to uint16_t. | |
| sapi_status_t | sapi_cast_i8_to_u32 (int8_t in, uint32_t *out) |
| Checked cast from int8_t to uint32_t. | |
| sapi_status_t | sapi_cast_i8_to_u64 (int8_t in, uint64_t *out) |
| Checked cast from int8_t to uint64_t. | |
| sapi_status_t | sapi_cast_i8_to_size (int8_t in, size_t *out) |
| Checked cast from int8_t to size_t. | |
| sapi_status_t | sapi_cast_i16_to_i8 (int16_t in, int8_t *out) |
| Checked cast from int16_t to int8_t. | |
| sapi_status_t | sapi_cast_i16_to_i32 (int16_t in, int32_t *out) |
| Checked cast from int16_t to int32_t. | |
| sapi_status_t | sapi_cast_i16_to_i64 (int16_t in, int64_t *out) |
| Checked cast from int16_t to int64_t. | |
| sapi_status_t | sapi_cast_i16_to_u8 (int16_t in, uint8_t *out) |
| Checked cast from int16_t to uint8_t. | |
| sapi_status_t | sapi_cast_i16_to_u16 (int16_t in, uint16_t *out) |
| Checked cast from int16_t to uint16_t. | |
| sapi_status_t | sapi_cast_i16_to_u32 (int16_t in, uint32_t *out) |
| Checked cast from int16_t to uint32_t. | |
| sapi_status_t | sapi_cast_i16_to_u64 (int16_t in, uint64_t *out) |
| Checked cast from int16_t to uint64_t. | |
| sapi_status_t | sapi_cast_i16_to_size (int16_t in, size_t *out) |
| Checked cast from int16_t to size_t. | |
| sapi_status_t | sapi_cast_i32_to_i8 (int32_t in, int8_t *out) |
| Checked cast from int32_t to int8_t. | |
| sapi_status_t | sapi_cast_i32_to_i16 (int32_t in, int16_t *out) |
| Checked cast from int32_t to int16_t. | |
| sapi_status_t | sapi_cast_i32_to_i64 (int32_t in, int64_t *out) |
| Checked cast from int32_t to int64_t. | |
| sapi_status_t | sapi_cast_i32_to_u8 (int32_t in, uint8_t *out) |
| Checked cast from int32_t to uint8_t. | |
| sapi_status_t | sapi_cast_i32_to_u16 (int32_t in, uint16_t *out) |
| Checked cast from int32_t to uint16_t. | |
| sapi_status_t | sapi_cast_i32_to_u32 (int32_t in, uint32_t *out) |
| Checked cast from int32_t to uint32_t. | |
| sapi_status_t | sapi_cast_i32_to_u64 (int32_t in, uint64_t *out) |
| Checked cast from int32_t to uint64_t. | |
| sapi_status_t | sapi_cast_i32_to_size (int32_t in, size_t *out) |
| Checked cast from int32_t to size_t. | |
| sapi_status_t | sapi_cast_i64_to_i8 (int64_t in, int8_t *out) |
| Checked cast from int64_t to int8_t. | |
| sapi_status_t | sapi_cast_i64_to_i16 (int64_t in, int16_t *out) |
| Checked cast from int64_t to int16_t. | |
| sapi_status_t | sapi_cast_i64_to_i32 (int64_t in, int32_t *out) |
| Checked cast from int64_t to int32_t. | |
| sapi_status_t | sapi_cast_i64_to_u8 (int64_t in, uint8_t *out) |
| Checked cast from int64_t to uint8_t. | |
| sapi_status_t | sapi_cast_i64_to_u16 (int64_t in, uint16_t *out) |
| Checked cast from int64_t to uint16_t. | |
| sapi_status_t | sapi_cast_i64_to_u32 (int64_t in, uint32_t *out) |
| Checked cast from int64_t to uint32_t. | |
| sapi_status_t | sapi_cast_i64_to_u64 (int64_t in, uint64_t *out) |
| Checked cast from int64_t to uint64_t. | |
| sapi_status_t | sapi_cast_i64_to_size (int64_t in, size_t *out) |
| Checked cast from int64_t to size_t. | |
| sapi_status_t | sapi_cast_u8_to_i8 (uint8_t in, int8_t *out) |
| Checked cast from uint8_t to int8_t. | |
| sapi_status_t | sapi_cast_u8_to_i16 (uint8_t in, int16_t *out) |
| Checked cast from uint8_t to int16_t. | |
| sapi_status_t | sapi_cast_u8_to_i32 (uint8_t in, int32_t *out) |
| Checked cast from uint8_t to int32_t. | |
| sapi_status_t | sapi_cast_u8_to_i64 (uint8_t in, int64_t *out) |
| Checked cast from uint8_t to int64_t. | |
| sapi_status_t | sapi_cast_u8_to_u16 (uint8_t in, uint16_t *out) |
| Checked cast from uint8_t to uint16_t. | |
| sapi_status_t | sapi_cast_u8_to_u32 (uint8_t in, uint32_t *out) |
| Checked cast from uint8_t to uint32_t. | |
| sapi_status_t | sapi_cast_u8_to_u64 (uint8_t in, uint64_t *out) |
| Checked cast from uint8_t to uint64_t. | |
| sapi_status_t | sapi_cast_u8_to_size (uint8_t in, size_t *out) |
| Checked cast from uint8_t to size_t. | |
| sapi_status_t | sapi_cast_u16_to_i8 (uint16_t in, int8_t *out) |
| Checked cast from uint16_t to int8_t. | |
| sapi_status_t | sapi_cast_u16_to_i16 (uint16_t in, int16_t *out) |
| Checked cast from uint16_t to int16_t. | |
| sapi_status_t | sapi_cast_u16_to_i32 (uint16_t in, int32_t *out) |
| Checked cast from uint16_t to int32_t. | |
| sapi_status_t | sapi_cast_u16_to_i64 (uint16_t in, int64_t *out) |
| Checked cast from uint16_t to int64_t. | |
| sapi_status_t | sapi_cast_u16_to_u8 (uint16_t in, uint8_t *out) |
| Checked cast from uint16_t to uint8_t. | |
| sapi_status_t | sapi_cast_u16_to_u32 (uint16_t in, uint32_t *out) |
| Checked cast from uint16_t to uint32_t. | |
| sapi_status_t | sapi_cast_u16_to_u64 (uint16_t in, uint64_t *out) |
| Checked cast from uint16_t to uint64_t. | |
| sapi_status_t | sapi_cast_u16_to_size (uint16_t in, size_t *out) |
| Checked cast from uint16_t to size_t. | |
| sapi_status_t | sapi_cast_u32_to_i8 (uint32_t in, int8_t *out) |
| Checked cast from uint32_t to int8_t. | |
| sapi_status_t | sapi_cast_u32_to_i16 (uint32_t in, int16_t *out) |
| Checked cast from uint32_t to int16_t. | |
| sapi_status_t | sapi_cast_u32_to_i32 (uint32_t in, int32_t *out) |
| Checked cast from uint32_t to int32_t. | |
| sapi_status_t | sapi_cast_u32_to_i64 (uint32_t in, int64_t *out) |
| Checked cast from uint32_t to int64_t. | |
| sapi_status_t | sapi_cast_u32_to_u8 (uint32_t in, uint8_t *out) |
| Checked cast from uint32_t to uint8_t. | |
| sapi_status_t | sapi_cast_u32_to_u16 (uint32_t in, uint16_t *out) |
| Checked cast from uint32_t to uint16_t. | |
| sapi_status_t | sapi_cast_u32_to_u64 (uint32_t in, uint64_t *out) |
| Checked cast from uint32_t to uint64_t. | |
| sapi_status_t | sapi_cast_u32_to_size (uint32_t in, size_t *out) |
| Checked cast from uint32_t to size_t. | |
| sapi_status_t | sapi_cast_u64_to_i8 (uint64_t in, int8_t *out) |
| Checked cast from uint64_t to int8_t. | |
| sapi_status_t | sapi_cast_u64_to_i16 (uint64_t in, int16_t *out) |
| Checked cast from uint64_t to int16_t. | |
| sapi_status_t | sapi_cast_u64_to_i32 (uint64_t in, int32_t *out) |
| Checked cast from uint64_t to int32_t. | |
| sapi_status_t | sapi_cast_u64_to_i64 (uint64_t in, int64_t *out) |
| Checked cast from uint64_t to int64_t. | |
| sapi_status_t | sapi_cast_u64_to_u8 (uint64_t in, uint8_t *out) |
| Checked cast from uint64_t to uint8_t. | |
| sapi_status_t | sapi_cast_u64_to_u16 (uint64_t in, uint16_t *out) |
| Checked cast from uint64_t to uint16_t. | |
| sapi_status_t | sapi_cast_u64_to_u32 (uint64_t in, uint32_t *out) |
| Checked cast from uint64_t to uint32_t. | |
| sapi_status_t | sapi_cast_u64_to_size (uint64_t in, size_t *out) |
| Checked cast from uint64_t to size_t. | |
| sapi_status_t | sapi_cast_size_to_i8 (size_t in, int8_t *out) |
| Checked cast from size_t to int8_t. | |
| sapi_status_t | sapi_cast_size_to_i16 (size_t in, int16_t *out) |
| Checked cast from size_t to int16_t. | |
| sapi_status_t | sapi_cast_size_to_i32 (size_t in, int32_t *out) |
| Checked cast from size_t to int32_t. | |
| sapi_status_t | sapi_cast_size_to_i64 (size_t in, int64_t *out) |
| Checked cast from size_t to int64_t. | |
| sapi_status_t | sapi_cast_size_to_u8 (size_t in, uint8_t *out) |
| Checked cast from size_t to uint8_t. | |
| sapi_status_t | sapi_cast_size_to_u16 (size_t in, uint16_t *out) |
| Checked cast from size_t to uint16_t. | |
| sapi_status_t | sapi_cast_size_to_u32 (size_t in, uint32_t *out) |
| Checked cast from size_t to uint32_t. | |
| sapi_status_t | sapi_cast_size_to_u64 (size_t in, uint64_t *out) |
| Checked cast from size_t to uint64_t. | |
| sapi_status_t | sapi_cast_checked_add_u32 (uint32_t a, uint32_t b, uint32_t *out) |
| Checked addition: *out = a + b, only if the result fits uint32_t. | |
| sapi_status_t | sapi_cast_checked_sub_u32 (uint32_t a, uint32_t b, uint32_t *out) |
| Checked subtraction: *out = a - b, only if b <= a (no underflow). | |
| sapi_status_t | sapi_cast_checked_mul_u32 (uint32_t a, uint32_t b, uint32_t *out) |
| Checked multiplication: *out = a * b, only if the result fits uint32_t. | |
| sapi_status_t | sapi_cast_checked_add_size (size_t a, size_t b, size_t *out) |
| Checked addition: *out = a + b, only if the result fits size_t. | |
| sapi_status_t | sapi_cast_checked_sub_size (size_t a, size_t b, size_t *out) |
| Checked subtraction: *out = a - b, only if b <= a (no underflow). | |
| sapi_status_t | sapi_cast_checked_mul_size (size_t a, size_t b, size_t *out) |
| Checked multiplication: *out = a * b, only if the result fits size_t. | |
| sapi_status_t | sapi_cast_bounds_check (size_t index, size_t count) |
| Checked array/index bounds check: is index a valid index into an array of count elements? | |
Bounds-checked conversion between fixed-width types (ADR-003).
| sapi_status_t sapi_cast_i8_to_i16 | ( | int8_t | in, |
| int16_t * | out ) |
Checked cast from int8_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 13 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_i32 | ( | int8_t | in, |
| int32_t * | out ) |
Checked cast from int8_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 23 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_i64 | ( | int8_t | in, |
| int64_t * | out ) |
Checked cast from int8_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 33 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_u8 | ( | int8_t | in, |
| uint8_t * | out ) |
Checked cast from int8_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 43 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_u16 | ( | int8_t | in, |
| uint16_t * | out ) |
Checked cast from int8_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 58 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_u32 | ( | int8_t | in, |
| uint32_t * | out ) |
Checked cast from int8_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 73 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_u64 | ( | int8_t | in, |
| uint64_t * | out ) |
Checked cast from int8_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 88 of file sapi_cast.c.
| sapi_status_t sapi_cast_i8_to_size | ( | int8_t | in, |
| size_t * | out ) |
Checked cast from int8_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 103 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_i8 | ( | int16_t | in, |
| int8_t * | out ) |
Checked cast from int16_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 124 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_i32 | ( | int16_t | in, |
| int32_t * | out ) |
Checked cast from int16_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 143 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_i64 | ( | int16_t | in, |
| int64_t * | out ) |
Checked cast from int16_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 153 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_u8 | ( | int16_t | in, |
| uint8_t * | out ) |
Checked cast from int16_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 163 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_u16 | ( | int16_t | in, |
| uint16_t * | out ) |
Checked cast from int16_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 182 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_u32 | ( | int16_t | in, |
| uint32_t * | out ) |
Checked cast from int16_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 197 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_u64 | ( | int16_t | in, |
| uint64_t * | out ) |
Checked cast from int16_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 212 of file sapi_cast.c.
| sapi_status_t sapi_cast_i16_to_size | ( | int16_t | in, |
| size_t * | out ) |
Checked cast from int16_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 227 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_i8 | ( | int32_t | in, |
| int8_t * | out ) |
Checked cast from int32_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 248 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_i16 | ( | int32_t | in, |
| int16_t * | out ) |
Checked cast from int32_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 267 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_i64 | ( | int32_t | in, |
| int64_t * | out ) |
Checked cast from int32_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 286 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_u8 | ( | int32_t | in, |
| uint8_t * | out ) |
Checked cast from int32_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 296 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_u16 | ( | int32_t | in, |
| uint16_t * | out ) |
Checked cast from int32_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 315 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_u32 | ( | int32_t | in, |
| uint32_t * | out ) |
Checked cast from int32_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 334 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_u64 | ( | int32_t | in, |
| uint64_t * | out ) |
Checked cast from int32_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 349 of file sapi_cast.c.
| sapi_status_t sapi_cast_i32_to_size | ( | int32_t | in, |
| size_t * | out ) |
Checked cast from int32_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 364 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_i8 | ( | int64_t | in, |
| int8_t * | out ) |
Checked cast from int64_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 385 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_i16 | ( | int64_t | in, |
| int16_t * | out ) |
Checked cast from int64_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 404 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_i32 | ( | int64_t | in, |
| int32_t * | out ) |
Checked cast from int64_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 423 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_u8 | ( | int64_t | in, |
| uint8_t * | out ) |
Checked cast from int64_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 442 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_u16 | ( | int64_t | in, |
| uint16_t * | out ) |
Checked cast from int64_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 461 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_u32 | ( | int64_t | in, |
| uint32_t * | out ) |
Checked cast from int64_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 480 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_u64 | ( | int64_t | in, |
| uint64_t * | out ) |
Checked cast from int64_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 499 of file sapi_cast.c.
| sapi_status_t sapi_cast_i64_to_size | ( | int64_t | in, |
| size_t * | out ) |
Checked cast from int64_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 514 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_i8 | ( | uint8_t | in, |
| int8_t * | out ) |
Checked cast from uint8_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 535 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_i16 | ( | uint8_t | in, |
| int16_t * | out ) |
Checked cast from uint8_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 550 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_i32 | ( | uint8_t | in, |
| int32_t * | out ) |
Checked cast from uint8_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 560 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_i64 | ( | uint8_t | in, |
| int64_t * | out ) |
Checked cast from uint8_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 570 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_u16 | ( | uint8_t | in, |
| uint16_t * | out ) |
Checked cast from uint8_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 580 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_u32 | ( | uint8_t | in, |
| uint32_t * | out ) |
Checked cast from uint8_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 590 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_u64 | ( | uint8_t | in, |
| uint64_t * | out ) |
Checked cast from uint8_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 600 of file sapi_cast.c.
| sapi_status_t sapi_cast_u8_to_size | ( | uint8_t | in, |
| size_t * | out ) |
Checked cast from uint8_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 610 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_i8 | ( | uint16_t | in, |
| int8_t * | out ) |
Checked cast from uint16_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 629 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_i16 | ( | uint16_t | in, |
| int16_t * | out ) |
Checked cast from uint16_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 644 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_i32 | ( | uint16_t | in, |
| int32_t * | out ) |
Checked cast from uint16_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 659 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_i64 | ( | uint16_t | in, |
| int64_t * | out ) |
Checked cast from uint16_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 669 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_u8 | ( | uint16_t | in, |
| uint8_t * | out ) |
Checked cast from uint16_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 679 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_u32 | ( | uint16_t | in, |
| uint32_t * | out ) |
Checked cast from uint16_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 694 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_u64 | ( | uint16_t | in, |
| uint64_t * | out ) |
Checked cast from uint16_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 704 of file sapi_cast.c.
| sapi_status_t sapi_cast_u16_to_size | ( | uint16_t | in, |
| size_t * | out ) |
Checked cast from uint16_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 714 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_i8 | ( | uint32_t | in, |
| int8_t * | out ) |
Checked cast from uint32_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 733 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_i16 | ( | uint32_t | in, |
| int16_t * | out ) |
Checked cast from uint32_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 748 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_i32 | ( | uint32_t | in, |
| int32_t * | out ) |
Checked cast from uint32_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 763 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_i64 | ( | uint32_t | in, |
| int64_t * | out ) |
Checked cast from uint32_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 778 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_u8 | ( | uint32_t | in, |
| uint8_t * | out ) |
Checked cast from uint32_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 788 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_u16 | ( | uint32_t | in, |
| uint16_t * | out ) |
Checked cast from uint32_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 803 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_u64 | ( | uint32_t | in, |
| uint64_t * | out ) |
Checked cast from uint32_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 818 of file sapi_cast.c.
| sapi_status_t sapi_cast_u32_to_size | ( | uint32_t | in, |
| size_t * | out ) |
Checked cast from uint32_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 828 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_i8 | ( | uint64_t | in, |
| int8_t * | out ) |
Checked cast from uint64_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 847 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_i16 | ( | uint64_t | in, |
| int16_t * | out ) |
Checked cast from uint64_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 862 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_i32 | ( | uint64_t | in, |
| int32_t * | out ) |
Checked cast from uint64_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 877 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_i64 | ( | uint64_t | in, |
| int64_t * | out ) |
Checked cast from uint64_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 892 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_u8 | ( | uint64_t | in, |
| uint8_t * | out ) |
Checked cast from uint64_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 907 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_u16 | ( | uint64_t | in, |
| uint16_t * | out ) |
Checked cast from uint64_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 922 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_u32 | ( | uint64_t | in, |
| uint32_t * | out ) |
Checked cast from uint64_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 937 of file sapi_cast.c.
| sapi_status_t sapi_cast_u64_to_size | ( | uint64_t | in, |
| size_t * | out ) |
Checked cast from uint64_t to size_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 952 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_i8 | ( | size_t | in, |
| int8_t * | out ) |
Checked cast from size_t to int8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 971 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_i16 | ( | size_t | in, |
| int16_t * | out ) |
Checked cast from size_t to int16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 987 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_i32 | ( | size_t | in, |
| int32_t * | out ) |
Checked cast from size_t to int32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1003 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_i64 | ( | size_t | in, |
| int64_t * | out ) |
Checked cast from size_t to int64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1019 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_u8 | ( | size_t | in, |
| uint8_t * | out ) |
Checked cast from size_t to uint8_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1035 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_u16 | ( | size_t | in, |
| uint16_t * | out ) |
Checked cast from size_t to uint16_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1051 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_u32 | ( | size_t | in, |
| uint32_t * | out ) |
Checked cast from size_t to uint32_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1067 of file sapi_cast.c.
| sapi_status_t sapi_cast_size_to_u64 | ( | size_t | in, |
| uint64_t * | out ) |
Checked cast from size_t to uint64_t.
| in | Value to convert. |
| out | Receives the converted value on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1083 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_add_u32 | ( | uint32_t | a, |
| uint32_t | b, | ||
| uint32_t * | out ) |
Checked addition: *out = a + b, only if the result fits uint32_t.
| a,b | Operands. |
| out | Receives a + b on success; left untouched on failure (REQ-COMMON-CAST-001). Must not be NULL. |
Definition at line 1094 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_sub_u32 | ( | uint32_t | a, |
| uint32_t | b, | ||
| uint32_t * | out ) |
Checked subtraction: *out = a - b, only if b <= a (no underflow).
| a,b | Operands. |
| out | Receives a - b on success; left untouched on failure. Must not be NULL. |
Definition at line 1115 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_mul_u32 | ( | uint32_t | a, |
| uint32_t | b, | ||
| uint32_t * | out ) |
Checked multiplication: *out = a * b, only if the result fits uint32_t.
| a,b | Operands. |
| out | Receives a * b on success; left untouched on failure. Must not be NULL. |
Definition at line 1131 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_add_size | ( | size_t | a, |
| size_t | b, | ||
| size_t * | out ) |
Checked addition: *out = a + b, only if the result fits size_t.
| a,b | Operands. |
| out | Receives a + b on success; left untouched on failure. Must not be NULL. |
Definition at line 1148 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_sub_size | ( | size_t | a, |
| size_t | b, | ||
| size_t * | out ) |
Checked subtraction: *out = a - b, only if b <= a (no underflow).
| a,b | Operands. |
| out | Receives a - b on success; left untouched on failure. Must not be NULL. |
Definition at line 1167 of file sapi_cast.c.
| sapi_status_t sapi_cast_checked_mul_size | ( | size_t | a, |
| size_t | b, | ||
| size_t * | out ) |
Checked multiplication: *out = a * b, only if the result fits size_t.
| a,b | Operands. |
| out | Receives a * b on success; left untouched on failure. Must not be NULL. |
Definition at line 1183 of file sapi_cast.c.
| sapi_status_t sapi_cast_bounds_check | ( | size_t | index, |
| size_t | count ) |
Checked array/index bounds check: is index a valid index into an array of count elements?
| index | Candidate index. |
| count | Number of elements in the array (a count of 0 means no index is ever valid). |
Definition at line 1199 of file sapi_cast.c.