Suppress VC++ 2017 signed/unsigned warning
authorBruce Dawson <brucedawson@google.com>
Tue, 24 Jan 2017 05:48:04 +0000 (21:48 -0800)
committerMark Lobodzinski <mark@lunarg.com>
Wed, 25 Jan 2017 02:34:41 +0000 (19:34 -0700)
When building Chrome with VC++ 2017 there is one warning, from passing
an int to a call to std::vector<uint32_t>::find. This change adds a cast
to avoid that warning, thus fixing issue #1395.

layers/core_validation.cpp

index b6b9c82..03f9c5e 100644 (file)
@@ -10220,7 +10220,7 @@ static bool FindDependency(const int index, const int dependent, const std::vect
     processed_nodes.insert(index);
     const DAGNode &node = subpass_to_node[index];
     // Look for a dependency path. If one exists return true else recurse on the previous nodes.
-    if (std::find(node.prev.begin(), node.prev.end(), dependent) == node.prev.end()) {
+    if (std::find(node.prev.begin(), node.prev.end(), static_cast<uint32_t>(dependent)) == node.prev.end()) {
         for (auto elem : node.prev) {
             if (FindDependency(elem, dependent, subpass_to_node, processed_nodes))
                 return true;