zephyr/tests/kernel
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
..
arm_irq_vector_table tests: adjust stack size for mps2_an385's coverage test 2019-04-11 17:59:39 -04:00
arm_runtime_nmi license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
boot_page_table license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
common pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
context pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
critical sanitycheck: CONFIG_TEST_USERSPACE / userspace tag cleanup 2019-05-30 08:45:39 -04:00
device tests/kernel/device: extends test for code coverage 2019-05-01 10:38:03 -04:00
early_sleep license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
fatal tests/kernel/fatal: Fix wait-for-interrupt delay in stack check test 2019-06-03 12:03:48 -07:00
fifo pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
fp_sharing tests: kernel: fp_sharing: minor fix in #ifdef expression 2019-04-10 10:59:46 -04:00
gen_isr_table tests: kernel: Exclude platforms stm32_min_dev_* 2019-04-26 03:34:45 -07:00
interrupt tests: kernel: Exclude platforms stm32_min_dev_* 2019-04-26 03:34:45 -07:00
lifo pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
mbox pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
mem_heap/mheap_api_concept license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
mem_pool memslab/mempool: make tests 64-bit compatible 2019-06-11 09:38:06 -07:00
mem_protect tests: kernel: userspace: explicitly declare function for the test 2019-05-30 09:00:05 -05:00
mem_slab memslab/mempool: make tests 64-bit compatible 2019-06-11 09:38:06 -07:00
mp license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
msgq/msgq_api license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
mutex tests: adjust stack size for mps2_an385's coverage test 2019-04-11 17:59:39 -04:00
obj_tracing memslab/mempool: make tests 64-bit compatible 2019-06-11 09:38:06 -07:00
pending license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
pipe tests: pipe: fix error with optimization disabled 2019-05-02 07:22:37 -04:00
poll license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
profiling/profiling_api tests: adjust stack size for mps2_an385's coverage test 2019-04-11 17:59:39 -04:00
queue license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
sched pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
semaphore pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
sleep tests/kernel/sleep: add tests for k_usleep() API 2019-05-21 23:09:16 -04:00
smp license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
spinlock license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
stack license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
static_idt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
threads pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
tickless tests: tickless_concept: disable for coverage 2019-06-06 09:29:12 -07:00
timer tests: timer_api: Fix timer synchronization 2019-06-06 09:31:26 -04:00
workq style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
xip license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00