[PATCH 1/8] perf: Guarantee path width is non-negative

"Bryce W. Harrington" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
This quells the following warning:

  perf/micro/hatching.c:39:5: warning: cannot optimize loop, the
  loop counter may overflow

Width and height aren't going to be negative so enforce it so that the
compiler can do whatever optimization it wants to do.

Signed-off-by: Bryce Harrington <[email protected]>
---
 perf/micro/hatching.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/perf/micro/hatching.c b/perf/micro/hatching.c
index b51acec..996bda6 100644
--- a/perf/micro/hatching.c
+++ b/perf/micro/hatching.c
@@ -32,9 +32,9 @@
 #define WIDTH	100
 #define HEIGHT	100
 
-static void path (cairo_t *cr, int width, int height)
+static void path (cairo_t *cr, unsigned int width, unsigned int height)
 {
-    int i;
+    unsigned int i;
 
     for (i = 0; i < width+1; i += STEP) {
 	cairo_rectangle (cr, i-1, -1, 2, height+2);
-- 
1.7.9.5
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.