diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/draw-device.c | 2 | ||||
-rw-r--r-- | source/fitz/image.c | 2 | ||||
-rw-r--r-- | source/fitz/store.c | 10 | ||||
-rw-r--r-- | source/pdf/pdf-font.c | 8 | ||||
-rw-r--r-- | source/pdf/pdf-store.c | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 9d7a19af..857844fe 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -1953,7 +1953,7 @@ fz_print_tile(fz_context *ctx, fz_output *out, void *key_) fz_write_printf(ctx, out, "(tile id=%x, ctm=%g %g %g %g) ", key->id, key->ctm[0], key->ctm[1], key->ctm[2], key->ctm[3]); } -static fz_store_type fz_tile_store_type = +static const fz_store_type fz_tile_store_type = { fz_make_hash_tile_key, fz_keep_tile_key, diff --git a/source/fitz/image.c b/source/fitz/image.c index 72855395..3b0a93d6 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -96,7 +96,7 @@ fz_needs_reap_image_key(fz_context *ctx, void *key_) return (key->image->key_storable.needs_reaping); } -static fz_store_type fz_image_store_type = +static const fz_store_type fz_image_store_type = { fz_make_hash_image_key, fz_keep_image_key, diff --git a/source/fitz/store.c b/source/fitz/store.c index 70f25029..f7cda31a 100644 --- a/source/fitz/store.c +++ b/source/fitz/store.c @@ -10,7 +10,7 @@ struct fz_item_s fz_item *next; fz_item *prev; fz_store *store; - fz_store_type *type; + const fz_store_type *type; }; struct fz_store_s @@ -389,7 +389,7 @@ touch(fz_store *store, fz_item *item) } void * -fz_store_item(fz_context *ctx, void *key, void *val_, size_t itemsize, fz_store_type *type) +fz_store_item(fz_context *ctx, void *key, void *val_, size_t itemsize, const fz_store_type *type) { fz_item *item = NULL; size_t size; @@ -525,7 +525,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, size_t itemsize, fz_store_ } void * -fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *type) +fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, const fz_store_type *type) { fz_item *item; fz_store *store = ctx->store; @@ -578,7 +578,7 @@ fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type * } void -fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *type) +fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, const fz_store_type *type) { fz_item *item; fz_store *store = ctx->store; @@ -832,7 +832,7 @@ fz_shrink_store(fz_context *ctx, unsigned int percent) return success; } -void fz_filter_store(fz_context *ctx, fz_store_filter_fn *fn, void *arg, fz_store_type *type) +void fz_filter_store(fz_context *ctx, fz_store_filter_fn *fn, void *arg, const fz_store_type *type) { fz_store *store; fz_item *item, *prev, *remove; diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 3cced0d8..d993188c 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -963,7 +963,9 @@ hail_mary_print_key(fz_context *ctx, fz_output *out, void *key_) fz_write_printf(ctx, out, "hail mary "); } -static fz_store_type hail_mary_store_type = +static int hail_mary_store_key; /* Dummy */ + +static const fz_store_type hail_mary_store_type = { hail_mary_make_hash_key, hail_mary_keep_key, @@ -978,7 +980,7 @@ pdf_load_hail_mary_font(fz_context *ctx, pdf_document *doc) pdf_font_desc *fontdesc; pdf_font_desc *existing; - if ((fontdesc = fz_find_item(ctx, pdf_drop_font_imp, &hail_mary_store_type, &hail_mary_store_type)) != NULL) + if ((fontdesc = fz_find_item(ctx, pdf_drop_font_imp, &hail_mary_store_key, &hail_mary_store_type)) != NULL) { return fontdesc; } @@ -986,7 +988,7 @@ pdf_load_hail_mary_font(fz_context *ctx, pdf_document *doc) /* FIXME: Get someone with a clue about fonts to fix this */ fontdesc = pdf_load_simple_font_by_name(ctx, doc, NULL, "Helvetica"); - existing = fz_store_item(ctx, &hail_mary_store_type, fontdesc, fontdesc->size, &hail_mary_store_type); + existing = fz_store_item(ctx, &hail_mary_store_key, fontdesc, fontdesc->size, &hail_mary_store_type); assert(existing == NULL); (void)existing; /* Silence warning in release builds */ diff --git a/source/pdf/pdf-store.c b/source/pdf/pdf-store.c index e29e7ccb..c2d0669e 100644 --- a/source/pdf/pdf-store.c +++ b/source/pdf/pdf-store.c @@ -41,7 +41,7 @@ pdf_print_key(fz_context *ctx, fz_output *out, void *key_) pdf_print_obj(ctx, out, key, 0); } -static fz_store_type pdf_obj_store_type = +static const fz_store_type pdf_obj_store_type = { pdf_make_hash_key, pdf_keep_key, |