diff options
author | Mark Young <marky@lunarg.com> | 2016-01-25 13:37:06 -0700 |
---|---|---|
committer | Mark Young <marky@lunarg.com> | 2016-01-25 16:04:01 -0700 |
commit | 8928c06b038cad53ce79d821bc10517f45589768 (patch) | |
tree | 136f3e1690b65f2d2c08ae6dbac1c4235a2f2d87 /libs | |
parent | a1a6304c068fc2eca45353f8e7a56b6bb32b5f5e (diff) |
BUILD: Fixed more compilation warnings on 32-bit Windows builds.
Fixed more compilation warnings on 32-bit Windows builds.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/vkjson/vkjson.cc | 2 | ||||
-rw-r--r-- | libs/vkjson/vkjson_info.cc | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/libs/vkjson/vkjson.cc b/libs/vkjson/vkjson.cc index 33395ead..d176f7de 100644 --- a/libs/vkjson/vkjson.cc +++ b/libs/vkjson/vkjson.cc @@ -572,7 +572,7 @@ inline bool AsValue(cJSON* json_value, std::map<F, S>* value) { if (json_value->type != cJSON_Array) return false; int size = cJSON_GetArraySize(json_value); - for (unsigned int i = 0; i < size; ++i) { + for (int i = 0; i < size; ++i) { std::pair<F, S> elem; if (!AsValue(cJSON_GetArrayItem(json_value, i), &elem)) return false; diff --git a/libs/vkjson/vkjson_info.cc b/libs/vkjson/vkjson_info.cc index 134a2311..afa98205 100644 --- a/libs/vkjson/vkjson_info.cc +++ b/libs/vkjson/vkjson_info.cc @@ -35,8 +35,10 @@ #include <iostream> #include <vector> +const uint32_t unsignedNegOne = (uint32_t)(-1); + struct Options { - uint32_t device_index = -1u; + uint32_t device_index = unsignedNegOne; std::string device_name; std::string output_file; }; @@ -70,12 +72,12 @@ bool ParseOptions(int argc, char* argv[], Options* options) { } } } - if (options->device_index != -1u && !options->device_name.empty()) { + if (options->device_index != unsignedNegOne && !options->device_name.empty()) { std::cerr << "Must specify only one of device index and device name." << std::endl; return false; } - if (!options->output_file.empty() && options->device_index == -1u && + if (!options->output_file.empty() && options->device_index == unsignedNegOne && options->device_name.empty()) { std::cerr << "Must specify device index or device name when specifying " "output file" @@ -162,7 +164,7 @@ int main(int argc, char* argv[]) { return 1; } - if (options.device_index != -1u) { + if (options.device_index != unsignedNegOne) { if (static_cast<uint32_t>(options.device_index) >= device_count) { std::cerr << "Error: device " << options.device_index << " requested but only " << device_count << " found." |