demarshall: add missing parens in BE read_xxx functions

The missing parens causes build to fail on big-endian machines
This commit is contained in:
Christophe Fergeau 2012-04-06 15:25:34 +02:00
parent 534d35cc32
commit 725b5a9b53

View File

@ -50,7 +50,7 @@ def write_parser_helpers(writer):
writer.macro("read_%s" % type, "ptr", "(*((%s_t *)(ptr)))" % type)
writer.macro("write_%s" % type, "ptr, val", "*(%s_t *)(ptr) = val" % (type))
else:
writer.macro("read_%s" % type, "ptr", "((%s_t)%s(*((%s_t *)(ptr)))" % (type, swap, utype))
writer.macro("read_%s" % type, "ptr", "((%s_t)%s(*((%s_t *)(ptr))))" % (type, swap, utype))
writer.macro("write_%s" % type, "ptr, val", "*(%s_t *)(ptr) = %s((%s_t)val)" % (utype, swap, utype))
writer.writeln("#else")
for size in [8, 16, 32, 64]: