aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-06-13 15:07:01 +0200
committerMax <msuraev@sysmocom.de>2017-06-19 11:09:09 +0200
commitdd75bacb781c8a902d4cade1ee4f1c5e9c72e8b0 (patch)
tree7e86b1fb529d1576251780d16ec3c24275ca3744 /include
parent21be83794fb856f93e545ece7d60a451ea26bacc (diff)
Move NUM_BYTES macro to core library
It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/coding/gsm0503_coding.h1
-rw-r--r--include/osmocom/core/utils.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h
index 55375bb9..2f0e6315 100644
--- a/include/osmocom/coding/gsm0503_coding.h
+++ b/include/osmocom/coding/gsm0503_coding.h
@@ -13,7 +13,6 @@
#define GSM0503_GPRS_BURSTS_NBITS (116 * 4)
#define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
-#define NUM_BYTES(N) ((N + 8 - 1) / 8)
enum gsm0503_egprs_mcs {
EGPRS_MCS0,
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 63a73ab4..1d1ebd8a 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -19,6 +19,8 @@
#define OSMO_STRINGIFY(x) #x
/*! \brief Make a value_string entry from an enum value name */
#define OSMO_VALUE_STRING(x) { x, #x }
+/*! \brief Number of bytes necessary to store given BITS */
+#define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8)
#include <stdint.h>
#include <stdio.h>