Use size_t instead of uint32_t in test_icd
authorCharles Giessen <charles@lunarg.com>
Tue, 25 Jan 2022 18:52:54 +0000 (11:52 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 25 Jan 2022 19:32:56 +0000 (12:32 -0700)
Compiler complained about possible loss of data. This fixes it.

tests/framework/icd/test_icd.cpp

index 775aa7bec9f8df501879e553363257aac0f1640b..978429d87965bab526c774918f75a8b73d35808d 100644 (file)
@@ -760,8 +760,8 @@ VKAPI_ATTR void VKAPI_CALL test_vkGetPhysicalDeviceProperties(VkPhysicalDevice p
     if (nullptr != pProperties) {
         auto& phys_dev = icd.GetPhysDevice(physicalDevice);
         memcpy(pProperties, &phys_dev.properties, sizeof(VkPhysicalDeviceProperties));
-        uint32_t max_len = (phys_dev.deviceName.length() > VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) ? VK_MAX_PHYSICAL_DEVICE_NAME_SIZE
-                                                                                             : phys_dev.deviceName.length();
+        size_t max_len = (phys_dev.deviceName.length() > VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) ? VK_MAX_PHYSICAL_DEVICE_NAME_SIZE
+                                                                                           : phys_dev.deviceName.length();
         std::copy(phys_dev.deviceName.c_str(), phys_dev.deviceName.c_str() + max_len, pProperties->deviceName);
         pProperties->deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - 1] = '\0';
     }