mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 05:50:10 +01:00
Refactor ARRAY_LENGTH macro definitions in test code
This commit is contained in:
parent
7edc5a8844
commit
2c5af590dd
7 changed files with 6 additions and 16 deletions
|
|
@ -54,8 +54,6 @@ typedef struct _pdf_target_closure
|
||||||
cairo_surface_t *target;
|
cairo_surface_t *target;
|
||||||
} pdf_target_closure_t;
|
} pdf_target_closure_t;
|
||||||
|
|
||||||
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
|
||||||
|
|
||||||
static cairo_surface_t *
|
static cairo_surface_t *
|
||||||
_cairo_boilerplate_pdf_create_surface (const char *name,
|
_cairo_boilerplate_pdf_create_surface (const char *name,
|
||||||
cairo_content_t content,
|
cairo_content_t content,
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
|
||||||
void _register_##name__ (void); \
|
void _register_##name__ (void); \
|
||||||
void _register_##name__ (void) { \
|
void _register_##name__ (void) { \
|
||||||
_cairo_boilerplate_register_backend (targets__, \
|
_cairo_boilerplate_register_backend (targets__, \
|
||||||
sizeof (targets__) / sizeof (targets__[0])); \
|
ARRAY_LENGTH(targets__)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CAIRO_NO_BOILERPLATE(name__) \
|
#define CAIRO_NO_BOILERPLATE(name__) \
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,10 @@
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARRAY_LENGTH
|
||||||
|
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
||||||
|
#endif
|
||||||
|
|
||||||
CAIRO_BEGIN_DECLS
|
CAIRO_BEGIN_DECLS
|
||||||
|
|
||||||
/* A fake format we use for the flattened ARGB output of the PS and
|
/* A fake format we use for the flattened ARGB output of the PS and
|
||||||
|
|
|
||||||
|
|
@ -203,10 +203,6 @@ test_report_cmp_name (const void *a,
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ARRAY_LENGTH
|
|
||||||
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CAIRO_PERF_DECL (fill);
|
CAIRO_PERF_DECL (fill);
|
||||||
CAIRO_PERF_DECL (paint);
|
CAIRO_PERF_DECL (paint);
|
||||||
CAIRO_PERF_DECL (paint_with_alpha);
|
CAIRO_PERF_DECL (paint_with_alpha);
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ARRAY_LENGTH(A) (sizeof (A) / sizeof (A[0]))
|
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_cairo_writen (int fd, char *buf, int len)
|
_cairo_writen (int fd, char *buf, int len)
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,6 @@
|
||||||
#define TRUE !FALSE
|
#define TRUE !FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ARRAY_LENGTH
|
|
||||||
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ! HAVE_ALARM || ! defined(SIGALRM)
|
#if ! HAVE_ALARM || ! defined(SIGALRM)
|
||||||
#define alarm(X);
|
#define alarm(X);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,6 @@ cairo_test_NaN (void)
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ARRAY_LENGTH
|
|
||||||
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CAIRO_TEST_OUTPUT_DIR "output"
|
#define CAIRO_TEST_OUTPUT_DIR "output"
|
||||||
|
|
||||||
#define CAIRO_TEST_LOG_SUFFIX ".log"
|
#define CAIRO_TEST_LOG_SUFFIX ".log"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue