Fix a couple of "comparison between signed and unsigned" warnings
Pavel Labath pavelo@centrum.sk
2 files changed,
7 insertions(+),
9 deletions(-)
M
src/tests/testRectangleUtil.cc
→
src/tests/testRectangleUtil.cc
@@ -35,12 +35,11 @@ { { 0, 0, 10, 10 }, -5, 0, 2, false }, // somewhere outside
{ { 0, 0, 10, 10 }, 20, 20, 2, false } // outside for sure }; - int i; - for (i = 0; i < sizeof(tests)/sizeof(_t); ++i) { + for (unsigned int i = 0; i < sizeof(tests)/sizeof(_t); ++i) { const _t& t = tests[i]; int result = RectangleUtil::insideBorder<Rect>(t.rect, t.x, t.y, t.bw); - printf(" %d: is (%02d|%02d) inside [%d %d]-[%d %d] with border %d: %s, %s\n", + printf(" %u: is (%02d|%02d) inside [%d %d]-[%d %d] with border %d: %s, %s\n", i, t.x, t.y, t.rect.x(), t.rect.y(),@@ -66,11 +65,11 @@ int truth;
}; struct _test { - bool operator()(const Rect& a, const Rect& b, int truth, int i) { + bool operator()(const Rect& a, const Rect& b, int truth, unsigned int i) { int result = RectangleUtil::overlapRectangles(a, b); - printf(" %d: [%2d %2d]-[%2d %2d] %s [%2d %2d]-[%2d %2d]: %s\n", + printf(" %u: [%2d %2d]-[%2d %2d] %s [%2d %2d]-[%2d %2d]: %s\n", i, a.x(), a.y(), a.x() + (int)a.width(),@@ -100,8 +99,7 @@
_test test; - int i; - for (i = 0; i < sizeof(tests)/sizeof(_t); ++i) { + for (unsigned int i = 0; i < sizeof(tests)/sizeof(_t); ++i) { test(tests[i].a, tests[i].b, tests[i].truth, i); test(tests[i].b, tests[i].a, tests[i].truth, i); }
M
src/tests/texturetest.cc
→
src/tests/texturetest.cc
@@ -79,8 +79,8 @@ // for text color
m_gc.setForeground(Color("black", screenNumber())); const int step_size = m_box_size + 5; - int next_x = 5; - int next_y = 5; + unsigned int next_x = 5; + unsigned int next_y = 5; TestTheme tm(screenNumber()); std::auto_ptr<ThemeItem<Texture> > text;