diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2007-08-22 02:58:37 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2007-08-22 02:58:37 -0400 |
commit | 735757a17a7c72f8598c8958b600daad941a0431 (patch) | |
tree | 39f09847b828da9f19ed85a29b411f59a8e76cdf | |
parent | bfdc3b6642a36a7728f82ae87de83244d86ba29e (diff) |
[Makefile.am] Add target sparse to run sparse static source code analyzer
There are still some bits not quite working.
27 files changed, 59 insertions, 22 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index a5a1406b..082ce933 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -164,7 +164,7 @@ nodist_cairoinclude_HEADERS = \ lib_LTLIBRARIES = libcairo.la -libcairo_la_SOURCES = \ +libcairo_la_base_sources = \ cairo.c \ cairo.h \ cairo-private.h \ @@ -174,7 +174,6 @@ libcairo_la_SOURCES = \ cairo-base85-stream.c \ cairo-bentley-ottmann.c \ cairo-cache.c \ - cairo-cache-private.h \ cairo-clip.c \ cairo-clip-private.h \ cairo-color.c \ @@ -193,7 +192,6 @@ libcairo_la_SOURCES = \ cairo-lzw.c \ cairo-matrix.c \ cairo-mutex.c \ - cairo-mutex-list-private.h \ cairo-mutex-private.h \ cairo-mutex-type-private.h \ cairo-operator.c \ @@ -220,7 +218,6 @@ libcairo_la_SOURCES = \ cairo-surface-fallback-private.h \ cairo-surface-private.h \ cairo-traps.c \ - cairo-types-private.h \ cairo-pattern.c \ cairo-unicode.c \ cairo-output-stream.c \ @@ -251,6 +248,19 @@ libcairo_la_SOURCES = \ $(libcairo_directfb_sources) \ cairoint.h +# source files that cannot be passed to compiler directly. +# mostly when they depend recursively on cairoint.h. that is, +# cairoint.h includes them in the middle. +libcairo_la_special_sources = \ + cairo-cache-private.h \ + cairo-fixed-private.h \ + cairo-mutex-list-private.h \ + cairo-types-private.h + +libcairo_la_SOURCES = \ + $(libcairo_la_base_sources) \ + $(libcairo_la_special_sources) + libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined $(export_symbols) libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS) @@ -301,5 +311,8 @@ TESTS_ENVIRONMENT = srcdir="$(srcdir)" TESTS = check-def.sh check-plt.sh check-headers.sh check-cairoint.sh EXTRA_DIST += $(TESTS) +sparse: + sparse -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $(libcairo_la_base_sources) + splint: - splint -badflag -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $(libcairo_la_SOURCES) + splint -badflag -I$(top_builddir) $(libcairo_la_CFLAGS) -DHAVE_CONFIG_H $(libcairo_la_base_sources) diff --git a/src/cairo-cache-private.h b/src/cairo-cache-private.h index 7ab14e26..33599836 100644 --- a/src/cairo-cache-private.h +++ b/src/cairo-cache-private.h @@ -39,6 +39,7 @@ #ifndef CAIRO_CACHE_PRIVATE_H #define CAIRO_CACHE_PRIVATE_H +#include "cairoint.h" #include "cairo-types-private.h" /** diff --git a/src/cairo-clip-private.h b/src/cairo-clip-private.h index 61559ce5..55ccb08b 100644 --- a/src/cairo-clip-private.h +++ b/src/cairo-clip-private.h @@ -36,6 +36,7 @@ #ifndef CAIRO_CLIP_PRIVATE_H #define CAIRO_CLIP_PRIVATE_H +#include "cairoint.h" #include "cairo-path-fixed-private.h" extern const cairo_private cairo_rectangle_list_t _cairo_rectangles_nil; diff --git a/src/cairo-fixed-private.h b/src/cairo-fixed-private.h index 35b3748d..bcc7d0c9 100644 --- a/src/cairo-fixed-private.h +++ b/src/cairo-fixed-private.h @@ -37,6 +37,7 @@ #ifndef CAIRO_FIXED_PRIVATE_H #define CAIRO_FIXED_PRIVATE_H +#include "cairoint.h" #include "cairo-wideint-private.h" /* diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h index 3e28f5e2..55f86ee2 100644 --- a/src/cairo-ft-private.h +++ b/src/cairo-ft-private.h @@ -37,6 +37,7 @@ #ifndef CAIRO_FT_PRIVATE_H #define CAIRO_FT_PRIVATE_H +#include "cairoint.h" #include <cairo-ft.h> #include <cairoint.h> diff --git a/src/cairo-gstate-private.h b/src/cairo-gstate-private.h index 25900482..276ce9ff 100644 --- a/src/cairo-gstate-private.h +++ b/src/cairo-gstate-private.h @@ -36,6 +36,7 @@ #ifndef CAIRO_GSTATE_PRIVATE_H #define CAIRO_GSTATE_PRIVATE_H +#include "cairoint.h" #include "cairo-clip-private.h" struct _cairo_gstate { diff --git a/src/cairo-hash-private.h b/src/cairo-hash-private.h index 8ed3ba83..b0c1e006 100644 --- a/src/cairo-hash-private.h +++ b/src/cairo-hash-private.h @@ -39,6 +39,7 @@ #ifndef CAIRO_HASH_PRIVATE_H #define CAIRO_HASH_PRIVATE_H +#include "cairoint.h" #include "cairo-types-private.h" /* XXX: I'd like this file to be self-contained in terms of diff --git a/src/cairo-malloc-private.h b/src/cairo-malloc-private.h index f503b395..bd479579 100644 --- a/src/cairo-malloc-private.h +++ b/src/cairo-malloc-private.h @@ -37,6 +37,7 @@ #ifndef CAIRO_MALLOC_PRIVATE_H #define CAIRO_MALLOC_PRIVATE_H +#include "cairoint.h" #include "cairo-wideint-private.h" /** diff --git a/src/cairo-mutex-private.h b/src/cairo-mutex-private.h index 88e88bb0..7f61b142 100644 --- a/src/cairo-mutex-private.h +++ b/src/cairo-mutex-private.h @@ -41,9 +41,7 @@ #ifndef CAIRO_MUTEX_PRIVATE_H #define CAIRO_MUTEX_PRIVATE_H -#if HAVE_CONFIG_H -#include "config.h" -#endif +#include "cairoint.h" #include <cairo-features.h> diff --git a/src/cairo-mutex-type-private.h b/src/cairo-mutex-type-private.h index 59d581af..1d82de82 100644 --- a/src/cairo-mutex-type-private.h +++ b/src/cairo-mutex-type-private.h @@ -41,9 +41,7 @@ #ifndef CAIRO_MUTEX_TYPE_PRIVATE_H #define CAIRO_MUTEX_TYPE_PRIVATE_H -#if HAVE_CONFIG_H -#include "config.h" -#endif +#include "cairoint.h" #include <cairo-features.h> diff --git a/src/cairo-os2-private.h b/src/cairo-os2-private.h index 9ed0c7cd..5d67e09d 100644 --- a/src/cairo-os2-private.h +++ b/src/cairo-os2-private.h @@ -38,6 +38,8 @@ #ifndef CAIRO_OS2_PRIVATE_H #define CAIRO_OS2_PRIVATE_H +#include "cairoint.h" + #define INCL_DOS #define INCL_DOSSEMAPHORES #define INCL_DOSERRORS @@ -50,7 +52,6 @@ #endif #include <cairo-os2.h> -#include <cairoint.h> typedef struct _cairo_os2_surface { diff --git a/src/cairo-output-stream-private.h b/src/cairo-output-stream-private.h index 0600431e..18128562 100644 --- a/src/cairo-output-stream-private.h +++ b/src/cairo-output-stream-private.h @@ -37,6 +37,7 @@ #ifndef CAIRO_OUTPUT_STREAM_PRIVATE_H #define CAIRO_OUTPUT_STREAM_PRIVATE_H +#include "cairoint.h" #include "cairo-types-private.h" typedef cairo_status_t (*cairo_output_stream_write_func_t) (cairo_output_stream_t *output_stream, diff --git a/src/cairo-paginated-surface-private.h b/src/cairo-paginated-surface-private.h index b406cac1..a9cea07c 100644 --- a/src/cairo-paginated-surface-private.h +++ b/src/cairo-paginated-surface-private.h @@ -36,7 +36,7 @@ #ifndef CAIRO_PAGINATED_SURFACE_H #define CAIRO_PAGINATED_SURFACE_H -#include "cairo.h" +#include "cairoint.h" #include "cairo-surface-private.h" diff --git a/src/cairo-path-fixed-private.h b/src/cairo-path-fixed-private.h index 65401f34..eedab581 100644 --- a/src/cairo-path-fixed-private.h +++ b/src/cairo-path-fixed-private.h @@ -36,6 +36,8 @@ #ifndef CAIRO_PATH_FIXED_PRIVATE_H #define CAIRO_PATH_FIXED_PRIVATE_H +#include "cairoint.h" + typedef enum cairo_path_op { CAIRO_PATH_OP_MOVE_TO = 0, CAIRO_PATH_OP_LINE_TO = 1, diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h index 1af2ad06..7b00ad9e 100644 --- a/src/cairo-pdf-surface-private.h +++ b/src/cairo-pdf-surface-private.h @@ -39,6 +39,8 @@ #ifndef CAIRO_PDF_SURFACE_PRIVATE_H #define CAIRO_PDF_SURFACE_PRIVATE_H +#include "cairoint.h" + #include "cairo-pdf.h" #include "cairo-surface-private.h" diff --git a/src/cairo-private.h b/src/cairo-private.h index 14cc79ae..bca380e7 100644 --- a/src/cairo-private.h +++ b/src/cairo-private.h @@ -36,6 +36,7 @@ #ifndef CAIRO_PRIVATE_H #define CAIRO_PRIVATE_H +#include "cairoint.h" #include "cairo-gstate-private.h" #include "cairo-path-fixed-private.h" diff --git a/src/cairo-ps-surface-private.h b/src/cairo-ps-surface-private.h index 2499b992..b6e24329 100644 --- a/src/cairo-ps-surface-private.h +++ b/src/cairo-ps-surface-private.h @@ -40,6 +40,8 @@ #ifndef CAIRO_PS_SURFACE_PRIVATE_H #define CAIRO_PS_SURFACE_PRIVATE_H +#include "cairoint.h" + #include "cairo-ps.h" #include "cairo-surface-private.h" diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h index 9f42a8b3..5e46e8d4 100644 --- a/src/cairo-quartz-private.h +++ b/src/cairo-quartz-private.h @@ -38,7 +38,7 @@ #ifndef CAIRO_QUARTZ_PRIVATE_H #define CAIRO_QUARTZ_PRIVATE_H -#include <cairoint.h> +#include "cairoint.h" #ifdef CAIRO_HAS_QUARTZ_SURFACE #include <cairo-quartz.h> diff --git a/src/cairo-region-private.h b/src/cairo-region-private.h index 7f92f9c1..20be2fa3 100644 --- a/src/cairo-region-private.h +++ b/src/cairo-region-private.h @@ -37,6 +37,8 @@ #ifndef CAIRO_REGION_PRIVATE_H #define CAIRO_REGION_PRIVATE_H +#include "cairoint.h" + #include <pixman.h> /* cairo_region_t is defined in cairoint.h */ diff --git a/src/cairo-scaled-font-private.h b/src/cairo-scaled-font-private.h index fa71644a..bd6245c5 100644 --- a/src/cairo-scaled-font-private.h +++ b/src/cairo-scaled-font-private.h @@ -38,7 +38,7 @@ #ifndef CAIRO_SCALED_FONT_PRIVATE_H #define CAIRO_SCALED_FONT_PRIVATE_H -#include "cairo.h" +#include "cairoint.h" #include "cairo-types-private.h" #include "cairo-mutex-type-private.h" diff --git a/src/cairo-surface-private.h b/src/cairo-surface-private.h index 6193cf80..85b29f70 100644 --- a/src/cairo-surface-private.h +++ b/src/cairo-surface-private.h @@ -38,7 +38,7 @@ #ifndef CAIRO_SURFACE_PRIVATE_H #define CAIRO_SURFACE_PRIVATE_H -#include "cairo.h" +#include "cairoint.h" #include "cairo-types-private.h" diff --git a/src/cairo-svg-surface-private.h b/src/cairo-svg-surface-private.h index e7cd4db8..ee5cf498 100644 --- a/src/cairo-svg-surface-private.h +++ b/src/cairo-svg-surface-private.h @@ -41,6 +41,8 @@ #ifndef CAIRO_SVG_SURFACE_PRIVATE_H #define CAIRO_SVG_SURFACE_PRIVATE_H +#include "cairoint.h" + #include "cairo-svg.h" #include "cairo-surface-private.h" diff --git a/src/cairo-type1-private.h b/src/cairo-type1-private.h index ae28e058..03b00396 100644 --- a/src/cairo-type1-private.h +++ b/src/cairo-type1-private.h @@ -36,6 +36,8 @@ #ifndef CAIRO_TYPE1_PRIVATE_H #define CAIRO_TYPE1_PRIVATE_H +#include "cairoint.h" + /* Magic constants for the type1 eexec encryption */ #define CAIRO_TYPE1_ENCRYPT_C1 ((unsigned short) 52845) #define CAIRO_TYPE1_ENCRYPT_C2 ((unsigned short) 22719) diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index 37b131e1..a99f3253 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -38,6 +38,8 @@ #ifndef CAIRO_TYPES_PRIVATE_H #define CAIRO_TYPES_PRIVATE_H +#include "cairoint.h" + typedef struct _cairo_array cairo_array_t; struct _cairo_array { unsigned int size; diff --git a/src/cairo-wideint-private.h b/src/cairo-wideint-private.h index 636d8a6b..78110636 100644 --- a/src/cairo-wideint-private.h +++ b/src/cairo-wideint-private.h @@ -37,6 +37,8 @@ #ifndef CAIRO_WIDEINT_H #define CAIRO_WIDEINT_H +#include "cairoint.h" + #if HAVE_STDINT_H # include <stdint.h> #elif HAVE_INTTYPES_H diff --git a/src/cairo-xlib-surface-private.h b/src/cairo-xlib-surface-private.h index 3bbf43e2..16e5868c 100644 --- a/src/cairo-xlib-surface-private.h +++ b/src/cairo-xlib-surface-private.h @@ -33,6 +33,8 @@ #ifndef CAIRO_XLIB_SURFACE_PRIVATE_H #define CAIRO_XLIB_SURFACE_PRIVATE_H +#include "cairoint.h" + #include "cairo-xlib.h" #include "cairo-surface-private.h" diff --git a/src/cairoint.h b/src/cairoint.h index 88464652..1f13e76b 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -179,11 +179,6 @@ do { \ #define CAIRO_REF_COUNT_INVALID ((unsigned int) -1) -#include "cairo-mutex-private.h" -#include "cairo-wideint-private.h" -#include "cairo-malloc-private.h" -#include "cairo-fixed-private.h" - #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff)) #define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00) #define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0) @@ -238,8 +233,8 @@ be32_to_cpu(uint32_t v) #endif #include "cairo-types-private.h" -#include "cairo-hash-private.h" #include "cairo-cache-private.h" +#include "cairo-fixed-private.h" typedef struct _cairo_region cairo_region_t; @@ -2456,4 +2451,9 @@ slim_hidden_proto (cairo_surface_write_to_png_stream); CAIRO_END_DECLS +#include "cairo-mutex-private.h" +#include "cairo-wideint-private.h" +#include "cairo-malloc-private.h" +#include "cairo-hash-private.h" + #endif |