[Spice-devel] [PATCH spice] More comparison between signed and unsigned integer expressions warning fixes

Hans de Goede hdegoede at redhat.com
Mon Jan 23 11:35:51 PST 2012


Turns out that more recent snapshots of gcc-4.7 emit even more of these,
so the fixes which I've done before tagging the 0.10.1 release are not
enough to build warning free with the latest gcc-4.7 snapshot <sigh>.

This fixes this.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 client/cmd_line_parser.cpp |    3 +--
 client/glz_decoder.cpp     |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 25ce05b..b937fb0 100644
--- a/client/cmd_line_parser.cpp
+++ b/client/cmd_line_parser.cpp
@@ -497,10 +497,9 @@ void CmdLineParser::show_help()
                 os << "                              ";
             }
             if (line.size() > HELP_WIDTH) {
-                int now = HELP_WIDTH;
+                size_t last_space, now = HELP_WIDTH;
                 std::string sub;
                 sub.append(line, 0, now);
-                int last_space;
                 if ((last_space = sub.find_last_of(' ')) != std::string::npos) {
                     now = last_space;
                     sub.resize(now++);
diff --git a/client/glz_decoder.cpp b/client/glz_decoder.cpp
index e5dd0fa..d688051 100644
--- a/client/glz_decoder.cpp
+++ b/client/glz_decoder.cpp
@@ -50,7 +50,7 @@ GlzDecoder::~GlzDecoder()
 
 void GlzDecoder::decode_header()
 {
-    int magic;
+    uint32_t magic;
     int version;
     uint8_t tmp;
     int stride;
-- 
1.7.7.6



More information about the Spice-devel mailing list