From 20ce4345061499abc0389e9cd837665a62ad6add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 12 Dec 2017 09:35:31 +0000 Subject: [PATCH] dvb/sim.h: simplify TLV_DECLARE_PARAM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix int-in-bool-context warning from g++: ./dvb/sim.h:206:40: error: ‘<<’ in boolean context, did you mean ‘<’ ? --- dvb/sim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dvb/sim.h b/dvb/sim.h index e575411..1ad62ad 100644 --- a/dvb/sim.h +++ b/dvb/sim.h @@ -203,9 +203,9 @@ static inline bool intf##_append_##name(uint8_t *p_tlv, type i_##name) \ static inline type intf##_find_##name(uint8_t *p_tlv, uint16_t n) \ { \ const uint8_t *p_tlv_n = tlv_find_param(p_tlv, param, n); \ - type i_##name = (type)(p_tlv_n[4]) << 8 * (sizeof(type) - 1); \ + type i_##name = 0; \ int i; \ - for (i = 1; i < sizeof(type); i++) \ + for (i = 0; i < sizeof(type); i++) \ i_##name |= (utype)(p_tlv_n[4 + i]) << 8 * (sizeof(type) - i - 1); \ return i_##name; \ }