[Spice-devel] [vdagent-win PATCH v2] fix format string for Visual Studio

Frediano Ziglio fziglio at redhat.com
Mon Jul 24 15:57:53 UTC 2017


The "z" size specifier is not supported by Visual Studio.
Cast to unsigned long and use "l" specifier as the type has
enough precision for this vector.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 vdagent/desktop_layout.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Changes since v1:
- use cast instead of proper size specifier, much
  easier.

diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
index 11ad009..a10d898 100644
--- a/vdagent/desktop_layout.cpp
+++ b/vdagent/desktop_layout.cpp
@@ -147,7 +147,8 @@ void DesktopLayout::set_displays()
             break;
         }
         if (display_id >= _displays.size()) {
-            vd_printf("display_id %lu out of range, #displays %zu" , display_id, _displays.size());
+            vd_printf("display_id %lu out of range, #displays %lu",
+                      display_id, (unsigned long) _displays.size());
             break;
         }
         DisplayMode * mode(_displays.at(display_id));
-- 
2.13.3



More information about the Spice-devel mailing list