diff --git a/libredex/DexOutput.h b/libredex/DexOutput.h index 1fe85e8377f..2eb18033f88 100644 --- a/libredex/DexOutput.h +++ b/libredex/DexOutput.h @@ -313,11 +313,11 @@ class DexOutput { enhanced_dex_stats_t m_stats; static constexpr size_t kIODILayerBits = 4; - static constexpr size_t kIODILayerBound = 1 << (kIODILayerBits - 1); + static constexpr size_t kIODILayerBound = 1ul << (kIODILayerBits - 1); static constexpr size_t kIODILayerShift = sizeof(uint32_t) * 8 - kIODILayerBits; - static constexpr uint32_t kIODIDataMask = (1 << kIODILayerShift) - 1; - static constexpr uint32_t kIODILayerMask = ((1 << kIODILayerBits) - 1) + static constexpr uint32_t kIODIDataMask = (1u << kIODILayerShift) - 1; + static constexpr uint32_t kIODILayerMask = ((1u << kIODILayerBits) - 1) << kIODILayerShift; private: diff --git a/libresource/androidfw/ResourceTypes.h b/libresource/androidfw/ResourceTypes.h index dbc3a2622a2..1097a65d293 100644 --- a/libresource/androidfw/ResourceTypes.h +++ b/libresource/androidfw/ResourceTypes.h @@ -237,7 +237,7 @@ struct Res_value // Where the actual value is. This gives us 23 bits of // precision. The top bit is the sign. COMPLEX_MANTISSA_SHIFT = 8, - COMPLEX_MANTISSA_MASK = 0xffffff + COMPLEX_MANTISSA_MASK = 0xffffffU }; // Possible data values for TYPE_NULL.