Type conversions, casting helpers, and common data structures.
More...
Type conversions, casting helpers, and common data structures.
Internal utilities and data types used throughout the CMocka API.
◆ assign_double_to_cmocka_value
| #define assign_double_to_cmocka_value |
( |
| value | ) |
|
Value:
{ \
.real_val = ((double)(value)) \
}
Assign a double floating point value to CMockaValueData.
◆ assign_float_to_cmocka_value
| #define assign_float_to_cmocka_value |
( |
| value | ) |
|
Value:
{ \
.float_val = ((float)(value)) \
}
Assign a floating point value to CMockaValueData.
◆ assign_int_to_cmocka_value
| #define assign_int_to_cmocka_value |
( |
| value | ) |
|
Value:
{ \
.int_val = (value) \
}
Assign an integer value to CMockaValueData.
◆ assign_uint_to_cmocka_value
| #define assign_uint_to_cmocka_value |
( |
| value | ) |
|
Value:
{ \
.uint_val = (value) \
}
Assign an unsigned integer value to CMockaValueData.
◆ cast_int_to_cmocka_value
| #define cast_int_to_cmocka_value |
( |
| value | ) |
|
Value:
{ \
.uint_val = (uintmax_t)(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.
◆ cast_ptr_to_cmocka_value
| #define cast_ptr_to_cmocka_value |
( |
| value | ) |
|
◆ cast_ptr_to_uintmax_type
| #define cast_ptr_to_uintmax_type |
( |
| value | ) |
|
Value: ((uintmax_t)(uintptr_t)(value))
◆ cast_to_double_type
| #define cast_to_double_type |
( |
| value | ) |
|
◆ cast_to_float_type
| #define cast_to_float_type |
( |
| value | ) |
|
◆ cast_to_intmax_type
| #define cast_to_intmax_type |
( |
| value | ) |
|
◆ cast_to_uintmax_type
| #define cast_to_uintmax_type |
( |
| value | ) |
|
◆ cast_to_void_pointer
| #define cast_to_void_pointer |
( |
| ptr | ) |
|
Value: ((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.
◆ cmocka_tostring
| #define cmocka_tostring |
( |
| val | ) |
|