fix: byte_width_ = 1U << static_cast<BitWidth>(packed_type & 3) implicit conversion loses integer precision: 'unsigned int' to 'uint8_t' (aka 'unsigned char') [-Werror,-Wimplicit-int-conversion] (#7697)

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
郭浩伟
2022-12-07 13:19:54 +08:00
committed by GitHub
parent b5ebd3fd78
commit aadc4cb8be

View File

@@ -384,7 +384,7 @@ class Reference {
Reference(const uint8_t *data, uint8_t parent_width, uint8_t packed_type)
: data_(data), parent_width_(parent_width) {
byte_width_ = 1U << static_cast<BitWidth>(packed_type & 3);
byte_width_ = static_cast<BitWidth>(1U << (packed_type & 3));
type_ = static_cast<Type>(packed_type >> 2);
}