[Spice-devel] [PATCH 2/2] python: Fix -Wsign-compare
Fabiano Fidêncio
fidencio at redhat.com
Wed Sep 3 02:51:46 PDT 2014
A few functions are comparing signed and unsigned values, basically
because some of the loop indexes are signed values. Casting it to
unsigned seems harmless and makes GCC happier.
---
python_modules/codegen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python_modules/codegen.py b/python_modules/codegen.py
index 009cf95..603531f 100644
--- a/python_modules/codegen.py
+++ b/python_modules/codegen.py
@@ -266,7 +266,7 @@ class CodeWriter:
return self.block()
def for_loop(self, index, limit):
- return self.block("for (%s = 0; %s < %s; %s++)" % (index, index, limit, index))
+ return self.block("for (%s = 0; %s < (unsigned) %s; %s++)" % (index, index, limit, index))
def while_loop(self, expr):
return self.block("while (%s)" % (expr))
--
1.9.3
More information about the Spice-devel
mailing list