aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/bitXXgen.h.tpl
AgeCommit message (Collapse)AuthorFilesLines
2021-12-14treewide: remove FSF addressOliver Smith1-4/+0
Remove the paragraph about writing to the Free Software Foundation's mailing address. The FSF has changed addresses in the past, and may do so again. In 2021 this is not useful, let's rather have a bit less boilerplate at the start of source files. Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2020-09-14bitXXgen: add osmo_loadXXbe_ext_2() to get right-adjusted valuesNeels Hofmeyr1-2/+19
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
2020-09-14bitXXgen: ensure not reading/storing past valid sizeNeels Hofmeyr1-0/+6
Add OSMO_ASSERT()s to ensure bounds checking. For example, for osmo_store32le_ext(), passing n > 5 would read past the end of the uint32_t. Similarly, osmo_load32le_ext() for n > 4 would write past the uint32_t's end. Change-Id: I2dc21582cd8a679b6624cefbc0c1678b093a3d08
2017-06-23doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr1-8/+8
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2015-10-09commentsNeels Hofmeyr1-2/+2
2014-06-16core/bitXXgen: Don't do 'return' in functions returning voidSylvain Munaut1-2/+2
ISO C forbids 'return' with expression, in function returning void Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16core/bitXXgen: Use explicit cast of void* to uint8_tSylvain Munaut1-4/+6
Turns out we use this header in C++ code ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16core: Add generic LE/BE load/store uint type convertors and use them in msgbMax1-0/+103
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>