From 82af5a75f9b36f2a427fece2cbd14686e644d4ec Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 4 Jul 2012 23:17:15 +0200 Subject: Remove debugging functions for release builds. --- fitz/base_hash.c | 2 ++ fitz/fitz-internal.h | 35 +++++++++++++++++++++++++---------- fitz/res_font.c | 2 ++ fitz/res_path.c | 2 ++ fitz/res_shade.c | 2 ++ fitz/res_store.c | 2 ++ 6 files changed, 35 insertions(+), 10 deletions(-) (limited to 'fitz') diff --git a/fitz/base_hash.c b/fitz/base_hash.c index ccdffe63..76d7f870 100644 --- a/fitz/base_hash.c +++ b/fitz/base_hash.c @@ -267,6 +267,7 @@ fz_hash_remove(fz_context *ctx, fz_hash_table *table, void *key) } } +#ifndef NDEBUG void fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table) { @@ -287,3 +288,4 @@ fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table) } } } +#endif diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 6fc40f49..d352a94b 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -71,7 +71,6 @@ float fz_atof(const char *s); typedef struct fz_hash_table_s fz_hash_table; fz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock); -void fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table); void fz_empty_hash(fz_context *ctx, fz_hash_table *table); void fz_free_hash(fz_context *ctx, fz_hash_table *table); @@ -83,6 +82,10 @@ int fz_hash_len(fz_context *ctx, fz_hash_table *table); void *fz_hash_get_key(fz_context *ctx, fz_hash_table *table, int idx); void *fz_hash_get_val(fz_context *ctx, fz_hash_table *table, int idx); +#ifndef NDEBUG +void fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table); +#endif + /* * Math and geometry */ @@ -270,7 +273,9 @@ struct fz_store_type_s void *(*keep_key)(fz_context *,void *); void (*drop_key)(fz_context *,void *); int (*cmp_key)(void *, void *); +#ifndef NDEBUG void (*debug)(void *); +#endif }; /* @@ -291,11 +296,6 @@ void fz_drop_store_context(fz_context *ctx); */ fz_store *fz_keep_store_context(fz_context *ctx); -/* - fz_print_store: Dump the contents of the store for debugging. -*/ -void fz_print_store(fz_context *ctx, FILE *out); - /* fz_store_item: Add an item to the store. @@ -364,6 +364,13 @@ void fz_empty_store(fz_context *ctx); */ int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase); +/* + fz_print_store: Dump the contents of the store for debugging. +*/ +#ifndef NDEBUG +void fz_print_store(fz_context *ctx, FILE *out); +#endif + struct fz_buffer_s { int refs; @@ -731,12 +738,14 @@ fz_font *fz_new_font_from_file(fz_context *ctx, char *path, int index, int use_g fz_font *fz_keep_font(fz_context *ctx, fz_font *font); void fz_drop_font(fz_context *ctx, fz_font *font); -void fz_print_font(fz_context *ctx, FILE *out, fz_font *font); - void fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax); fz_rect fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm); int fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid); +#ifndef NDEBUG +void fz_print_font(fz_context *ctx, FILE *out, fz_font *font); +#endif + /* * Vector path buffer. * It can be stroked and dashed, or be filled. @@ -815,7 +824,6 @@ fz_path *fz_clone_path(fz_context *ctx, fz_path *old); fz_rect fz_bound_path(fz_context *ctx, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm); void fz_adjust_rect_for_stroke(fz_rect *r, fz_stroke_state *stroke, fz_matrix *ctm); -void fz_print_path(fz_context *ctx, FILE *out, fz_path *, int indent); fz_stroke_state *fz_new_stroke_state(fz_context *ctx); fz_stroke_state *fz_new_stroke_state_with_len(fz_context *ctx, int len); @@ -824,6 +832,10 @@ void fz_drop_stroke_state(fz_context *ctx, fz_stroke_state *stroke); fz_stroke_state *fz_unshare_stroke_state(fz_context *ctx, fz_stroke_state *shared); fz_stroke_state *fz_unshare_stroke_state_with_len(fz_context *ctx, fz_stroke_state *shared, int len); +#ifndef NDEBUG +void fz_print_path(fz_context *ctx, FILE *out, fz_path *, int indent); +#endif + /* * Glyph cache */ @@ -916,11 +928,14 @@ struct fz_shade_s fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade); void fz_drop_shade(fz_context *ctx, fz_shade *shade); void fz_free_shade_imp(fz_context *ctx, fz_storable *shade); -void fz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade); fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm); void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox); +#ifndef NDEBUG +void fz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade); +#endif + /* * Scan converter */ diff --git a/fitz/res_font.c b/fitz/res_font.c index 25939d02..0852c56b 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -813,6 +813,7 @@ fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gi /* RJW: "cannot draw type3 glyph" */ } +#ifndef NDEBUG void fz_print_font(fz_context *ctx, FILE *out, fz_font *font) { @@ -838,6 +839,7 @@ fz_print_font(fz_context *ctx, FILE *out, fz_font *font) fprintf(out, "}\n"); } +#endif fz_rect fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) diff --git a/fitz/res_path.c b/fitz/res_path.c index b8a6a1a2..7b429c43 100644 --- a/fitz/res_path.c +++ b/fitz/res_path.c @@ -336,6 +336,7 @@ fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix ctm) } } +#ifndef NDEBUG void fz_print_path(fz_context *ctx, FILE *out, fz_path *path, int indent) { @@ -375,6 +376,7 @@ fz_print_path(fz_context *ctx, FILE *out, fz_path *path, int indent) } } } +#endif fz_stroke_state * fz_keep_stroke_state(fz_context *ctx, fz_stroke_state *stroke) diff --git a/fitz/res_shade.c b/fitz/res_shade.c index d2b2f44b..9ebdd51e 100644 --- a/fitz/res_shade.c +++ b/fitz/res_shade.c @@ -67,6 +67,7 @@ fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm) return fz_intersect_rect(s, r); } +#ifndef NDEBUG void fz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade) { @@ -130,3 +131,4 @@ fz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade) fprintf(out, "}\n"); } +#endif diff --git a/fitz/res_store.c b/fitz/res_store.c index 8e5375d6..a76cfbb0 100644 --- a/fitz/res_store.c +++ b/fitz/res_store.c @@ -452,6 +452,7 @@ fz_drop_store_context(fz_context *ctx) ctx->store = NULL; } +#ifndef NDEBUG void fz_print_store(fz_context *ctx, FILE *out) { @@ -476,6 +477,7 @@ fz_print_store(fz_context *ctx, FILE *out) } fz_unlock(ctx, FZ_LOCK_ALLOC); } +#endif /* This is now an n^2 algorithm - not ideal, but it'll only be bad if we are * actually managing to scavenge lots of blocks back. */ -- cgit v1.2.3