summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-04-26 14:34:31 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-04-27 15:12:03 +0200
commit2ccb4fe72b9af0241d16a0d206fc8dcf3c2497df (patch)
treea983427b532e9f082bc58ce26b91ff782f858f55 /source/pdf
parentcabf4489896a2a978361eb6e1df4b4aef81193f4 (diff)
downloadmupdf-2ccb4fe72b9af0241d16a0d206fc8dcf3c2497df.tar.xz
Clean up store debug printing.
Replace fz_print_hash with fz_hash_for_each iterator. Use string formatting callback.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-font.c7
-rw-r--r--source/pdf/pdf-store.c9
2 files changed, 8 insertions, 8 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c
index cee094b9..43390247 100644
--- a/source/pdf/pdf-font.c
+++ b/source/pdf/pdf-font.c
@@ -961,9 +961,9 @@ hail_mary_cmp_key(fz_context *ctx, void *k0, void *k1)
}
static void
-hail_mary_print_key(fz_context *ctx, fz_output *out, void *key_)
+hail_mary_format_key(fz_context *ctx, char *s, int n, void *key_)
{
- fz_write_printf(ctx, out, "hail mary ");
+ fz_strlcpy(s, "(hail mary font)", n);
}
static int hail_mary_store_key; /* Dummy */
@@ -974,7 +974,8 @@ static const fz_store_type hail_mary_store_type =
hail_mary_keep_key,
hail_mary_drop_key,
hail_mary_cmp_key,
- hail_mary_print_key
+ hail_mary_format_key,
+ NULL
};
pdf_font_desc *
diff --git a/source/pdf/pdf-store.c b/source/pdf/pdf-store.c
index 15828d79..7b562d1a 100644
--- a/source/pdf/pdf-store.c
+++ b/source/pdf/pdf-store.c
@@ -34,14 +34,13 @@ pdf_cmp_key(fz_context *ctx, void *k0, void *k1)
}
static void
-pdf_print_key(fz_context *ctx, fz_output *out, void *key_)
+pdf_format_key(fz_context *ctx, char *s, int n, void *key_)
{
pdf_obj *key = (pdf_obj *)key_;
-
if (pdf_is_indirect(ctx, key))
- fz_write_printf(ctx, out, "(%d 0 R) ", pdf_to_num(ctx, key));
+ fz_snprintf(s, n, "(%d 0 R)", pdf_to_num(ctx, key));
else
- pdf_print_obj(ctx, out, key, 0);
+ pdf_sprint_obj(ctx, s, n, key, 1);
}
static const fz_store_type pdf_obj_store_type =
@@ -50,7 +49,7 @@ static const fz_store_type pdf_obj_store_type =
pdf_keep_key,
pdf_drop_key,
pdf_cmp_key,
- pdf_print_key,
+ pdf_format_key,
NULL
};