aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-07 09:00:34 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-08 17:09:38 -0600
commit72534d797af6cb8cd1111d612eb815b37bd88d56 (patch)
tree25205906c29e02df994b3580136733d86d789d80
parentb91cc0a75542de2639ec2498508807d50ce8b0a9 (diff)
downloadusermoji-72534d797af6cb8cd1111d612eb815b37bd88d56.tar.xz
layers: Fix Windows compile warnings
-rw-r--r--layers/mem_tracker.cpp4
-rw-r--r--layers/swapchain.cpp22
-rw-r--r--loader/loader.c2
-rw-r--r--loader/loader.h2
4 files changed, 15 insertions, 15 deletions
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index 3b322bc9..bfd85326 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -1644,7 +1644,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
if (result == VK_SUCCESS) {
loader_platform_thread_lock_mutex(&globalLock);
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
add_object_create_info(pPipelines[i].handle, VK_OBJECT_TYPE_PIPELINE, &pCreateInfos[i]);
}
loader_platform_thread_unlock_mutex(&globalLock);
@@ -1662,7 +1662,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines(
VkResult result = get_dispatch_table(mem_tracker_device_table_map, device)->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
if (result == VK_SUCCESS) {
loader_platform_thread_lock_mutex(&globalLock);
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
add_object_create_info(pPipelines[i].handle, VK_OBJECT_TYPE_PIPELINE, &pCreateInfos[i]);
}
loader_platform_thread_unlock_mutex(&globalLock);
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index 304f96b4..38d8e948 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -298,7 +298,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(VkInstance instance, u
(*pPhysicalDeviceCount > 0)) {
// Record the VkPhysicalDevices returned by the ICD:
SwpInstance *pInstance = &instanceMap[instance];
- for (int i = 0; i < *pPhysicalDeviceCount; i++) {
+ for (uint32_t i = 0; i < *pPhysicalDeviceCount; i++) {
physicalDeviceMap[pPhysicalDevices[i]].physicalDevice =
pPhysicalDevices[i];
physicalDeviceMap[pPhysicalDevices[i]].pInstance = pInstance;
@@ -508,7 +508,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetSurfaceFormatsKHR(VkDevice device, const VkS
pDevice->pSurfaceFormats = (VkSurfaceFormatKHR *)
malloc(*pCount * sizeof(VkSurfaceFormatKHR));
if (pDevice->pSurfaceFormats) {
- for (int i = 0 ; i < *pCount ; i++) {
+ for (uint32_t i = 0 ; i < *pCount ; i++) {
pDevice->pSurfaceFormats[i] = pSurfaceFormats[i];
}
} else {
@@ -554,7 +554,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetSurfacePresentModesKHR(VkDevice device, cons
pDevice->pPresentModes = (VkPresentModeKHR *)
malloc(*pCount * sizeof(VkPresentModeKHR));
if (pDevice->pSurfaceFormats) {
- for (int i = 0 ; i < *pCount ; i++) {
+ for (uint32_t i = 0 ; i < *pCount ; i++) {
pDevice->pPresentModes[i] = pPresentModes[i];
}
} else {
@@ -734,7 +734,7 @@ static VkBool32 validateCreateSwapchainKHR(VkDevice device, const VkSwapchainCre
bool foundFormat = false;
bool foundColorSpace = false;
bool foundMatch = false;
- for (int i = 0 ; i < pDevice->surfaceFormatCount ; i++) {
+ for (uint32_t i = 0 ; i < pDevice->surfaceFormatCount ; i++) {
if (pCreateInfo->imageFormat == pDevice->pSurfaceFormats[i].format) {
// Validate pCreateInfo->imageColorSpace against
// VkSurfaceFormatKHR::colorSpace:
@@ -790,7 +790,7 @@ static VkBool32 validateCreateSwapchainKHR(VkDevice device, const VkSwapchainCre
// Validate pCreateInfo->presentMode against
// vkGetSurfacePresentModesKHR():
bool foundMatch = false;
- for (int i = 0 ; i < pDevice->presentModeCount ; i++) {
+ for (uint32_t i = 0 ; i < pDevice->presentModeCount ; i++) {
if (pDevice->pPresentModes[i] == pCreateInfo->presentMode) {
foundMatch = true;
break;
@@ -936,7 +936,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(VkDevice device, VkSwapch
// Record the images and their state:
if (pSwapchain) {
pSwapchain->imageCount = *pCount;
- for (int i = 0 ; i < *pCount ; i++) {
+ for (uint32_t i = 0 ; i < *pCount ; i++) {
pSwapchain->images[i].image = pSwapchainImages[i];
pSwapchain->images[i].pSwapchain = pSwapchain;
pSwapchain->images[i].ownedByApp = false;
@@ -981,8 +981,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkAcquireNextImageKHR(VkDevice device, VkSwapchai
} else {
// Look to see if the application is trying to own too many images at
// the same time (i.e. not leave any to display):
- int imagesOwnedByApp = 0;
- for (int i = 0 ; i < pSwapchain->imageCount ; i++) {
+ uint32_t imagesOwnedByApp = 0;
+ for (uint32_t i = 0 ; i < pSwapchain->imageCount ; i++) {
if (pSwapchain->images[i].ownedByApp) {
imagesOwnedByApp++;
}
@@ -1034,8 +1034,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueuePresentKHR(VkQueue queue, VkPresentInfoKHR
VkBool32 skipCall = VK_FALSE;
layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map);
- for (int i = 0; i < pPresentInfo->swapchainCount ; i++) {
- int index = pPresentInfo->imageIndices[i];
+ for (uint32_t i = 0; i < pPresentInfo->swapchainCount ; i++) {
+ uint32_t index = pPresentInfo->imageIndices[i];
SwpSwapchain *pSwapchain =
&swapchainMap[pPresentInfo->swapchains[i].handle];
if (pSwapchain) {
@@ -1084,7 +1084,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueuePresentKHR(VkQueue queue, VkPresentInfoKHR
pPresentInfo);
if ((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR)) {
- for (int i = 0; i < pPresentInfo->swapchainCount ; i++) {
+ for (uint32_t i = 0; i < pPresentInfo->swapchainCount ; i++) {
int index = pPresentInfo->imageIndices[i];
SwpSwapchain *pSwapchain =
&swapchainMap[pPresentInfo->swapchains[i].handle];
diff --git a/loader/loader.c b/loader/loader.c
index 2258ca71..51b9c6b0 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1841,7 +1841,7 @@ void loader_icd_scan(
continue;
}
char *fullpath;
- uint32_t path_len;
+ size_t path_len;
char *rel_base;
// Print out the paths being searched if debugging is enabled
loader_log(VK_DBG_REPORT_DEBUG_BIT, 0, "Searching for ICD drivers named %s default dir %s\n", library_path, DEFAULT_VK_DRIVERS_PATH);
diff --git a/loader/loader.h b/loader/loader.h
index e96df3e9..4956ae68 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -192,7 +192,7 @@ struct loader_struct {
struct loader_instance *instances;
unsigned int loaded_layer_lib_count;
- unsigned int loaded_layer_lib_capacity;
+ size_t loaded_layer_lib_capacity;
struct loader_lib_info *loaded_layer_lib_list;
// TODO add ref counting of ICD libraries
// TODO use this struct loader_layer_library_list scanned_layer_libraries;