diff --git a/test/bug-spline.c b/test/bug-spline.c index 00a915cd3..9a54a7c8c 100644 --- a/test/bug-spline.c +++ b/test/bug-spline.c @@ -56,7 +56,6 @@ static const struct spline { { 1, 0, 0, 1 }, } }; -#define NUM_SPLINES (sizeof(splines)/sizeof(splines[0])) static cairo_test_status_t draw (cairo_t *cr, int width, int height) @@ -68,7 +67,7 @@ draw (cairo_t *cr, int width, int height) cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE); - for (n = 0; n < NUM_SPLINES; n++) { + for (n = 0; n < ARRAY_LENGTH(splines); n++) { cairo_set_line_width (cr, splines[n].line_width); cairo_set_source_rgba (cr, splines[n].rgba[0], diff --git a/test/caps-tails-curve.c b/test/caps-tails-curve.c index 25e58199a..fa6aded3d 100644 --- a/test/caps-tails-curve.c +++ b/test/caps-tails-curve.c @@ -100,7 +100,7 @@ draw (cairo_t *cr, int width, int height) cairo_set_line_width (cr, LINE_WIDTH); - for (t = 0; t < sizeof(theta)/sizeof (theta[0]); t++) { + for (t = 0; t < ARRAY_LENGTH(theta); t++) { cairo_save (cr); cairo_translate (cr, 0, t * (SIZE + PAD) + PAD); draw_caps_joins (cr, theta[t]); diff --git a/test/tiger.c b/test/tiger.c index 6f45f1f03..059bb849f 100644 --- a/test/tiger.c +++ b/test/tiger.c @@ -37,7 +37,7 @@ draw (cairo_t *cr, int width, int height) cairo_translate (cr, width/2, height/2); cairo_scale (cr, .85, .85); - for (i = 0; i < sizeof (tiger_commands)/sizeof(tiger_commands[0]);i++) { + for (i = 0; i < ARRAY_LENGTH(tiger_commands); i++) { const struct command *cmd = &tiger_commands[i]; switch (cmd->type) { case 'm':