platform_external_dtc/libfdt
David Gibson 9521dc5ecc libfdt: Abolish _typed() variants, add _cell() variants
In a number of places through libfdt and its tests, we have *_typed()
macro variants on functions which use gcc's typeof and statement
expression extensions to allow passing literals where the underlying
function takes a buffer and size.

These seemed like a good idea at the time, but in fact they have some
problems.  They use typeof and statement expressions, extensions I'd
prefer to avoid for portability.  Plus, they have potential gotchas -
although they'll deal with the size of the thing passed, they won't
deal with other representation issues (like endianness) and results
could be very strange if the type of the expression passed isn't what
you think it is.

In fact, the only users of these _typed() macros were when the value
passed is a single cell (32-bit integer).  Therefore, this patch
removes all these _typed() macros and replaces them with explicit
_cell() variants which handle a single 32-bit integer, and which also
perform endian convesions as appropriate.

With this in place, it now becomes easy to use standardized big-endian
representation for integer valued properties in the testcases,
regardless of the platform we're running on.  We therefore do that,
which has the additional advantage that all the example trees created
during a test run are now byte-for-byte identical regardless of
platform.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-20 09:00:37 -06:00
..
fdt.c libfdt: Rename and publish _fdt_next_tag() 2007-10-24 09:56:27 -05:00
fdt.h Move everything into a subdirectory in preparation for merge into dtc. 2007-06-14 11:58:35 +10:00
fdt_ro.c libfdt: Add phandle related functions 2007-11-13 07:40:06 -06:00
fdt_rw.c libfdt: Handle v16 and re-ordered trees for r/w 2007-11-01 08:03:31 -05:00
fdt_strerror.c Move everything into a subdirectory in preparation for merge into dtc. 2007-06-14 11:58:35 +10:00
fdt_sw.c libfdt: Remove un-const-safe fdt_set_header macro 2007-10-25 09:49:18 -05:00
fdt_wip.c libfdt: Rename and publish _fdt_next_tag() 2007-10-24 09:56:27 -05:00
libfdt.h libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
libfdt_env.h Move everything into a subdirectory in preparation for merge into dtc. 2007-06-14 11:58:35 +10:00
libfdt_internal.h libfdt: Rename and publish _fdt_check_header() 2007-10-24 07:58:13 -05:00
Makefile.libfdt dtc: Refactor Makefiles 2007-10-15 08:28:07 -05:00
TODO Move everything into a subdirectory in preparation for merge into dtc. 2007-06-14 11:58:35 +10:00