zephyr/samples
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 scripts: mpu align for ro section of new memory region on non-XIP system 2019-05-21 15:28:59 -04:00
basic samples: basic minimal: add nucleo_f429zi, disco_l475_iot1 to whitelist 2019-06-10 12:42:49 +02:00
bluetooth samples: bluetooth: peripheral: Fix RX buffer size 2019-05-21 16:15:44 -04:00
boards samples: intel_s1000: audio buffers in lpsram 2019-06-11 16:36:30 -04:00
cpp_synchronization license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
display samples: display: ili9340: Add 2 Arduino shield sample configurations. 2019-05-30 09:39:07 -04:00
drivers style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
gui license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
hello_world doc: Remove prj_single.conf from README.rst 2019-04-08 10:45:52 -04:00
mpu doc: sample: mpu Update documentation 2019-04-18 12:24:16 -04:00
net samples: net: echo-server: Ignore the return value of close() 2019-06-09 10:23:57 +03:00
nfc/nfc_hello license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
philosophers pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
portability pointer-type args: cast appropriately to be 64-bit compatible 2019-06-12 08:20:52 -07:00
sensor sample: ti_hdc: whitelist reel_board and nucleo_l496zg 2019-06-11 10:17:11 -05:00
shields doc: fix malformed label in shields doc 2019-06-05 19:46:36 -04:00
subsys samples: fs: Added FS shell sample 2019-06-11 08:31:54 -04:00
synchronization license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
testing/integration license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
userspace style: samples/tests: add braces around if/while statements 2019-06-06 15:20:21 +02:00
xtensa_asm2 license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
classic.rst doc: restructure and create index pages 2019-02-05 07:04:40 -05:00
index.rst doc: use :zephyr_file: where appropriate 2019-03-09 09:50:27 -05:00