summaryrefslogtreecommitdiff
path: root/xps/xpsopacity.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-01-04 13:59:43 +0000
committerRobin Watts <robin.watts@artifex.com>2016-01-04 14:00:00 +0000
commit046f22db259214cb77b95e631d65ebdacec79a87 (patch)
tree33377592cce33be504cf21dbbbd8d7cb6775b2f9 /xps/xpsopacity.c
parent7a7588ce7c7cd1b0a8d55818af5d2f34dd17d3ff (diff)
downloadghostpdl-046f22db259214cb77b95e631d65ebdacec79a87.tar.gz
Squash warnings: XPS.
Avoid some warnings in the XPS code. Mostly 'set but unused' variables. Either remove these or (in cases where they may be required later) comment them out. Ensure that all return codes are checked once read. This has meant making a few functions return error codes that didn't before. Include an extra gs header in ghostxps.h. This trips the code into objecting to using printf etc. Change the calls to printf to use dlprintf instead (as they should do). Change the prototypes for some functions to pass const params in some cases, and make a few return error codes rather than ignoring them. Add a couple of missing prototypes.
Diffstat (limited to 'xps/xpsopacity.c')
-rw-r--r--xps/xpsopacity.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xps/xpsopacity.c b/xps/xpsopacity.c
index fd8bec659..986df3197 100644
--- a/xps/xpsopacity.c
+++ b/xps/xpsopacity.c
@@ -38,8 +38,8 @@ xps_bounds_in_user_space(xps_context_t *ctx, gs_rect *ubox)
/* This will get the proper bounds based upon the current path, clip path
and stroke width */
-void xps_bounds_in_user_space_path_clip(xps_context_t *ctx, gs_rect *ubox,
- bool use_path, bool is_stroke)
+int xps_bounds_in_user_space_path_clip(xps_context_t *ctx, gs_rect *ubox,
+ bool use_path, bool is_stroke)
{
int code;
gs_rect bbox;
@@ -52,7 +52,10 @@ void xps_bounds_in_user_space_path_clip(xps_context_t *ctx, gs_rect *ubox,
else
code = gx_curr_bbox(ctx->pgs, &bbox, PATH_FILL);
}
+ if (code < 0)
+ return code;
gs_bbox_transform_inverse(&bbox, &ctm_only(ctx->pgs), ubox);
+ return code;
}
int
@@ -76,7 +79,9 @@ xps_begin_opacity(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
gs_setblendmode(ctx->pgs, BLEND_MODE_Normal);
gs_setopacityalpha(ctx->pgs, opacity);
- xps_bounds_in_user_space_path_clip(ctx, &bbox, use_path, is_stroke);
+ code = xps_bounds_in_user_space_path_clip(ctx, &bbox, use_path, is_stroke);
+ if (code < 0)
+ return code;
if (opacity_mask_tag)
{