aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-07 18:40:01 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-12 15:45:25 +0000
commitc1cf14cae8a4ff8d60976eb188344595755448d5 (patch)
treef5921429cd6c5caac99bd1dd56758357f7a6c192
parentc42c2ca8e00ea5602cdccfaf73ec9fe097c529af (diff)
Fix macro definitions
Wrap macro parameter in brackets to make sure macros always work properly: without it GSM_FN_TO_MS(a - b) will result in a - b * GSM_TDMA_FRAME_MS contrary to the user's expectation of (a - b) * GSM_TDMA_FRAME_MS. Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Reviewed-on: https://gerrit.osmocom.org/217 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
-rw-r--r--include/osmocom/trau/osmo_ortp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h
index eb53a41..7c2a5cb 100644
--- a/include/osmocom/trau/osmo_ortp.h
+++ b/include/osmocom/trau/osmo_ortp.h
@@ -28,8 +28,8 @@ struct _RtpSession;
#define GSM_RTP_FRAME_DURATION_MS 20
#define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS)
#define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME)
-#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS)
-#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS)
+#define GSM_MS_TO_SAMPLES(ms) ((ms) * GSM_VOICE_SAMPLES_PER_MS)
+#define GSM_FN_TO_MS(fn) ((fn) * GSM_TDMA_FRAME_MS)
/*! \brief Parameter to osmo_rtp_socket_param_set() */
enum osmo_rtp_param {