mirror of https://gerrit.osmocom.org/libosmocore
f6db765327
As shown in the recently added bitgen_test.c, using osmo_loadXXbe_ext() with a smaller n produces results aligned on the most significant bytes, which is cumbersome, since it does not return a previously stored value. This problem exists only for the big-endian functions, the little-endian osmo_loadXXle_ext() properly return values adjusted on the least significant octets. Add osmo_loadXXbe_ext_2() variants that properly right-adjust the returned value. Prominently highlight this behavior in API doc. Test the new functions in bitgen_test.c. For example, this eases handling of 24bit integers (e.g. loaded from buffer to uint32_t, and stored into buffer from uint32_t). Also explicitly show this 24 bit case in bitgen_test.c Change-Id: I2806df6f0f7bf1ad705d52fa386d4525b892b928 |
||
---|---|---|
.. | ||
bitgen_test.c | ||
bitgen_test.ok |