integer arithmetic types: make get_uint32, get_uint16 return the correct type
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Jun 2011 21:37:24 +0000 (22:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jun 2011 11:07:26 +0000 (12:07 +0100)
commit6fbd4b99bc50cf9cd54a1b6e2b2c96c4ba4a9b19
tree75689a7dd72042c011cc0694190ea25f59d582d0
parent0009e60a914ef5239ba2f8cc19e07ab5368e49b1
integer arithmetic types: make get_uint32, get_uint16 return the correct type

Previously get_uint32 and get_uint16 would return whatever the usual
arithmetic conversions produced.  (The previous code was not in fact
even guaranteed to work properly on a machine with 16-bit ints.)

Now we cast the individual bytes before shifting.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
unaligned.h