diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-26 23:24:14 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-28 14:44:47 +0200 |
commit | f75381498ca298679e8dfba63cc4e33e0b969a17 (patch) | |
tree | 4850ff7d3bb856e224c3b66d13ee859cac06cdcb | |
parent | 8b4bd46b9503fe5d2ec58d1cfcb17330e2cdd794 (diff) |
mslot_class: two more: 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:271:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
+../../../src/mslot_class.c:272:22: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
This time it seems that these are all.
The master-osmo-pcu breaks on this since moving to a debian9 build slave.
Change-Id: I976a1dca9da19a05afc85a17b7ba60545b7bc1e5
-rw-r--r-- | src/mslot_class.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mslot_class.c b/src/mslot_class.c index 9d54afee..ff40f297 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -268,8 +268,8 @@ uint16_t mslot_wrap_window(uint16_t win) bool mslot_test_and_set_bit(uint32_t *bits, size_t elem) { - bool was_set = bits[elem/32] & (1 << (elem % 32)); - bits[elem/32] |= (1 << (elem % 32)); + bool was_set = bits[elem/32] & (((uint32_t)1) << (elem % 32)); + bits[elem/32] |= (((uint32_t)1) << (elem % 32)); return was_set; } |