Harald Welte has submitted this change and it was merged.

Change subject: mslot_class: find_free_tfi(): use uint32_t to shift 1 << 31
......................................................................


mslot_class: find_free_tfi(): use uint32_t to shift 1 << 31

Avoid runtime error seen on jenkins admin-deb9build slave, when building
osmo-pcu with_dsp=None,with_vty=False, during ts_alloc and tbf regression
tests:

+../../../src/mslot_class.c:242:22: runtime error: left shift of 1 by 31 places 
cannot be represented in type 'int'

The master-osmo-pcu breaks on this since moving to a debian9 build slave.

Change-Id: I0cdf10e5fbc1173a7a09bd4fed8a66d06f80aeb1
---
M src/mslot_class.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/mslot_class.c b/src/mslot_class.c
index 2a482f1..9d54afe 100644
--- a/src/mslot_class.c
+++ b/src/mslot_class.c
@@ -239,7 +239,7 @@
                return -1;
 
        for (tfi = 0; tfi < 32; tfi++) {
-               if (!(tfi_map & (1 << tfi)))
+               if (!(tfi_map & (((uint32_t)1) << tfi)))
                        return tfi;
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cdf10e5fbc1173a7a09bd4fed8a66d06f80aeb1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to