From: Soeren Apel Date: Sun, 31 Jan 2016 17:22:17 +0000 (+0100) Subject: Fix clang warning: shifting a negative signed value is undefined X-Git-Tag: pulseview-0.4.0~348 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c28fa62bc89656ba3b1b01011a45e941d6c7d42a;p=pulseview.git Fix clang warning: shifting a negative signed value is undefined --- diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index 3e18b85e..a5634b30 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -308,7 +308,7 @@ void LogicSegment::get_subsampled_edges( pow2_ceil(index, MipMapScalePower)); for (; index < final_index && - (index & ~(~0 << MipMapScalePower)) != 0; + (index & ~((uint64_t)(~0) << MipMapScalePower)) != 0; index++) { const bool sample = (get_sample(index) & sig_mask) != 0; @@ -358,7 +358,7 @@ void LogicSegment::get_subsampled_edges( sig_mask)) break; - if ((offset & ~(~0 << MipMapScalePower)) == 0) { + if ((offset & ~((uint64_t)(~0) << MipMapScalePower)) == 0) { // If we are now at the beginning of a // higher level mip-map block ascend one // level