zephyr/tests
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
..
application_development style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
benchmarks pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
bluetooth Bluetooth: Controller: Test for user extensions 2019-06-06 12:38:13 +02:00
boards style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
booting/stub license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
cmsis_rtos_v1 tests: cmsis_rtos_v1: remove cast abuses 2019-06-01 10:21:13 -04:00
cmsis_rtos_v2 lib: cmsis_v2: set default dynamic stack size 2019-05-02 15:42:33 -04:00
crypto tests: mbedtls: Call mbedtls_platform_set_printf() only if needed 2019-05-23 09:27:59 -04:00
drivers tests: build_all: add TI HDC sensor 2019-06-11 10:17:11 -05:00
kernel pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
lib pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
misc license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
net tests: net: udp: Add tests for SO_PRIORITY and setsockopt 2019-06-09 12:54:05 +03:00
posix sanitycheck: CONFIG_TEST_USERSPACE / userspace tag cleanup 2019-05-30 08:45:39 -04:00
shell shell: add test for new built-in command 2019-05-24 11:04:42 +02:00
subsys style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
unit misc: Always test the portable version of the math_extras.h functions. 2019-05-14 19:53:30 -05:00
ztest subsys/testsuite/ztest: change zassert_mem_equal to macro 2019-06-03 09:39:37 -04:00