[PATCH] libosmo-abis[master]: Fix macro definitions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Jun 10 12:03:32 UTC 2016


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/217

to look at the new patch set (#2).

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
---
M include/osmocom/trau/osmo_ortp.h
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/17/217/2

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 @@
 #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 {

-- 
To view, visit https://gerrit.osmocom.org/217
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list