aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2018-03-19 13:52:00 +0100
committercbdev <cb@cbcdn.com>2018-03-19 13:52:00 +0100
commit5728f0caf293ba7e6c5f5f695c4cf8e9057972fd (patch)
tree086cefd35c9f21305332b013bee1aef11ae5b187
parent0baabf2d6278254b0b1060ce72e40188b42f35e4 (diff)
downloadmidimonster-5728f0caf293ba7e6c5f5f695c4cf8e9057972fd.tar.gz
midimonster-5728f0caf293ba7e6c5f5f695c4cf8e9057972fd.tar.bz2
midimonster-5728f0caf293ba7e6c5f5f695c4cf8e9057972fd.zip
Clarify integer promotion in sACN backend (Coverity CIDs 264891, 264889)
-rw-r--r--backends/sacn.c4
1 files changed, 2 insertions, 2 deletions
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{