layers: Fix MSVS value truncation warning
authorDustin Graves <dustin@lunarg.com>
Wed, 6 Apr 2016 17:06:19 +0000 (11:06 -0600)
committerDustin Graves <dustin@lunarg.com>
Wed, 6 Apr 2016 18:03:51 +0000 (12:03 -0600)
Changed the type of the string validation constants to from char to
uint8_t to fix warning C4309: 'initializing' : truncation of constant
value, due to an implicit unsgined char to signed char conversion.

Change-Id: I86cca4b1a8c3f818a2e7a9a7e38f05ee8cd01150

layers/vk_layer_utils.cpp

index 21c6cd1..12df50e 100644 (file)
@@ -568,14 +568,14 @@ VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor) {
     return result;
 }
 
-static const char UTF8_ONE_BYTE_CODE = 0xC0;
-static const char UTF8_ONE_BYTE_MASK = 0xE0;
-static const char UTF8_TWO_BYTE_CODE = 0xE0;
-static const char UTF8_TWO_BYTE_MASK = 0xF0;
-static const char UTF8_THREE_BYTE_CODE = 0xF0;
-static const char UTF8_THREE_BYTE_MASK = 0xF8;
-static const char UTF8_DATA_BYTE_CODE = 0x80;
-static const char UTF8_DATA_BYTE_MASK = 0xC0;
+static const uint8_t UTF8_ONE_BYTE_CODE = 0xC0;
+static const uint8_t UTF8_ONE_BYTE_MASK = 0xE0;
+static const uint8_t UTF8_TWO_BYTE_CODE = 0xE0;
+static const uint8_t UTF8_TWO_BYTE_MASK = 0xF0;
+static const uint8_t UTF8_THREE_BYTE_CODE = 0xF0;
+static const uint8_t UTF8_THREE_BYTE_MASK = 0xF8;
+static const uint8_t UTF8_DATA_BYTE_CODE = 0x80;
+static const uint8_t UTF8_DATA_BYTE_MASK = 0xC0;
 
 VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) {
     VkStringErrorFlags result = VK_STRING_ERROR_NONE;