platform_external_dtc/pylibfdt
Simon Glass 49d32ce40b pylibfdt: Use an unsigned type for fdt32_t
The members of struct fdt_header are declared as fdt32_t which is a
32-bit, big-endian, unsigned integer. These fields are accessed by macros
in libfdt.h so no return type is declared. But the correct return type is
uint32_t, not fdt32_t, since the endianness conversion is done within the
macro before returning the value.

The macros are re-declared as normal functions in pylibfdt since swig does
not support macros. The return type is currently int. Change it to
uint32_t, which allows us to drop the work-around mask in Fdt.magic().

Also change the typedef for fdt32_t to uint32_t. The currently has no
obvious effect, since use of big-endian values should always be internal
to pylibfdt, but it is more correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-06-13 16:32:55 +10:00
..
.gitignore Add an initial Python library for libfdt 2017-03-21 16:21:58 +11:00
libfdt.i pylibfdt: Use an unsigned type for fdt32_t 2018-06-13 16:32:55 +10:00
Makefile.pylibfdt pylibfdt: Use setup.py to build the swig file 2017-04-08 11:54:07 +10:00
setup.py pylibfdt: Use Python2 explicitly 2017-09-27 18:10:02 +10:00