From 371a9b53c39af36f77a1bedec15befdbd005f12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kr=C3=A1l?= Date: Sat, 15 May 2021 21:31:11 +0200 Subject: [PATCH] fix u64::MAX error on older compilers --- src/decoder/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 4d42499..42c52e0 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -1029,16 +1029,16 @@ impl Decoder { fn invert_colors(buf: &mut DecodingBuffer, color_type: ColorType) { match (color_type, buf) { (ColorType::Gray(64), DecodingBuffer::U64(ref mut buffer)) => { - Self::invert_colors_unsigned(buffer, u64::MAX); + Self::invert_colors_unsigned(buffer, 0xffff_ffff_ffff_ffff); } (ColorType::Gray(32), DecodingBuffer::U32(ref mut buffer)) => { - Self::invert_colors_unsigned(buffer, u32::MAX); + Self::invert_colors_unsigned(buffer, 0xffff_ffff); } (ColorType::Gray(16), DecodingBuffer::U16(ref mut buffer)) => { - Self::invert_colors_unsigned(buffer, u16::MAX); + Self::invert_colors_unsigned(buffer, 0xffff); } (ColorType::Gray(n), DecodingBuffer::U8(ref mut buffer)) if n <= 8 => { - Self::invert_colors_unsigned(buffer, u8::MAX); + Self::invert_colors_unsigned(buffer, 0xff); } (ColorType::Gray(32), DecodingBuffer::F32(ref mut buffer)) => { Self::invert_colors_fp(buffer, 1.0);