summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-02-18 17:37:22 -0800
committerBryce Harrington <b.harrington@samsung.com>2014-02-25 12:13:10 -0800
commita346e40ed33e69c7c03be3aa1b7b0065e4ee1d07 (patch)
tree57240e366cad679db28ba4faa36a44278e613c9e /perf
parent4144307dbfbe7b297135d9ea4b080cae7e06b997 (diff)
perf: Guarantee path width is non-negative
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. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'perf')
-rw-r--r--perf/micro/hatching.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/perf/micro/hatching.c b/perf/micro/hatching.c
index b51acec5d..996bda64f 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);