diff options
-rw-r--r-- | include/mupdf/fitz/hash.h | 2 | ||||
-rw-r--r-- | source/fitz/hash.c | 8 | ||||
-rw-r--r-- | source/fitz/store.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/mupdf/fitz/hash.h b/include/mupdf/fitz/hash.h index 8d4874d7..4b1d7a05 100644 --- a/include/mupdf/fitz/hash.h +++ b/include/mupdf/fitz/hash.h @@ -26,6 +26,6 @@ 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); void fz_print_hash(fz_context *ctx, fz_output *out, fz_hash_table *table); -void fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*, fz_output*, void*)); +void fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*, fz_output*, void*), int compact); #endif diff --git a/source/fitz/hash.c b/source/fitz/hash.c index bc1d2376..31a692c0 100644 --- a/source/fitz/hash.c +++ b/source/fitz/hash.c @@ -327,11 +327,11 @@ fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsi void fz_print_hash(fz_context *ctx, fz_output *out, fz_hash_table *table) { - fz_print_hash_details(ctx, out, table, NULL); + fz_print_hash_details(ctx, out, table, NULL, 0); } void -fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*,fz_output*,void*)) +fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, void (*details)(fz_context*,fz_output*,void*), int compact) { int i, k; @@ -339,9 +339,9 @@ fz_print_hash_details(fz_context *ctx, fz_output *out, fz_hash_table *table, voi for (i = 0; i < table->size; i++) { - if (!table->ents[i].val) + if (!table->ents[i].val && !compact) fz_printf(ctx, out, "table %04d: empty\n", i); - else + else if (table->ents[i].val) { fz_printf(ctx, out, "table %04d: key=", i); for (k = 0; k < MAX_KEY_LEN; k++) diff --git a/source/fitz/store.c b/source/fitz/store.c index 66d56f46..d9674eb6 100644 --- a/source/fitz/store.c +++ b/source/fitz/store.c @@ -591,7 +591,7 @@ fz_print_store_locked(fz_context *ctx, fz_output *out) next->val->refs--; } fz_printf(ctx, out, "-- resource store hash contents --\n"); - fz_print_hash_details(ctx, out, store->hash, print_item); + fz_print_hash_details(ctx, out, store->hash, print_item, 1); fz_printf(ctx, out, "-- end --\n"); } |