vulkaninfo: fix msvc warnings from wrapper classes
authorCharles Giessen <charles@lunarg.com>
Fri, 27 Mar 2020 18:03:01 +0000 (12:03 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 3 Apr 2020 17:59:29 +0000 (11:59 -0600)
Change-Id: Ie4ec90d05ba5c394df5d020eecee1c061e1010ac

vulkaninfo/outputprinter.h

index 3fce9b9..6cce4e2 100644 (file)
@@ -710,8 +710,9 @@ class IndentWrapper {
 
 class ObjectWrapper {
    public:
-    ObjectWrapper(Printer &p, std::string object_name, int32_t count_subobjects = -1) : p(p) {
-        p.ObjectStart(object_name, count_subobjects);
+    ObjectWrapper(Printer &p, std::string object_name) : p(p) { p.ObjectStart(object_name); }
+    ObjectWrapper(Printer &p, std::string object_name, size_t count_subobjects) : p(p) {
+        p.ObjectStart(object_name, static_cast<int32_t>(count_subobjects));
     }
     ~ObjectWrapper() { p.ObjectEnd(); }
 
@@ -721,7 +722,9 @@ class ObjectWrapper {
 
 class ArrayWrapper {
    public:
-    ArrayWrapper(Printer &p, std::string array_name, int32_t element_count = 0) : p(p) { p.ArrayStart(array_name, element_count); }
+    ArrayWrapper(Printer &p, std::string array_name, size_t element_count = 0) : p(p) {
+        p.ArrayStart(array_name, static_cast<int32_t>(element_count));
+    }
     ~ArrayWrapper() { p.ArrayEnd(); }
 
    private: