Fix clang warning: shifting a negative signed value is undefined
authorSoeren Apel <soeren@apelpie.net>
Sun, 31 Jan 2016 17:22:17 +0000 (18:22 +0100)
committerSoeren Apel <soeren@apelpie.net>
Sun, 31 Jan 2016 17:22:17 +0000 (18:22 +0100)
pv/data/logicsegment.cpp

index 3e18b85ef4143bb399c5dd1dcff2fb7e6375d7ed..a5634b30e5d6f93fd0495ae26e9e56dc5325e716 100644 (file)
@@ -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