[cairo-commit] 3 commits - boilerplate/cairo-boilerplate.c boilerplate/Makefile.am src/cairoint.h src/cairo-types-private.h src/Makefile.am
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Aug 23 11:04:33 PDT 2007
boilerplate/Makefile.am | 2
boilerplate/cairo-boilerplate.c | 15 -----
src/Makefile.am | 13 ++++
src/cairo-types-private.h | 105 ++++++++++++++++++++++++----------------
src/cairoint.h | 23 --------
5 files changed, 77 insertions(+), 81 deletions(-)
New commits:
diff-tree fa41ebfb7c074a6ffa6a8fe7c43207e594c6534c (from d66f1ee82a10de325ee4e7579bbbaa1d301292e4)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 23 13:55:19 2007 -0400
Fix header inclusion order
Enough for now, until I figure out the right way to break cairoint.h.
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index a99f325..e63dccd 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -38,39 +38,24 @@
#ifndef CAIRO_TYPES_PRIVATE_H
#define CAIRO_TYPES_PRIVATE_H
-#include "cairoint.h"
+/* This is the only header file not including cairoint.h. It only contains
+ * typedefs.*/
+#include "cairo.h"
typedef struct _cairo_array cairo_array_t;
-struct _cairo_array {
- unsigned int size;
- unsigned int num_elements;
- unsigned int element_size;
- char **elements;
-
- cairo_bool_t is_snapshot;
-};
-
-typedef cairo_array_t cairo_user_data_array_t;
-
-struct _cairo_font_options {
- cairo_antialias_t antialias;
- cairo_subpixel_order_t subpixel_order;
- cairo_hint_style_t hint_style;
- cairo_hint_metrics_t hint_metrics;
-};
-
typedef struct _cairo_hash_table cairo_hash_table_t;
-
-typedef struct _cairo_cache {
- cairo_hash_table_t *hash_table;
-
- cairo_destroy_func_t entry_destroy;
-
- unsigned long max_size;
- unsigned long size;
-
- int freeze_count;
-} cairo_cache_t;
+typedef struct _cairo_cache cairo_cache_t;
+typedef struct _cairo_hash_entry cairo_hash_entry_t;
+typedef struct _cairo_surface_backend cairo_surface_backend_t;
+typedef struct _cairo_clip cairo_clip_t;
+typedef struct _cairo_output_stream cairo_output_stream_t;
+typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
+typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
+typedef struct _cairo_scaled_font_backend cairo_scaled_font_backend_t;
+typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
+typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
+typedef enum _cairo_paginated_mode cairo_paginated_mode_t;
+typedef cairo_array_t cairo_user_data_array_t;
/**
* cairo_hash_entry_t:
@@ -106,25 +91,61 @@ typedef struct _cairo_cache {
* parameter name of key). In these cases, the value-related fields of
* the entry need not be initialized if so desired.
**/
-typedef struct _cairo_hash_entry {
+struct _cairo_hash_entry {
unsigned long hash;
-} cairo_hash_entry_t;
+};
+struct _cairo_array {
+ unsigned int size;
+ unsigned int num_elements;
+ unsigned int element_size;
+ char **elements;
-typedef struct _cairo_surface_backend cairo_surface_backend_t;
-typedef struct _cairo_clip cairo_clip_t;
-typedef struct _cairo_output_stream cairo_output_stream_t;
-typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
-typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
-typedef struct _cairo_scaled_font_backend cairo_scaled_font_backend_t;
-typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
+ cairo_bool_t is_snapshot;
+};
+
+struct _cairo_font_options {
+ cairo_antialias_t antialias;
+ cairo_subpixel_order_t subpixel_order;
+ cairo_hint_style_t hint_style;
+ cairo_hint_metrics_t hint_metrics;
+};
+struct _cairo_cache {
+ cairo_hash_table_t *hash_table;
-typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
+ cairo_destroy_func_t entry_destroy;
-typedef enum {
+ unsigned long max_size;
+ unsigned long size;
+
+ int freeze_count;
+};
+
+enum _cairo_paginated_mode {
CAIRO_PAGINATED_MODE_ANALYZE, /* analyze page regions */
CAIRO_PAGINATED_MODE_RENDER /* render page contents */
-} cairo_paginated_mode_t;
+};
+
+/* Sure wish C had a real enum type so that this would be distinct
+ from cairo_status_t. Oh well, without that, I'll use this bogus 1000
+ offset */
+typedef enum _cairo_int_status {
+ CAIRO_INT_STATUS_DEGENERATE = 1000,
+ CAIRO_INT_STATUS_UNSUPPORTED,
+ CAIRO_INT_STATUS_NOTHING_TO_DO,
+ CAIRO_INT_STATUS_CACHE_EMPTY,
+ CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY,
+ CAIRO_INT_STATUS_IMAGE_FALLBACK
+} cairo_int_status_t;
+
+typedef enum _cairo_internal_surface_type {
+ CAIRO_INTERNAL_SURFACE_TYPE_META = 0x1000,
+ CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
+ CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
+ CAIRO_INTERNAL_SURFACE_TYPE_TEST_META,
+ CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
+ CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
+} cairo_internal_surface_type_t;
#endif /* CAIRO_TYPES_PRIVATE_H */
diff --git a/src/cairoint.h b/src/cairoint.h
index 1f13e76..310fdfd 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -313,28 +313,7 @@ typedef cairo_box_int32_t cairo_box_int_
#error Not sure how to pick a cairo_rectangle_int_t for your CAIRO_FIXED_BITS!
#endif
-/* Sure wish C had a real enum type so that this would be distinct
- from cairo_status_t. Oh well, without that, I'll use this bogus 1000
- offset */
-typedef enum cairo_int_status {
- CAIRO_INT_STATUS_DEGENERATE = 1000,
- CAIRO_INT_STATUS_UNSUPPORTED,
- CAIRO_INT_STATUS_NOTHING_TO_DO,
- CAIRO_INT_STATUS_CACHE_EMPTY,
- CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY,
- CAIRO_INT_STATUS_IMAGE_FALLBACK
-} cairo_int_status_t;
-
-typedef enum cairo_internal_surface_type {
- CAIRO_INTERNAL_SURFACE_TYPE_META = 0x1000,
- CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
- CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_META,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
-} cairo_internal_surface_type_t;
-
-typedef enum cairo_direction {
+typedef enum _cairo_direction {
CAIRO_DIRECTION_FORWARD,
CAIRO_DIRECTION_REVERSE
} cairo_direction_t;
diff-tree d66f1ee82a10de325ee4e7579bbbaa1d301292e4 (from 5594f8b0356fc209749d01e2043559fccd3966d0)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 23 13:54:37 2007 -0400
[boilerplate] Build libcairoboilerplate.la in make check and make test
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index a55412a..ddac552 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -95,3 +95,5 @@ INCLUDES = \
CLEANFILES = \
$(EXTRA_LTLIBRARIES)
+
+check test: libcairoboilerplate.la
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 792dee4..b9438a2 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -68,21 +68,6 @@
#include <ctype.h>
#include <assert.h>
-/* This is copied from cairoint.h. That makes it painful to keep in
- * sync, but the slim stuff makes cairoint.h "hard" to include when
- * not actually building the cairo library itself. Fortunately, since
- * we're checking all these values, we do have a safeguard for keeping
- * them in sync.
- */
-typedef enum cairo_internal_surface_type {
- CAIRO_INTERNAL_SURFACE_TYPE_META = 0x1000,
- CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED,
- CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_META,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
-} cairo_internal_surface_type_t;
-
const char *
cairo_boilerplate_content_name (cairo_content_t content)
{
diff-tree 5594f8b0356fc209749d01e2043559fccd3966d0 (from 503ab85e44bfa02ef8391f7849826cbe07ff15d2)
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Aug 23 00:38:00 2007 -0400
[Makefile.am] Run sparse and splint once per source file
Also skip .h files for splint as it causes lots of unused-function warnings.
diff --git a/src/Makefile.am b/src/Makefile.am
index 082ce93..5cd368b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -311,8 +311,17 @@ TESTS_ENVIRONMENT = srcdir="$(srcdir)"
TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh
EXTRA_DIST += $(TESTS)
+SPARSE = sparse
sparse:
- sparse -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $(libcairo_la_base_sources)
+ @status=true; for f in $(libcairo_la_base_sources); do \
+ echo sparse $$f; \
+ $(SPARSE) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
+ done; $$status
+SPLINT = splint -badflag
splint:
- splint -badflag -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $(libcairo_la_base_sources)
+ @status=true; for f in $(libcairo_la_base_sources); do \
+ test "$$f" = "`echo "$$f" | sed 's/[.]h$$//'`" || continue; \
+ echo sparse $$f; \
+ $(SPLINT) -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $$f || status=false; \
+ done; $$status
More information about the cairo-commit
mailing list