The following section spawns a C4804 warning when the template type T is bool:
geometry_attribute.h(290,13): warning C4804: '<': unsafe use of type 'bool' in operation
geometry_attribute.h(290,35): warning C4804: '>': unsafe use of type 'bool' in operation
|
if (std::is_integral<T>::value && std::is_integral<OutT>::value) { |
|
static constexpr OutT kOutMin = |
|
std::is_signed<T>::value ? std::numeric_limits<OutT>::lowest() : 0; |
|
if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) { |
|
return false; |
|
} |
|
} |
This warning can be avoided by skipping the check when type T is bool. This check can be skipped safely since we are guaranteed that bool will fit in the output type OutT, given that OutT is an integral type.
Suggested change on Line 287:
if (!std::is_same<T, bool>::value && std::is_integral<T>::value && std::is_integral<OutT>::value) {
The following section spawns a C4804 warning when the template type
Tisbool:draco/src/draco/attributes/geometry_attribute.h
Lines 287 to 293 in 9522c22
This warning can be avoided by skipping the check when type
Tisbool. This check can be skipped safely since we are guaranteed thatboolwill fit in the output typeOutT, given thatOutTis an integral type.Suggested change on Line 287: