From d956556d0e06aa5c8e39eed410b3eb098cc2e742 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 28 May 2013 21:46:00 +0200 Subject: Silence warnings. --- fitz/res_pwg.c | 3 --- pdf/pdf_device.c | 5 +++-- pdf/pdf_interpret.c | 2 -- xps/xps_glyphs.c | 2 -- xps/xps_gradient.c | 4 ---- xps/xps_image.c | 23 ++++++++++++++++++----- xps/xps_tile.c | 4 ---- xps/xps_zip.c | 6 +++--- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/fitz/res_pwg.c b/fitz/res_pwg.c index 87ac8c74..ea2ef588 100644 --- a/fitz/res_pwg.c +++ b/fitz/res_pwg.c @@ -174,14 +174,11 @@ fz_output_pwg_bitmap_page(fz_output *out, const fz_bitmap *bitmap, const fz_pwg_ { unsigned char *sp; int y, x, ss; - fz_context *ctx; int byte_width; if (!out || !bitmap) return; - ctx = out->ctx; - output_header(out, pwg, bitmap->xres, bitmap->yres, bitmap->w, bitmap->h, 1); /* Now output the actual bitmap, using a packbits like compression */ diff --git a/pdf/pdf_device.c b/pdf/pdf_device.c index 37256316..608e6eb8 100644 --- a/pdf/pdf_device.c +++ b/pdf/pdf_device.c @@ -823,6 +823,7 @@ pdf_dev_new_form(pdf_obj **form_ref, pdf_device *pdev, const fz_rect *bbox, int snprintf(text, sizeof(text), "XObject/Fm%d", num); pdf_dict_putp(pdev->resources, text, *form_ref); } + return num; } @@ -1023,7 +1024,7 @@ pdf_dev_begin_mask(fz_device *dev, const fz_rect *bbox, int luminosity, fz_color pdf_obj *egs_ref; pdf_obj *form_ref; pdf_obj *color_obj = NULL; - int num, i; + int i; fz_var(smask); fz_var(egs); @@ -1032,7 +1033,7 @@ pdf_dev_begin_mask(fz_device *dev, const fz_rect *bbox, int luminosity, fz_color pdf_dev_end_text(pdev); /* Make a new form to contain the contents of the softmask */ - num = pdf_dev_new_form(&form_ref, pdev, bbox, 0, 0, 0, 1, colorspace); + pdf_dev_new_form(&form_ref, pdev, bbox, 0, 0, 0, 1, colorspace); fz_try(ctx) { diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index b6821d27..13d6751e 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -1490,7 +1490,6 @@ pdf_run_xobject(pdf_csi *csi, pdf_obj *resources, pdf_xobject *xobj, const fz_ma fz_context *ctx = csi->dev->ctx; pdf_gstate *gstate = NULL; int oldtop = 0; - int popmask; fz_matrix local_transform = *transform; softmask_save softmask = { NULL }; int gparent_save; @@ -1512,7 +1511,6 @@ pdf_run_xobject(pdf_csi *csi, pdf_obj *resources, pdf_xobject *xobj, const fz_ma gstate = csi->gstate + csi->gtop; oldtop = csi->gtop; - popmask = 0; /* apply xobject's transform matrix */ fz_concat(&local_transform, &xobj->matrix, &local_transform); diff --git a/xps/xps_glyphs.c b/xps/xps_glyphs.c index 1b926dfc..76015fb7 100644 --- a/xps/xps_glyphs.c +++ b/xps/xps_glyphs.c @@ -380,7 +380,6 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, char *opacity_mask_uri; char *bidi_level_att; - char *caret_stops_att; char *fill_att; char *font_size_att; char *font_uri_att; @@ -425,7 +424,6 @@ xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, */ bidi_level_att = fz_xml_att(root, "BidiLevel"); - caret_stops_att = fz_xml_att(root, "CaretStops"); fill_att = fz_xml_att(root, "Fill"); font_size_att = fz_xml_att(root, "FontRenderingEmSize"); font_uri_att = fz_xml_att(root, "FontUri"); diff --git a/xps/xps_gradient.c b/xps/xps_gradient.c index 3b4a2b88..17178f84 100644 --- a/xps/xps_gradient.c +++ b/xps/xps_gradient.c @@ -444,9 +444,7 @@ xps_parse_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect fz_xml *node; char *opacity_att; - char *interpolation_att; char *spread_att; - char *mapping_att; char *transform_att; fz_xml *transform_tag = NULL; @@ -458,9 +456,7 @@ xps_parse_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect int spread_method; opacity_att = fz_xml_att(root, "Opacity"); - interpolation_att = fz_xml_att(root, "ColorInterpolationMode"); spread_att = fz_xml_att(root, "SpreadMethod"); - mapping_att = fz_xml_att(root, "MappingMode"); transform_att = fz_xml_att(root, "Transform"); for (node = fz_xml_down(root); node; node = fz_xml_next(node)) diff --git a/xps/xps_image.c b/xps/xps_image.c index d0561bf7..f0406c5b 100644 --- a/xps/xps_image.c +++ b/xps/xps_image.c @@ -26,8 +26,8 @@ xps_paint_image_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *ar fz_fill_image(doc->dev, image, &local_ctm, doc->opacity[doc->opacity_top]); } -static xps_part * -xps_find_image_brush_source_part(xps_document *doc, char *base_uri, fz_xml *root) +static void +xps_find_image_brush_source_part(xps_document *doc, char *base_uri, fz_xml *root, xps_part **image_part, xps_part **profile_part) { char *image_source_att; char buf[1024]; @@ -71,9 +71,22 @@ xps_find_image_brush_source_part(xps_document *doc, char *base_uri, fz_xml *root if (!image_name) fz_throw(doc->ctx, "cannot find image source"); - xps_resolve_url(partname, base_uri, image_name, sizeof partname); + if (image_part) + { + xps_resolve_url(partname, base_uri, image_name, sizeof partname); + *image_part = xps_read_part(doc, partname); + } - return xps_read_part(doc, partname); + if (profile_part) + { + if (profile_name) + { + xps_resolve_url(partname, base_uri, profile_name, sizeof partname); + *profile_part = xps_read_part(doc, partname); + } + else + *profile_part = NULL; + } } void @@ -85,7 +98,7 @@ xps_parse_image_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *ar fz_try(doc->ctx) { - part = xps_find_image_brush_source_part(doc, base_uri, root); + xps_find_image_brush_source_part(doc, base_uri, root, &part, NULL); } fz_catch(doc->ctx) { diff --git a/xps/xps_tile.c b/xps/xps_tile.c index 15fad420..e508719d 100644 --- a/xps/xps_tile.c +++ b/xps/xps_tile.c @@ -75,8 +75,6 @@ xps_parse_tiling_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *a char *viewbox_att; char *viewport_att; char *tile_mode_att; - char *viewbox_units_att; - char *viewport_units_att; fz_xml *transform_tag = NULL; @@ -92,8 +90,6 @@ xps_parse_tiling_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *a viewbox_att = fz_xml_att(root, "Viewbox"); viewport_att = fz_xml_att(root, "Viewport"); tile_mode_att = fz_xml_att(root, "TileMode"); - viewbox_units_att = fz_xml_att(root, "ViewboxUnits"); - viewport_units_att = fz_xml_att(root, "ViewportUnits"); c.base_uri = base_uri; c.dict = dict; diff --git a/xps/xps_zip.c b/xps/xps_zip.c index 0db4f042..8aa48662 100644 --- a/xps/xps_zip.c +++ b/xps/xps_zip.c @@ -103,7 +103,7 @@ xps_read_zip_entry(xps_document *doc, xps_entry *ent, unsigned char *outbuf) z_stream stream; unsigned char *inbuf; int sig; - int version, general, method; + int method; int namelength, extralength; int code; fz_context *ctx = doc->ctx; @@ -116,8 +116,8 @@ xps_read_zip_entry(xps_document *doc, xps_entry *ent, unsigned char *outbuf) fz_throw(doc->ctx, "wrong zip local file signature (0x%x)", sig); } - version = getshort(doc->file); - general = getshort(doc->file); + (void) getshort(doc->file); /* version */ + (void) getshort(doc->file); /* general */ method = getshort(doc->file); (void) getshort(doc->file); /* file time */ (void) getshort(doc->file); /* file date */ -- cgit v1.2.3