Skip to content
Commit a88032ec authored by Gary E. Miller's avatar Gary E. Miller 💬
Browse files

binio: change get_lsb_ulong() to get_lsb_int32()

And add macro get_lsb_uint32().  Enable 2 commented out tests that
now pass.o
Since get_lsb_ulong() was sometimes used as an int_32_t and sometimes
as  a uint32_t this makes the code more explicit anf finesses different
CC doing different, and incompatible, things with the code.

It turns out that some, not all, CC will promote an (unsigned char)
to (int) when you left shift it.  This is required in C99 6.3.1.1.2.
But Solaris does not do that.  Then when the new int is sign extended
and ORed in an unsigned, bad things happen.
parent 12673d37
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment