zephyr/tests/lib
Nicolas Pitre 6311766d9a pointer-type args: cast appropriately to be 64-bit compatible
Using void pointers as universal arguments is widely used. However, when
compiling a 64-bit target, the compiler doesn't like when an int is
converted to a pointer and vice versa despite the presence of a cast.
This is due to a width mismatch between ints (32 bits) and pointers
(64 bits). The trick is to cast to a widening integer type such as
intptr_t and then cast to
void*.

When appropriate, the INT_TO_POINTER macro is used instead of this
double cast to make things clearer. The converse with POINTER_TO_INT
is also done which also serves as good code annotations.

While at it, remove unneeded casts to specific pointer types from void*
in the vicinity, and move to typed variable upon function entry to make
the code cleaner.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-12 08:20:52 -07:00
..
base64
c_lib Kconfig: introduce CONFIG_64BIT 2019-06-07 17:48:47 -04:00
json
mem_alloc Build: Build with newlib-nano c library 2019-05-15 10:46:44 -05:00
rbtree
ringbuffer pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
sprintf