$darkmode
Type conversions, casting helpers, and common data structures. More...
Data Structures | |
| union | CMockaValueData |
Macros | |
| #define | cast_to_intmax_type(value) ((intmax_t)(value)) |
| #define | cast_to_uintmax_type(value) ((uintmax_t)(value)) |
| #define | cast_ptr_to_uintmax_type(value) ((uintmax_t)(uintptr_t)(value)) |
| #define | cast_to_double_type(value) ((double)(value)) |
| #define | cast_to_float_type(value) ((float)(value)) |
| #define | cast_to_void_pointer(ptr) ((void *)(uintptr_t)(ptr)) |
| #define | cast_int_to_cmocka_value(value) |
| #define | cast_ptr_to_cmocka_value(value) |
| #define | assign_int_to_cmocka_value(value) |
| #define | assign_uint_to_cmocka_value(value) |
| #define | assign_float_to_cmocka_value(value) |
| #define | assign_double_to_cmocka_value(value) |
| #define | cmocka_tostring(val) #val |
Type conversions, casting helpers, and common data structures.
Internal utilities and data types used throughout the CMocka API.
| #define assign_double_to_cmocka_value | ( | value | ) |
Assign a double floating point value to CMockaValueData.
| #define assign_float_to_cmocka_value | ( | value | ) |
Assign a floating point value to CMockaValueData.
| #define assign_int_to_cmocka_value | ( | value | ) |
Assign an integer value to CMockaValueData.
| #define assign_uint_to_cmocka_value | ( | value | ) |
Assign an unsigned integer value to CMockaValueData.
| #define cast_int_to_cmocka_value | ( | value | ) |
Perform a cast from an integer to CMockaValueData.
For backwards compatibility reasons, this explicitly casts to uintmax_t. For most compilers, this will suppress warnings about passing float/intmax_t to this macro.
| #define cast_ptr_to_cmocka_value | ( | value | ) |
Perform a cast from a pointer to CMockaValueData.
| #define cast_to_void_pointer | ( | ptr | ) | ((void *)(uintptr_t)(ptr)) |
Perform cast to void pointer.
ISO C forbids conversion between function pointers and void*. This macro provides a portable way to perform such conversions by casting through uintptr_t, which is allowed by POSIX and works on all practical platforms.