From e4afbe83c7b5df8673b843bcaa7dc98bce036d3c Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Wed, 6 Jul 2016 11:19:42 -0400 Subject: loader: Fix 2 warnings detected in VS2015. warning C4456: declaration of 'i' hides previous local declaration warning C4244: '=': conversion from 'int' to 'uint16_t', possible loss of data Change-Id: I651de053b206afa36fce27af92ffbe0a608e89d0 --- loader/loader.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'loader') diff --git a/loader/loader.c b/loader/loader.c index 6deadd2b..d0cdc00b 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -2400,13 +2400,13 @@ loader_add_layer_properties(const struct loader_instance *inst, // Get the major/minor/and patch as integers for easier comparison vers_tok = strtok(file_vers, ".\"\n\r"); if (NULL != vers_tok) { - file_major_vers = atoi(vers_tok); + file_major_vers = (uint16_t)atoi(vers_tok); vers_tok = strtok(NULL, ".\"\n\r"); if (NULL != vers_tok) { - file_minor_vers = atoi(vers_tok); + file_minor_vers = (uint16_t)atoi(vers_tok); vers_tok = strtok(NULL, ".\"\n\r"); if (NULL != vers_tok) { - file_patch_vers = atoi(vers_tok); + file_patch_vers = (uint16_t)atoi(vers_tok); } } } @@ -2831,13 +2831,13 @@ VkResult loader_icd_scan(const struct loader_instance *inst, // Get the major/minor/and patch as integers for easier comparison vers_tok = strtok(file_vers, ".\"\n\r"); if (NULL != vers_tok) { - file_major_vers = atoi(vers_tok); + file_major_vers = (uint16_t)atoi(vers_tok); vers_tok = strtok(NULL, ".\"\n\r"); if (NULL != vers_tok) { - file_minor_vers = atoi(vers_tok); + file_minor_vers = (uint16_t)atoi(vers_tok); vers_tok = strtok(NULL, ".\"\n\r"); if (NULL != vers_tok) { - file_patch_vers = atoi(vers_tok); + file_patch_vers = (uint16_t)atoi(vers_tok); } } } @@ -2952,7 +2952,6 @@ void loader_layer_scan(const struct loader_instance *inst, struct loader_manifest_files manifest_files[2]; // [0] = explicit, [1] = implicit cJSON *json; - uint32_t i; uint32_t implicit; bool lockedMutex = false; @@ -2986,7 +2985,7 @@ void loader_layer_scan(const struct loader_instance *inst, loader_platform_thread_lock_mutex(&loader_json_lock); lockedMutex = true; for (implicit = 0; implicit < 2; implicit++) { - for (i = 0; i < manifest_files[implicit].count; i++) { + for (uint32_t i = 0; i < manifest_files[implicit].count; i++) { file_str = manifest_files[implicit].filename_list[i]; if (file_str == NULL) continue; -- cgit v1.2.3