mirror of https://gerrit.osmocom.org/libosmocore
utils.h: protect param with parenthesis in OSMO_BYTES_FOR_BITS()
While at it, drop 8-1 in favour of 7. I don't think it is really more understandable for readers to see some subtraction there... Change-Id: I8b21eba9b9aa952f86abe7a6d4cdb1d1a61d9deb
This commit is contained in:
parent
a7f97b9093
commit
812766e231
|
@ -33,7 +33,7 @@
|
|||
/*! Make a value_string entry from an enum value name */
|
||||
#define OSMO_VALUE_STRING(x) { x, #x }
|
||||
/*! Number of bytes necessary to store given BITS */
|
||||
#define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8)
|
||||
#define OSMO_BYTES_FOR_BITS(BITS) (((BITS) + 7) / 8)
|
||||
|
||||
/*! Copy a C-string into a sized buffer using sizeof to detect buffer's size */
|
||||
#define OSMO_STRLCPY_ARRAY(array, src) osmo_strlcpy(array, src, sizeof(array))
|
||||
|
|
Loading…
Reference in New Issue