layers: PR1276, Fix Clang compiler warnings
fixes
- error: using namespace directive in global context in header
- error: comparison of integers of different signs: 'uint32_t'
(aka 'unsigned int') and 'int'
Change-Id: If56d5b9c33f0de813fbb67120650a887eb9368b0
diff --git a/layers/parameter_validation_utils.h b/layers/parameter_validation_utils.h
index 9e99964..4e4fd81 100644
--- a/layers/parameter_validation_utils.h
+++ b/layers/parameter_validation_utils.h
@@ -95,14 +95,14 @@
const uint32_t ExtEnumBaseValue = 1000000000;
template <typename T> bool is_extension_added_token(T value) {
- return (std::abs(static_cast<int32_t>(value)) >= ExtEnumBaseValue);
+ return (static_cast<uint32_t>(std::abs(static_cast<int32_t>(value))) >= ExtEnumBaseValue);
}
// VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE token is a special case that was converted from a core token to an
// extension added token. Its original value was intentionally preserved after the conversion, so it does not use
// the base value that other extension added tokens use, and it does not fall within the enum's begin/end range.
template <> bool is_extension_added_token(VkSamplerAddressMode value) {
- bool result = (std::abs(static_cast<int32_t>(value)) >= ExtEnumBaseValue);
+ bool result = (static_cast<uint32_t>(std::abs(static_cast<int32_t>(value))) >= ExtEnumBaseValue);
return (result || (value == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE));
}