From 5728f0caf293ba7e6c5f5f695c4cf8e9057972fd Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 19 Mar 2018 13:52:00 +0100 Subject: Clarify integer promotion in sACN backend (Coverity CIDs 264891, 264889) --- backends/sacn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/sacn.c b/backends/sacn.c index 7fc7a59..a0ac493 100644 --- a/backends/sacn.c +++ b/backends/sacn.c @@ -476,8 +476,8 @@ static int sacn_process_frame(instance* inst, sacn_frame_root* frame, sacn_frame //generate value if(IS_WIDE(inst_data->data.map[u])){ inst_data->data.map[MAPPED_CHANNEL(inst_data->data.map[u])] &= ~MAP_MARK; - val.raw.u64 = inst_data->data.in[u] << ((inst_data->data.map[u] & MAP_COARSE) ? 8 : 0); - val.raw.u64 |= inst_data->data.in[MAPPED_CHANNEL(inst_data->data.map[u])] << ((inst_data->data.map[u] & MAP_COARSE) ? 0 : 8); + val.raw.u64 = (uint16_t) (inst_data->data.in[u] << ((inst_data->data.map[u] & MAP_COARSE) ? 8 : 0)); + val.raw.u64 |= (uint16_t) (inst_data->data.in[MAPPED_CHANNEL(inst_data->data.map[u])] << ((inst_data->data.map[u] & MAP_COARSE) ? 0 : 8)); val.normalised = (double) val.raw.u64 / (double) 0xFFFF; } else{ -- cgit v1.2.3