mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 07:00:08 +01:00
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>
This commit is contained in:
parent
4144307dbf
commit
a346e40ed3
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue