diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-03-16 16:48:18 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-03-17 17:45:57 +0100 |
commit | 75fea162d985bea622afa59771fb2d07f5241d1b (patch) | |
tree | 5876692cd2ba574481210fae292eaf7f06005028 /test/degenerate-path.c | |
parent | 4ef32a36ba1e457e8dd6244a6483866d33477aac (diff) | |
download | cairo-75fea162d985bea622afa59771fb2d07f5241d1b.tar.gz |
test: Cleanup macros
The ARRAY_LENGTH macro is used by many tests, although sometimes it is
named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it.
In a similar way, MAX() and MIN() are currently defined in some
specific tests, while they could be reused.
Diffstat (limited to 'test/degenerate-path.c')
-rw-r--r-- | test/degenerate-path.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/test/degenerate-path.c b/test/degenerate-path.c index 97cf7b286..c6907300d 100644 --- a/test/degenerate-path.c +++ b/test/degenerate-path.c @@ -28,8 +28,6 @@ #define PAD 3.0 #define LINE_WIDTH 6.0 -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) - static cairo_test_status_t draw (cairo_t *cr, int width, int height) { @@ -40,7 +38,7 @@ draw (cairo_t *cr, int width, int height) cairo_set_source_rgb (cr, 1, 0, 0); - for (i=0; i<ARRAY_SIZE(cap); i++) { + for (i = 0; i < ARRAY_LENGTH (cap); i++) { cairo_save (cr); cairo_set_line_cap (cr, cap[i]); |