summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/bobbin.c2
-rw-r--r--base/ets.c4
-rw-r--r--base/ets.h2
-rw-r--r--base/fapi_ft.c8
-rw-r--r--base/fapibstm.c2
-rw-r--r--base/fapiufst.c14
-rw-r--r--base/gdevbbox.c2
-rw-r--r--base/gdevdbit.c50
-rw-r--r--base/gdevepo.c20
-rw-r--r--base/gdevp14.h2
-rw-r--r--base/gp_psync.c2
-rw-r--r--base/gsccolor.h2
-rw-r--r--base/gscicach.c28
-rw-r--r--base/gscolor2.c2
-rw-r--r--base/gscspace.h2
-rw-r--r--base/gsdps1.c2
-rw-r--r--base/gsequivc.c6
-rw-r--r--base/gsequivc.h2
-rw-r--r--base/gsicc_cache.h4
-rw-r--r--base/gsicc_create.h2
-rw-r--r--base/gsiodisk.c6
-rw-r--r--base/gsmatrix.h2
-rw-r--r--base/gspath.c2
-rw-r--r--base/gssprintf.c16
-rw-r--r--base/gstext.c2
-rw-r--r--base/gstype42.c6
-rw-r--r--base/gxccman.c2
-rw-r--r--base/gxcht.c6
-rw-r--r--base/gxcldev.h8
-rw-r--r--base/gxclimag.c4
-rw-r--r--base/gxclip.c8
-rw-r--r--base/gxclip2.c6
-rw-r--r--base/gxclipm.c6
-rw-r--r--base/gxdcolor.c2
-rw-r--r--base/gxfapi.c16
-rw-r--r--base/gxfapi.h10
-rw-r--r--base/gximdecode.c2
-rw-r--r--base/gxpath.h10
-rw-r--r--base/gxshade1.c4
-rw-r--r--base/gxtext.h2
-rw-r--r--base/icc34.h192
-rw-r--r--base/pack_ps.c2
-rw-r--r--base/scfd.c2
-rw-r--r--base/sdctd.c6
-rw-r--r--base/sdcte.c8
-rw-r--r--base/sidscale.c10
-rw-r--r--base/simscale_foo.c2
-rw-r--r--base/siscale.c6
-rw-r--r--base/sjpegc.c4
-rw-r--r--base/sjpegd.c2
-rw-r--r--base/sjpx_openjpeg.c12
-rw-r--r--base/sjpx_openjpeg.h2
-rw-r--r--contrib/gdevdj9.c2
-rw-r--r--contrib/lips4/gdevl4r.c2
-rw-r--r--devices/gdevcmykog.c6
-rw-r--r--devices/gdevepsc.c4
-rw-r--r--devices/gdevepsn.c6
-rw-r--r--devices/gdevfax.c2
-rw-r--r--devices/gdevicov.c6
-rw-r--r--devices/gdevlxm.c2
-rw-r--r--devices/gdevxcf.c2
-rw-r--r--devices/gdevxini.c4
-rw-r--r--devices/vector/gdevpdfg.c2
-rw-r--r--devices/vector/gdevpdfk.c2
-rw-r--r--devices/vector/gdevpsdu.c4
-rw-r--r--devices/vector/gdevpx.c4
-rw-r--r--devices/vector/gdevxps.c86
-rw-r--r--pcl/pcl/pccid.c2
-rw-r--r--pcl/pcl/pcdraw.c4
-rw-r--r--pcl/pcl/pcfrgrnd.c2
-rw-r--r--pcl/pcl/pcfsel.c4
-rw-r--r--pcl/pcl/pcjob.c4
-rw-r--r--pcl/pcl/pcpage.c22
-rw-r--r--pcl/pcl/pcsymbol.c6
-rw-r--r--pcl/pcl/pgchar.c2
-rw-r--r--pcl/pcl/pgconfig.c6
-rw-r--r--pcl/pcl/pglfill.c2
-rw-r--r--pcl/pcl/pgparse.c2
-rw-r--r--pcl/pcl/rtgmode.c8
-rw-r--r--pcl/pl/plsymbol.c2
-rw-r--r--pcl/pl/plwmainc.c2
-rw-r--r--pcl/pxl/pxffont.c2
-rw-r--r--pcl/pxl/pxfont.c2
-rw-r--r--pcl/pxl/pxpaint.c2
-rw-r--r--pcl/pxl/pxptable.c2
-rw-r--r--psi/apitest.c6
-rw-r--r--psi/dwmainc.c2
-rw-r--r--psi/dxmain.c2
-rw-r--r--psi/zcolor.c2
-rw-r--r--psi/zfapi.c2
-rw-r--r--psi/zfimscale.c4
-rw-r--r--psi/zform.c2
-rw-r--r--psi/zpdf_r6.c2
93 files changed, 379 insertions, 379 deletions
diff --git a/base/bobbin.c b/base/bobbin.c
index 63720f3e1..0d84fa54d 100644
--- a/base/bobbin.c
+++ b/base/bobbin.c
@@ -298,7 +298,7 @@ static int Bobbin_thread(void *thread)
298 int i; 298 int i;
299 299
300 for (i = 0; i < bobbins.num_threads; i++) 300 for (i = 0; i < bobbins.num_threads; i++)
301 if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) && 301 if (BOBBIN_THREAD_EQUAL(bobbins.thread[i].thread, thread) &&
302 (bobbins.thread[i].flags & BOBBIN_THREAD_FINISHED) == 0) 302 (bobbins.thread[i].flags & BOBBIN_THREAD_FINISHED) == 0)
303 break; 303 break;
304 if (i == bobbins.num_threads) 304 if (i == bobbins.num_threads)
diff --git a/base/ets.c b/base/ets.c
index 2b6a073f5..c70151e45 100644
--- a/base/ets.c
+++ b/base/ets.c
@@ -844,7 +844,7 @@ ets_plane_new(void *malloc_arg, const ETS_Params *params, ETS_Ctx *etc, int plan
844 { 844 {
845 result->line[i].a = 1; 845 result->line[i].a = 1;
846 result->line[i].b = 1; 846 result->line[i].b = 1;
847 /* Initialize error with a non zero random value to ensure dots don't 847 /* Initialize error with a non zero random value to ensure dots don't
848 land on dots when we have same planes with same gray level and 848 land on dots when we have same planes with same gray level and
849 the plane interaction option is turned off. Ideally the level 849 the plane interaction option is turned off. Ideally the level
850 of this error should be based upon the values of the first line 850 of this error should be based upon the values of the first line
@@ -877,7 +877,7 @@ ets_destroy(void *malloc_arg, ETS_Ctx *ctx)
877{ 877{
878 int i; 878 int i;
879 int n_planes; 879 int n_planes;
880 880
881 if (ctx == NULL) 881 if (ctx == NULL)
882 return; 882 return;
883 883
diff --git a/base/ets.h b/base/ets.h
index a57bef527..ff764f7e8 100644
--- a/base/ets.h
+++ b/base/ets.h
@@ -57,7 +57,7 @@ extern "C" {
57 #define ETS_SRC_MAX 65535 57 #define ETS_SRC_MAX 65535
58#endif 58#endif
59 59
60/* Photoshop (and possibly other image formats define white in a CMYK image with a 60/* Photoshop (and possibly other image formats define white in a CMYK image with a
61 value of 255 (65535). This is opposite of the PAM files that Robin has created. 61 value of 255 (65535). This is opposite of the PAM files that Robin has created.
62 The ETS code expects white to be at 0. Adjustments to the values in gray level 62 The ETS code expects white to be at 0. Adjustments to the values in gray level
63 will be baked into the LUT if needed */ 63 will be baked into the LUT if needed */
diff --git a/base/fapi_ft.c b/base/fapi_ft.c
index 46f865efa..65fa6dcf4 100644
--- a/base/fapi_ft.c
+++ b/base/fapi_ft.c
@@ -699,10 +699,10 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
699 /* If FT gives us an error, try to fall back to the notdef - if that doesn't work, we'll throw an error over to Ghostscript */ 699 /* If FT gives us an error, try to fall back to the notdef - if that doesn't work, we'll throw an error over to Ghostscript */
700 if (ft_error) { 700 if (ft_error) {
701 gs_string notdef_str; 701 gs_string notdef_str;
702 702
703 notdef_str.data = (byte *)".notdef"; 703 notdef_str.data = (byte *)".notdef";
704 notdef_str.size = 7; 704 notdef_str.size = 7;
705 705
706 a_fapi_font->char_data = (void *)(&notdef_str); 706 a_fapi_font->char_data = (void *)(&notdef_str);
707 a_fapi_font->char_data_len = 0; 707 a_fapi_font->char_data_len = 0;
708 708
@@ -1365,7 +1365,7 @@ gs_fapi_ft_get_scaled_font(gs_fapi_server * a_server, gs_fapi_font * a_font,
1365 */ 1365 */
1366 1366
1367 FT_Set_Transform(face->ft_face, &face->ft_transform, NULL); 1367 FT_Set_Transform(face->ft_face, &face->ft_transform, NULL);
1368 1368
1369 if (!a_font->is_type1) { 1369 if (!a_font->is_type1) {
1370 for (i = 0; i < GS_FAPI_NUM_TTF_CMAP_REQ && !cmap; i++) { 1370 for (i = 0; i < GS_FAPI_NUM_TTF_CMAP_REQ && !cmap; i++) {
1371 if (a_font->ttf_cmap_req[i].platform_id > 0) { 1371 if (a_font->ttf_cmap_req[i].platform_id > 0) {
@@ -1817,7 +1817,7 @@ gs_fapi_ft_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, float
1817 setit = true; 1817 setit = true;
1818 } 1818 }
1819 } 1819 }
1820 1820
1821 if (setit == true) { 1821 if (setit == true) {
1822 ft_error = FT_Set_MM_WeightVector(face->ft_face, length, nwv); 1822 ft_error = FT_Set_MM_WeightVector(face->ft_face, length, nwv);
1823 if (ft_error != 0) return_error(gs_error_invalidaccess); 1823 if (ft_error != 0) return_error(gs_error_invalidaccess);
diff --git a/base/fapibstm.c b/base/fapibstm.c
index 0eb120c2e..3a21b5ec0 100644
--- a/base/fapibstm.c
+++ b/base/fapibstm.c
@@ -326,7 +326,7 @@ gs_fapi_bstm_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, floa
326 (void)ff; 326 (void)ff;
327 (void)wvector; 327 (void)wvector;
328 (void)length; 328 (void)length;
329 329
330 return gs_error_invalidaccess; 330 return gs_error_invalidaccess;
331} 331}
332 332
diff --git a/base/fapiufst.c b/base/fapiufst.c
index 4089e905d..b2050ef75 100644
--- a/base/fapiufst.c
+++ b/base/fapiufst.c
@@ -1805,7 +1805,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
1805 */ 1805 */
1806 code = CGIFFwidth2(FSA &glyph_width_code, 1, sizeof(glyph_width), glyph_width); 1806 code = CGIFFwidth2(FSA &glyph_width_code, 1, sizeof(glyph_width), glyph_width);
1807 } 1807 }
1808 1808
1809 if (code >= 0) { 1809 if (code >= 0) {
1810 code = CGIFchar_handle(FSA cc, &result, (SW16) 0); 1810 code = CGIFchar_handle(FSA cc, &result, (SW16) 0);
1811 } 1811 }
@@ -1816,7 +1816,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
1816 if (code == ERR_TT_UNDEFINED_INSTRUCTION 1816 if (code == ERR_TT_UNDEFINED_INSTRUCTION
1817#if UFST_VERSION_MAJOR >= 6 1817#if UFST_VERSION_MAJOR >= 6
1818 || (code >= ERR_TT_NULL_FUNCDEF && code <= ERR_TT_STACK_OUT_OF_RANGE) 1818 || (code >= ERR_TT_NULL_FUNCDEF && code <= ERR_TT_STACK_OUT_OF_RANGE)
1819#endif 1819#endif
1820 ) { 1820 ) {
1821 int savehint = FC_DONTHINTTT(fc); 1821 int savehint = FC_DONTHINTTT(fc);
1822 1822
@@ -1861,7 +1861,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
1861 code2 = CGIFchar_handle(FSA c1, &result, (SW16) 0); 1861 code2 = CGIFchar_handle(FSA c1, &result, (SW16) 0);
1862 if (code2 && code2 != ERR_fixed_space && code2 != ERR_bm_buff 1862 if (code2 && code2 != ERR_fixed_space && code2 != ERR_bm_buff
1863 && code2 != ERR_bm_too_big) { 1863 && code2 != ERR_bm_too_big) {
1864 1864
1865 notdef_str.data = (byte *)space; 1865 notdef_str.data = (byte *)space;
1866 notdef_str.size = strlen(space); 1866 notdef_str.size = strlen(space);
1867 ff->char_data = (void *)&notdef_str; 1867 ff->char_data = (void *)&notdef_str;
@@ -1911,7 +1911,7 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
1911 design_bbox[1] = pbm->top_indent; 1911 design_bbox[1] = pbm->top_indent;
1912 design_bbox[2] = pbm->black_width; 1912 design_bbox[2] = pbm->black_width;
1913 design_bbox[3] = pbm->black_depth; 1913 design_bbox[3] = pbm->black_depth;
1914 1914
1915 if (ff->is_vertical) { 1915 if (ff->is_vertical) {
1916 /* FIXME: this probably isn't need - we can probably just use glyph_width */ 1916 /* FIXME: this probably isn't need - we can probably just use glyph_width */
1917 if (pIFS->glyphMetricsDU.aw.x == 0 && pIFS->glyphMetricsDU.aw.y == 0) { 1917 if (pIFS->glyphMetricsDU.aw.x == 0 && pIFS->glyphMetricsDU.aw.y == 0) {
@@ -1958,13 +1958,13 @@ get_char(gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c,
1958 design_bbox[1] = pol->bottom; 1958 design_bbox[1] = pol->bottom;
1959 design_bbox[2] = pol->right; 1959 design_bbox[2] = pol->right;
1960 design_bbox[3] = pol->top; 1960 design_bbox[3] = pol->top;
1961 1961
1962 r->char_data = (IFOUTLINE *) result; 1962 r->char_data = (IFOUTLINE *) result;
1963 } 1963 }
1964 else { 1964 else {
1965 design_escapement[0] = glyph_width[0]; 1965 design_escapement[0] = glyph_width[0];
1966 design_escapement[1] = glyph_width[1]; 1966 design_escapement[1] = glyph_width[1];
1967 1967
1968 design_bbox[0] = design_bbox[1] = design_bbox[2] = design_bbox[3] = 0; 1968 design_bbox[0] = design_bbox[1] = design_bbox[2] = design_bbox[3] = 0;
1969 } 1969 }
1970#if 1 /* UFST 5.0 */ 1970#if 1 /* UFST 5.0 */
@@ -2224,7 +2224,7 @@ gs_fapi_ufst_set_mm_weight_vector(gs_fapi_server *server, gs_fapi_font *ff, floa
2224 (void)ff; 2224 (void)ff;
2225 (void)wvector; 2225 (void)wvector;
2226 (void)length; 2226 (void)length;
2227 2227
2228 return gs_error_invalidaccess; 2228 return gs_error_invalidaccess;
2229} 2229}
2230 2230
diff --git a/base/gdevbbox.c b/base/gdevbbox.c
index 20f80d3a0..33a421dbc 100644
--- a/base/gdevbbox.c
+++ b/base/gdevbbox.c
@@ -497,7 +497,7 @@ bbox_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles,
497 497
498static int 498static int
499bbox_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles, 499bbox_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
500 int x, int y, int w, int h, const gx_drawing_color *pdcolor0, 500 int x, int y, int w, int h, const gx_drawing_color *pdcolor0,
501 const gx_drawing_color *pdcolor1, int px, int py) 501 const gx_drawing_color *pdcolor1, int px, int py)
502{ 502{
503 gx_device_bbox *const bdev = (gx_device_bbox *) dev; 503 gx_device_bbox *const bdev = (gx_device_bbox *) dev;
diff --git a/base/gdevdbit.c b/base/gdevdbit.c
index fb9ff8003..d17239514 100644
--- a/base/gdevdbit.c
+++ b/base/gdevdbit.c
@@ -169,16 +169,16 @@ gx_no_copy_alpha(gx_device * dev, const byte * data, int data_x,
169 169
170/* Currently we really should only be here if the target device is planar 170/* Currently we really should only be here if the target device is planar
171 AND it supports devn colors AND is 8 or 16 bit. For example tiffsep 171 AND it supports devn colors AND is 8 or 16 bit. For example tiffsep
172 and psdcmyk may make use of this if AA is enabled. It is basically 172 and psdcmyk may make use of this if AA is enabled. It is basically
173 designed for devices that need more than 64 bits for color support 173 designed for devices that need more than 64 bits for color support
174 174
175 So that I can follow things and make it readable for future generations, 175 So that I can follow things and make it readable for future generations,
176 I am not using the macro nightmare that default_copy_alpha uses. */ 176 I am not using the macro nightmare that default_copy_alpha uses. */
177int 177int
178gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x, 178gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
179 int raster, gx_bitmap_id id, int x, int y, int width, int height, 179 int raster, gx_bitmap_id id, int x, int y, int width, int height,
180 const gx_drawing_color *pdcolor, int depth) 180 const gx_drawing_color *pdcolor, int depth)
181{ 181{
182 const byte *row_alpha; 182 const byte *row_alpha;
183 gs_memory_t *mem = dev->memory; 183 gs_memory_t *mem = dev->memory;
184 int bpp = dev->color_info.depth; 184 int bpp = dev->color_info.depth;
@@ -223,7 +223,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
223 | GB_ALIGN_STANDARD 223 | GB_ALIGN_STANDARD
224 | GB_OFFSET_0 224 | GB_OFFSET_0
225 | GB_RASTER_STANDARD 225 | GB_RASTER_STANDARD
226 | GB_SELECT_PLANES; 226 | GB_SELECT_PLANES;
227 gb_rect.p.x = x; 227 gb_rect.p.x = x;
228 gb_rect.q.x = x + width; 228 gb_rect.q.x = x + width;
229 for (ry = y; ry < y + height; row_alpha += raster, ++ry) { 229 for (ry = y; ry < y + height; row_alpha += raster, ++ry) {
@@ -234,13 +234,13 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
234 for (k = 0; k < ncomps; k++) { 234 for (k = 0; k < ncomps; k++) {
235 /* First set the params to zero for all planes except the one we want */ 235 /* First set the params to zero for all planes except the one we want */
236 /* I am not sure why get_bits_rectangle for the planar device can 236 /* I am not sure why get_bits_rectangle for the planar device can
237 not hand back the data in a proper planar form. To get the 237 not hand back the data in a proper planar form. To get the
238 individual planes seems that I need to jump through some hoops 238 individual planes seems that I need to jump through some hoops
239 here */ 239 here */
240 for (j = 0; j < ncomps; j++) 240 for (j = 0; j < ncomps; j++)
241 gb_params.data[j] = 0; 241 gb_params.data[j] = 0;
242 gb_params.data[k] = gb_buff + k * out_raster; 242 gb_params.data[k] = gb_buff + k * out_raster;
243 code = dev_proc(dev, get_bits_rectangle) (dev, &gb_rect, 243 code = dev_proc(dev, get_bits_rectangle) (dev, &gb_rect,
244 &gb_params, 0); 244 &gb_params, 0);
245 src_planes[k] = gb_params.data[k]; 245 src_planes[k] = gb_params.data[k];
246 if (code < 0) { 246 if (code < 0) {
@@ -248,7 +248,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
248 return code; 248 return code;
249 } 249 }
250 } 250 }
251 /* At this point we have to carry around some additional variables 251 /* At this point we have to carry around some additional variables
252 so that we can handle any buffer flushes due to alpha == 0 values. 252 so that we can handle any buffer flushes due to alpha == 0 values.
253 See below why this is needed */ 253 See below why this is needed */
254 x_curr = x; 254 x_curr = x;
@@ -276,14 +276,14 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
276 276
277 if (alpha == 0) { 277 if (alpha == 0) {
278 /* With alpha 0 we want to avoid writing out this value. 278 /* With alpha 0 we want to avoid writing out this value.
279 * While it is true that writting it out leaves the color 279 * While it is true that writting it out leaves the color
280 * unchanged, any device that's watching what pixels are 280 * unchanged, any device that's watching what pixels are
281 * written (such as the pattern tile devices) may have problems. 281 * written (such as the pattern tile devices) may have problems.
282 * As in gx_default_copy_alpha the right thing to do is to write 282 * As in gx_default_copy_alpha the right thing to do is to write
283 * out what we have so far and then continue to collect when we 283 * out what we have so far and then continue to collect when we
284 * get back to non zero alpha. */ 284 * get back to non zero alpha. */
285 code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]), 285 code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
286 0, out_raster, gs_no_bitmap_id, 286 0, out_raster, gs_no_bitmap_id,
287 x_curr, ry, w_curr-1, 1, 1); 287 x_curr, ry, w_curr-1, 1, 1);
288 if (code < 0) { 288 if (code < 0) {
289 gs_free_object(mem, gb_buff, "copy_alpha_hl_color"); 289 gs_free_object(mem, gb_buff, "copy_alpha_hl_color");
@@ -303,7 +303,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
303 /* First get the old color */ 303 /* First get the old color */
304 for (k = 0; k < ncomps; k++) { 304 for (k = 0; k < ncomps; k++) {
305 /* We only have 8 and 16 bit depth to worry about. 305 /* We only have 8 and 16 bit depth to worry about.
306 However, this stuff should really be done with 306 However, this stuff should really be done with
307 the device encode/decode procedure. */ 307 the device encode/decode procedure. */
308 byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width); 308 byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width);
309 curr_cv[k] = 0; 309 curr_cv[k] = 0;
@@ -316,13 +316,13 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
316 curr_cv[k] += *ptr; 316 curr_cv[k] += *ptr;
317 curr_cv[k] += curr_cv[k] << 8; 317 curr_cv[k] += curr_cv[k] << 8;
318 } 318 }
319 /* Now compute the new color which is a blend of 319 /* Now compute the new color which is a blend of
320 the old and the new */ 320 the old and the new */
321 blend_cv[k] = ((curr_cv[k]<<8) + 321 blend_cv[k] = ((curr_cv[k]<<8) +
322 (((long) src_cv[k] - (long) curr_cv[k]) * alpha))>>8; 322 (((long) src_cv[k] - (long) curr_cv[k]) * alpha))>>8;
323 composite = &(blend_cv[0]); 323 composite = &(blend_cv[0]);
324 } 324 }
325 } 325 }
326 /* Update our plane data buffers. Just reuse the current one */ 326 /* Update our plane data buffers. Just reuse the current one */
327 for (k = 0; k < ncomps; k++) { 327 for (k = 0; k < ncomps; k++) {
328 byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width); 328 byte *ptr = ((src_planes[k]) + (sx - data_x) * word_width);
@@ -335,10 +335,10 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
335 } 335 }
336 } /* else on alpha != 0 */ 336 } /* else on alpha != 0 */
337 } /* loop on x */ 337 } /* loop on x */
338 /* Flush what ever we have left. We may only have a partial due to 338 /* Flush what ever we have left. We may only have a partial due to
339 the presence of alpha = 0 values */ 339 the presence of alpha = 0 values */
340 code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]), 340 code = dev_proc(dev, copy_planes)(dev, &(gb_buff[gb_buff_start]),
341 0, out_raster, gs_no_bitmap_id, 341 0, out_raster, gs_no_bitmap_id,
342 x_curr, ry, w_curr, 1, 1); 342 x_curr, ry, w_curr, 1, 1);
343 } /* loop on y */ 343 } /* loop on y */
344 gs_free_object(mem, gb_buff, "copy_alpha_hl_color"); 344 gs_free_object(mem, gb_buff, "copy_alpha_hl_color");
@@ -596,15 +596,15 @@ gx_default_fill_mask(gx_device * orig_dev,
596} 596}
597 597
598/* Default implementation of strip_tile_rect_devn. With the current design 598/* Default implementation of strip_tile_rect_devn. With the current design
599 only devices that support devn color will be making use of this 599 only devices that support devn color will be making use of this
600 procedure and those are planar devices. So we have an implemenation 600 procedure and those are planar devices. So we have an implemenation
601 for planar devices and not a default implemenetation at this time. */ 601 for planar devices and not a default implemenetation at this time. */
602int 602int
603gx_default_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles, 603gx_default_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
604 int x, int y, int w, int h, const gx_drawing_color * pdcolor0, 604 int x, int y, int w, int h, const gx_drawing_color * pdcolor0,
605 const gx_drawing_color * pdcolor1, int px, int py) 605 const gx_drawing_color * pdcolor1, int px, int py)
606{ 606{
607 return_error(gs_error_unregistered); 607 return_error(gs_error_unregistered);
608} 608}
609 609
610/* Default implementation of strip_tile_rectangle */ 610/* Default implementation of strip_tile_rectangle */
diff --git a/base/gdevepo.c b/base/gdevepo.c
index e34542732..95f676d51 100644
--- a/base/gdevepo.c
+++ b/base/gdevepo.c
@@ -230,16 +230,16 @@ epo_check_and_install(gx_device *dev)
230 int code = 0; 230 int code = 0;
231 bool is_installed; 231 bool is_installed;
232 bool can_optimize = false; 232 bool can_optimize = false;
233 233
234 /* Debugging mode to totally disable this */ 234 /* Debugging mode to totally disable this */
235 if (gs_debug_c(gs_debug_flag_epo_disable)) { 235 if (gs_debug_c(gs_debug_flag_epo_disable)) {
236 return code; 236 return code;
237 } 237 }
238 238
239 DPRINTF1(dev->memory, "current device is %s\n", dev->dname); 239 DPRINTF1(dev->memory, "current device is %s\n", dev->dname);
240 240
241 is_installed = is_device_installed(dev, EPO_DEVICENAME); 241 is_installed = is_device_installed(dev, EPO_DEVICENAME);
242 242
243 if (is_installed) { 243 if (is_installed) {
244 DPRINTF1(dev->memory, "device %s already installed\n", EPO_DEVICENAME); 244 DPRINTF1(dev->memory, "device %s already installed\n", EPO_DEVICENAME);
245 /* This is looking for the case where the device 245 /* This is looking for the case where the device
@@ -254,7 +254,7 @@ epo_check_and_install(gx_device *dev)
254 /* Not doing any pending fillpages because we are about to do 254 /* Not doing any pending fillpages because we are about to do
255 * a fillpage anyway 255 * a fillpage anyway
256 */ 256 */
257 gx_device_unsubclass(dev); 257 gx_device_unsubclass(dev);
258 return code; 258 return code;
259 } 259 }
260 } else { 260 } else {
@@ -278,7 +278,7 @@ epo_check_and_install(gx_device *dev)
278 DPRINTF1(dev->memory, "ERROR installing device %s\n", EPO_DEVICENAME); 278 DPRINTF1(dev->memory, "ERROR installing device %s\n", EPO_DEVICENAME);
279 return code; 279 return code;
280 } 280 }
281 281
282 DPRINTF1(dev->memory, "SUCCESS installed device %s\n", dev->dname); 282 DPRINTF1(dev->memory, "SUCCESS installed device %s\n", dev->dname);
283 return code; 283 return code;
284} 284}
@@ -288,7 +288,7 @@ epo_handle_erase_page(gx_device *dev)
288{ 288{
289 erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data; 289 erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data;
290 int code = 0; 290 int code = 0;
291 291
292 if (gs_debug_c(gs_debug_flag_epo_install_only)) { 292 if (gs_debug_c(gs_debug_flag_epo_install_only)) {
293 gx_device_unsubclass(dev); 293 gx_device_unsubclass(dev);
294 DPRINTF1(dev->memory, "Uninstall erasepage, device=%s\n", dev->dname); 294 DPRINTF1(dev->memory, "Uninstall erasepage, device=%s\n", dev->dname);
@@ -314,7 +314,7 @@ epo_handle_erase_page(gx_device *dev)
314int epo_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc) 314int epo_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
315{ 315{
316 erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data; 316 erasepage_subclass_data *data = (erasepage_subclass_data *)dev->subclass_data;
317 317
318 if (gs_debug_c(gs_debug_flag_epo_install_only)) { 318 if (gs_debug_c(gs_debug_flag_epo_install_only)) {
319 return default_subclass_fillpage(dev, pgs, pdevc); 319 return default_subclass_fillpage(dev, pgs, pdevc);
320 } 320 }
@@ -322,13 +322,13 @@ int epo_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
322 /* If color is not pure, don't defer this, uninstall and do it now */ 322 /* If color is not pure, don't defer this, uninstall and do it now */
323 if (!color_is_pure(pdevc)) { 323 if (!color_is_pure(pdevc)) {
324 DPRINTF(dev->memory, "epo_fillpage(), color is not pure, uninstalling\n"); 324 DPRINTF(dev->memory, "epo_fillpage(), color is not pure, uninstalling\n");
325 gx_device_unsubclass(dev); 325 gx_device_unsubclass(dev);
326 return dev_proc(dev, fillpage)(dev, pgs, pdevc); 326 return dev_proc(dev, fillpage)(dev, pgs, pdevc);
327 } 327 }
328 328
329 /* Save the color being requested, and swallow the fillpage */ 329 /* Save the color being requested, and swallow the fillpage */
330 data->last_color = pdevc->colors.pure; 330 data->last_color = pdevc->colors.pure;
331 331
332 DPRINTF(dev->memory, "Swallowing fillpage\n"); 332 DPRINTF(dev->memory, "Swallowing fillpage\n");
333 return 0; 333 return 0;
334} 334}
diff --git a/base/gdevp14.h b/base/gdevp14.h
index 635ab1113..c4bf77b1e 100644
--- a/base/gdevp14.h
+++ b/base/gdevp14.h
@@ -100,7 +100,7 @@ struct pdf14_mask_s {
100/* A structure to hold information about the group color related 100/* A structure to hold information about the group color related
101 * procs and other information. These may change depending upon 101 * procs and other information. These may change depending upon
102 * if the blending space is different than the base space. 102 * if the blending space is different than the base space.
103 * The structure is a list that is updated upo every transparency 103 * The structure is a list that is updated upo every transparency
104 * group push and pop */ 104 * group push and pop */
105 105
106typedef struct pdf14_group_color_s pdf14_group_color_t; 106typedef struct pdf14_group_color_s pdf14_group_color_t;
diff --git a/base/gp_psync.c b/base/gp_psync.c
index 6d2c583e4..a15d5bcca 100644
--- a/base/gp_psync.c
+++ b/base/gp_psync.c
@@ -215,7 +215,7 @@ gp_monitor_open(gp_monitor * mona)
215 if (scode < 0) { 215 if (scode < 0) {
216 goto done; 216 goto done;
217 } 217 }
218#else 218#else
219 ((gp_pthread_recursive_t *)mona)->self_id = 0; /* Not valid unless mutex is locked */ 219 ((gp_pthread_recursive_t *)mona)->self_id = 0; /* Not valid unless mutex is locked */
220 ((gp_pthread_recursive_t *)mona)->lcount = 0; 220 ((gp_pthread_recursive_t *)mona)->lcount = 0;
221#endif 221#endif
diff --git a/base/gsccolor.h b/base/gsccolor.h
index 1bdef3118..3689be42d 100644
--- a/base/gsccolor.h
+++ b/base/gsccolor.h
@@ -36,7 +36,7 @@ typedef struct gs_pattern_instance_s gs_pattern_instance_t;
36# define GS_CLIENT_COLOR_MAX_COMPONENTS (64) 36# define GS_CLIENT_COLOR_MAX_COMPONENTS (64)
37#endif 37#endif
38 38
39#ifndef MAX_COMPONENTS_IN_DEVN 39#ifndef MAX_COMPONENTS_IN_DEVN
40# define MAX_COMPONENTS_IN_DEVN (64) 40# define MAX_COMPONENTS_IN_DEVN (64)
41#endif 41#endif
42 42
diff --git a/base/gscicach.c b/base/gscicach.c
index b524feb13..0ea68c187 100644
--- a/base/gscicach.c
+++ b/base/gscicach.c
@@ -31,7 +31,7 @@ typedef struct gs_color_index_cache_elem_s gs_color_index_cache_elem_t;
31struct gs_color_index_cache_elem_s { 31struct gs_color_index_cache_elem_s {
32 union _color { 32 union _color {
33 gx_color_index cindex; 33 gx_color_index cindex;
34 ushort devn[GS_CLIENT_COLOR_MAX_COMPONENTS]; 34 ushort devn[GS_CLIENT_COLOR_MAX_COMPONENTS];
35 } color; 35 } color;
36 gx_device_color_type color_type; 36 gx_device_color_type color_type;
37 uint chain; 37 uint chain;
@@ -189,7 +189,7 @@ include_into_touch_list(gs_color_index_cache_t *self, uint i)
189} 189}
190 190
191static int 191static int
192get_color_index_cache_elem(gs_color_index_cache_t *self, 192get_color_index_cache_elem(gs_color_index_cache_t *self,
193 const float *paint_values, uint *pi) 193 const float *paint_values, uint *pi)
194{ 194{
195 int client_num_components = self->client_num_components; 195 int client_num_components = self->client_num_components;
@@ -199,7 +199,7 @@ get_color_index_cache_elem(gs_color_index_cache_t *self,
199 if (i != MYNULL) { 199 if (i != MYNULL) {
200 uint tries = 16; /* Arbitrary. */ 200 uint tries = 16; /* Arbitrary. */
201 201
202 if (!memcmp(paint_values, self->paint_values + i * client_num_components, 202 if (!memcmp(paint_values, self->paint_values + i * client_num_components,
203 sizeof(*paint_values) * client_num_components)) { 203 sizeof(*paint_values) * client_num_components)) {
204 if (self->recent_touch != i) { 204 if (self->recent_touch != i) {
205 exclude_from_touch_list(self, i); 205 exclude_from_touch_list(self, i);
@@ -209,7 +209,7 @@ get_color_index_cache_elem(gs_color_index_cache_t *self,
209 return 1; 209 return 1;
210 } 210 }
211 for (j = self->buf[i].next; tries -- && j != i; j = self->buf[j].next) { 211 for (j = self->buf[i].next; tries -- && j != i; j = self->buf[j].next) {
212 if (!memcmp(paint_values, self->paint_values + j * client_num_components, 212 if (!memcmp(paint_values, self->paint_values + j * client_num_components,
213 sizeof(*paint_values) * client_num_components)) { 213 sizeof(*paint_values) * client_num_components)) {
214 exclude_from_chain(self, j); 214 exclude_from_chain(self, j);
215 include_into_chain(self, j, c); 215 include_into_chain(self, j, c);
@@ -251,15 +251,15 @@ compute_frac_values(gs_color_index_cache_t *self, uint i)
251 for (j = 0; j < device_num_components; j++) { 251 for (j = 0; j < device_num_components; j++) {
252 int shift = cinfo->comp_shift[j]; 252 int shift = cinfo->comp_shift[j];
253 int bits = cinfo->comp_bits[j]; 253 int bits = cinfo->comp_bits[j];
254 self->frac_values[i * device_num_components + j] = 254 self->frac_values[i * device_num_components + j] =
255 ((c >> shift) & ((1 << bits) - 1)) << 255 ((c >> shift) & ((1 << bits) - 1)) <<
256 (sizeof(frac31) * 8 - 1 - bits); 256 (sizeof(frac31) * 8 - 1 - bits);
257 } 257 }
258 self->buf[i].frac_values_done = true; 258 self->buf[i].frac_values_done = true;
259 } else { 259 } else {
260 /* Must be devn */ 260 /* Must be devn */
261 for (j = 0; j < device_num_components; j++) { 261 for (j = 0; j < device_num_components; j++) {
262 self->frac_values[i * device_num_components + j] = 262 self->frac_values[i * device_num_components + j] =
263 cv2frac31(self->buf[i].color.devn[j]); 263 cv2frac31(self->buf[i].color.devn[j]);
264 } 264 }
265 self->buf[i].frac_values_done = true; 265 self->buf[i].frac_values_done = true;
@@ -267,7 +267,7 @@ compute_frac_values(gs_color_index_cache_t *self, uint i)
267} 267}
268 268
269int 269int
270gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values, 270gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
271 gx_device_color *pdevc, frac31 *frac_values) 271 gx_device_color *pdevc, frac31 *frac_values)
272{ 272{
273 /* Must return 2 if the color is not pure. 273 /* Must return 2 if the color is not pure.
@@ -283,7 +283,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
283 if (self->buf[i].color_type == &gx_dc_type_data_pure) { 283 if (self->buf[i].color_type == &gx_dc_type_data_pure) {
284 pdevc->colors.pure = self->buf[i].color.cindex; 284 pdevc->colors.pure = self->buf[i].color.cindex;
285 pdevc->type = &gx_dc_type_data_pure; 285 pdevc->type = &gx_dc_type_data_pure;
286 memcpy(pdevc->ccolor.paint.values, paint_values, 286 memcpy(pdevc->ccolor.paint.values, paint_values,
287 sizeof(*paint_values) * client_num_components); 287 sizeof(*paint_values) * client_num_components);
288 } else { 288 } else {
289 /* devn case */ 289 /* devn case */
@@ -291,7 +291,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
291 pdevc->colors.devn.values[j] = self->buf[i].color.devn[j]; 291 pdevc->colors.devn.values[j] = self->buf[i].color.devn[j];
292 } 292 }
293 pdevc->type = &gx_dc_type_data_devn; 293 pdevc->type = &gx_dc_type_data_devn;
294 memcpy(pdevc->ccolor.paint.values, paint_values, 294 memcpy(pdevc->ccolor.paint.values, paint_values,
295 sizeof(*paint_values) * client_num_components); 295 sizeof(*paint_values) * client_num_components);
296 } 296 }
297 pdevc->ccolor_valid = true; 297 pdevc->ccolor_valid = true;
@@ -304,11 +304,11 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
304 304
305 if (pdevc == NULL) 305 if (pdevc == NULL)
306 pdevc = &devc_local; 306 pdevc = &devc_local;
307 memcpy(self->paint_values + i * client_num_components, paint_values, 307 memcpy(self->paint_values + i * client_num_components, paint_values,
308 sizeof(*paint_values) * client_num_components); 308 sizeof(*paint_values) * client_num_components);
309 memcpy(fcc.paint.values, paint_values, 309 memcpy(fcc.paint.values, paint_values,
310 sizeof(*paint_values) * client_num_components); 310 sizeof(*paint_values) * client_num_components);
311 code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pgs, 311 code = pcs->type->remap_color(&fcc, pcs, pdevc, self->pgs,
312 self->trans_dev, gs_color_select_texture); 312 self->trans_dev, gs_color_select_texture);
313 if (code < 0) 313 if (code < 0)
314 return code; 314 return code;
@@ -328,7 +328,7 @@ gs_cached_color_index(gs_color_index_cache_t *self, const float *paint_values,
328 self->buf[i].frac_values_done = false; 328 self->buf[i].frac_values_done = false;
329 } 329 }
330 if (frac_values != NULL) 330 if (frac_values != NULL)
331 memcpy(frac_values, self->frac_values + i * device_num_components, 331 memcpy(frac_values, self->frac_values + i * device_num_components,
332 sizeof(*frac_values) * device_num_components); 332 sizeof(*frac_values) * device_num_components);
333 return 0; 333 return 0;
334} 334}
diff --git a/base/gscolor2.c b/base/gscolor2.c
index 08bdfc270..7c5439c6a 100644
--- a/base/gscolor2.c
+++ b/base/gscolor2.c
@@ -218,7 +218,7 @@ const gs_color_space_type gs_color_space_type_Indexed = {
218}; 218};
219 219
220/* To keep things vectorized and avoid an if test during the remap proc we 220/* To keep things vectorized and avoid an if test during the remap proc we
221 have another set of procedures to use for indexed color spaces when 221 have another set of procedures to use for indexed color spaces when
222 someone has specified a named color profile and the base space of the 222 someone has specified a named color profile and the base space of the
223 index color space is DeviceN or Separation */ 223 index color space is DeviceN or Separation */
224const gs_color_space_type gs_color_space_type_Indexed_Named = { 224const gs_color_space_type gs_color_space_type_Indexed_Named = {
diff --git a/base/gscspace.h b/base/gscspace.h
index 0c07ccef4..a4aab7ca9 100644
--- a/base/gscspace.h
+++ b/base/gscspace.h
@@ -341,7 +341,7 @@ struct gs_color_space_s {
341gs_color_space *gs_cspace_new_DeviceGray(gs_memory_t *mem); 341gs_color_space *gs_cspace_new_DeviceGray(gs_memory_t *mem);
342gs_color_space *gs_cspace_new_DeviceRGB(gs_memory_t *mem); 342gs_color_space *gs_cspace_new_DeviceRGB(gs_memory_t *mem);
343gs_color_space *gs_cspace_new_DeviceCMYK(gs_memory_t *mem); 343gs_color_space *gs_cspace_new_DeviceCMYK(gs_memory_t *mem);
344gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs, 344gs_color_space *gs_cspace_new_ICC(gs_memory_t *pmem, gs_gstate * pgs,
345 int components); 345 int components);
346gs_color_space *gs_cspace_new_scrgb(gs_memory_t *pmem, gs_gstate * pgs); 346gs_color_space *gs_cspace_new_scrgb(gs_memory_t *pmem, gs_gstate * pgs);
347 347
diff --git a/base/gsdps1.c b/base/gsdps1.c
index 84980d4be..e3525b136 100644
--- a/base/gsdps1.c
+++ b/base/gsdps1.c
@@ -196,7 +196,7 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
196 const gs_gstate *pgs2 = (const gs_gstate *)pgs; 196 const gs_gstate *pgs2 = (const gs_gstate *)pgs;
197 bool hl_color_available = gx_hld_is_hl_color_available(pgs2, pdc); 197 bool hl_color_available = gx_hld_is_hl_color_available(pgs2, pdc);
198 bool hl_color = (hl_color_available && 198 bool hl_color = (hl_color_available &&
199 dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor, 199 dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor,
200 NULL, 0)); 200 NULL, 0));
201 bool center_of_pixel = (pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0); 201 bool center_of_pixel = (pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0);
202 202
diff --git a/base/gsequivc.c b/base/gsequivc.c
index fabcd331c..c268fb6d2 100644
--- a/base/gsequivc.c
+++ b/base/gsequivc.c
@@ -441,7 +441,7 @@ cmap_separation_capture_cmyk_color(frac all, gx_device_color * pdc,
441 dmprintf(pgs->memory, "cmap_separation_capture_cmyk_color - this routine should not be executed\n"); 441 dmprintf(pgs->memory, "cmap_separation_capture_cmyk_color - this routine should not be executed\n");
442} 442}
443 443
444/* The call to this is actually going to occur if we happen to be using a 444/* The call to this is actually going to occur if we happen to be using a
445 named color profile and doing a replacement. Since the destination profile 445 named color profile and doing a replacement. Since the destination profile
446 will have been CMYK based during the swap out to find the equivalent color, we can 446 will have been CMYK based during the swap out to find the equivalent color, we can
447 go ahead and just grab the cmyk portion */ 447 go ahead and just grab the cmyk portion */
@@ -518,10 +518,10 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
518 for the CMYK + OG values. */ 518 for the CMYK + OG values. */
519 519
520 if (curr_output_profile->data_cs == gsNCHANNEL) { 520 if (curr_output_profile->data_cs == gsNCHANNEL) {
521 temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] = 521 temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
522 temp_state.icc_manager->default_cmyk; 522 temp_state.icc_manager->default_cmyk;
523 } else { 523 } else {
524 temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] = 524 temp_profile.device_profile[GS_DEFAULT_DEVICE_PROFILE] =
525 curr_output_profile; 525 curr_output_profile;
526 } 526 }
527 set_dev_proc(&temp_device, get_profile, gx_default_get_profile); 527 set_dev_proc(&temp_device, get_profile, gx_default_get_profile);
diff --git a/base/gsequivc.h b/base/gsequivc.h
index 7fddce581..a36bb97cd 100644
--- a/base/gsequivc.h
+++ b/base/gsequivc.h
@@ -45,7 +45,7 @@ typedef struct cmyk_color_s {
45} cmyk_color; 45} cmyk_color;
46 46
47/* if you make any additions/changes to the equivalent_cmyk_color_params or the 47/* if you make any additions/changes to the equivalent_cmyk_color_params or the
48 cmyk_color structrs you need to make the appropriate additions/changes 48 cmyk_color structrs you need to make the appropriate additions/changes
49 to the compare_equivalent_cmyk_color_params() function in gdevdevn.c */ 49 to the compare_equivalent_cmyk_color_params() function in gdevdevn.c */
50 50
51/* 51/*
diff --git a/base/gsicc_cache.h b/base/gsicc_cache.h
index c9b9d0ab3..29ac034cc 100644
--- a/base/gsicc_cache.h
+++ b/base/gsicc_cache.h
@@ -37,7 +37,7 @@ void gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan,
37 unsigned char bytes_per_chan, bool has_alpha, bool alpha_first, 37 unsigned char bytes_per_chan, bool has_alpha, bool alpha_first,
38 bool is_planar, int plane_stride, int row_stride, int num_rows, 38 bool is_planar, int plane_stride, int row_stride, int num_rows,
39 int pixels_per_row); 39 int pixels_per_row);
40bool gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache, 40bool gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
41 gsicc_link_t **ret_link, gsicc_hashlink_t hash, 41 gsicc_link_t **ret_link, gsicc_hashlink_t hash,
42 bool include_softproof, bool include_devlink); 42 bool include_softproof, bool include_devlink);
43gsicc_link_t* gsicc_get_link(const gs_gstate * pgs, gx_device *dev, 43gsicc_link_t* gsicc_get_link(const gs_gstate * pgs, gx_device *dev,
@@ -55,7 +55,7 @@ void gsicc_link_free(gsicc_link_t *icc_link, const gs_memory_t *memory);
55void gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size); 55void gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size);
56int64_t gsicc_get_hash(cmm_profile_t *profile); 56int64_t gsicc_get_hash(cmm_profile_t *profile);
57int gsicc_transform_named_color(const float tint_values[], 57int gsicc_transform_named_color(const float tint_values[],
58 gsicc_namedcolor_t color_names[], 58 gsicc_namedcolor_t color_names[],
59 uint num_names, 59 uint num_names,
60 gx_color_value device_values[], 60 gx_color_value device_values[],
61 const gs_gstate *pgs, gx_device *dev, 61 const gs_gstate *pgs, gx_device *dev,
diff --git a/base/gsicc_create.h b/base/gsicc_create.h
index ca84eb3aa..b952a1c41 100644
--- a/base/gsicc_create.h
+++ b/base/gsicc_create.h
@@ -42,6 +42,6 @@ cmm_profile_t* gsicc_create_from_cal(float *white, float *black, float *gamma,
42 float *matrix, gs_memory_t *memory, 42 float *matrix, gs_memory_t *memory,
43 int num_colors); 43 int num_colors);
44byte* gsicc_getv2buffer(cmm_profile_t *srcprofile, int *size); 44byte* gsicc_getv2buffer(cmm_profile_t *srcprofile, int *size);
45byte* gsicc_create_getv2buffer(const gs_gstate *pgs, 45byte* gsicc_create_getv2buffer(const gs_gstate *pgs,
46 cmm_profile_t *srcprofile, int *size); 46 cmm_profile_t *srcprofile, int *size);
47#endif 47#endif
diff --git a/base/gsiodisk.c b/base/gsiodisk.c
index 5a127e1b6..2dcbe269e 100644
--- a/base/gsiodisk.c
+++ b/base/gsiodisk.c
@@ -239,7 +239,7 @@ iodev_diskn_fopen(gx_io_device * iodev, const char *fname, const char *access,
239 } 239 }
240 240
241 code = iodev_os_gp_fopen(iodev_default(pstate->memory), realname, access, pfile, rfname, rnamelen); 241 code = iodev_os_gp_fopen(iodev_default(pstate->memory), realname, access, pfile, rfname, rnamelen);
242 242
243done: 243done:
244 if (realname != NULL) 244 if (realname != NULL)
245 gs_free_object(pstate->memory, realname, "iodev_diskn_fopen(realname)"); 245 gs_free_object(pstate->memory, realname, "iodev_diskn_fopen(realname)");
@@ -359,7 +359,7 @@ diskn_enumerate_files(gs_memory_t * mem, gx_io_device * iodev, const char *pat,
359 uint patlen) 359 uint patlen)
360{ 360{
361 diskn_state * pstate = (diskn_state *)iodev->state; 361 diskn_state * pstate = (diskn_state *)iodev->state;
362 362
363 return (file_enum *)map_file_enum_init(mem, (char *)pstate->root, pat, patlen); 363 return (file_enum *)map_file_enum_init(mem, (char *)pstate->root, pat, patlen);
364} 364}
365 365
@@ -630,7 +630,7 @@ MapFileRename(gs_memory_t *mem, const char * rootpath, const char * newfilename,
630 oldfullname = (char *)gs_alloc_bytes(mem, ototlen, "MapFileRename(oldfullname)"); 630 oldfullname = (char *)gs_alloc_bytes(mem, ototlen, "MapFileRename(oldfullname)");
631 newfullname = (char *)gs_alloc_bytes(mem, ntotlen, "MapFileRename(newfullname)"); 631 newfullname = (char *)gs_alloc_bytes(mem, ntotlen, "MapFileRename(newfullname)");
632 632
633 if (oldfullname && newfullname) { 633 if (oldfullname && newfullname) {
634 gs_sprintf(oldfullname, "%s%s", rootpath, oldfilename); 634 gs_sprintf(oldfullname, "%s%s", rootpath, oldfilename);
635 gs_sprintf(newfullname, "%s%s", rootpath, newfilename); 635 gs_sprintf(newfullname, "%s%s", rootpath, newfilename);
636 rename(oldfullname, newfullname); 636 rename(oldfullname, newfullname);
diff --git a/base/gsmatrix.h b/base/gsmatrix.h
index ba365da1b..0a175aa51 100644
--- a/base/gsmatrix.h
+++ b/base/gsmatrix.h
@@ -26,7 +26,7 @@
26/* transformation matrices. */ 26/* transformation matrices. */
27 27
28/* if you make any additions/changes to the gs_matrix_s structure or the 28/* if you make any additions/changes to the gs_matrix_s structure or the
29 _matrix_body macro you need to make the appropriate additions/changes 29 _matrix_body macro you need to make the appropriate additions/changes
30 to the gs_matrix_compare() function in gsmatrix.c */ 30 to the gs_matrix_compare() function in gsmatrix.c */
31/* Structure for a transformation matrix. */ 31/* Structure for a transformation matrix. */
32#define _matrix_body\ 32#define _matrix_body\
diff --git a/base/gspath.c b/base/gspath.c
index 02d4c54b7..773bfae8b 100644
--- a/base/gspath.c
+++ b/base/gspath.c
@@ -324,7 +324,7 @@ static int common_clip(gs_gstate *, int);
324 324
325/* Figure out the bbox for a path and a clip path with adjustment if we are 325/* Figure out the bbox for a path and a clip path with adjustment if we are
326 also doing a stroke. This is used by the xps interpeter to deteremine 326 also doing a stroke. This is used by the xps interpeter to deteremine
327 how big of a transparency group or softmask should be pushed. Often in 327 how big of a transparency group or softmask should be pushed. Often in
328 xps we fill a path with a particular softmask and some other graphic object. 328 xps we fill a path with a particular softmask and some other graphic object.
329 The transparency group will be the intersection of the path and clipping 329 The transparency group will be the intersection of the path and clipping
330 path */ 330 path */
diff --git a/base/gssprintf.c b/base/gssprintf.c
index aab4051f0..2b24580e4 100644
--- a/base/gssprintf.c
+++ b/base/gssprintf.c
@@ -116,13 +116,13 @@ static const char null_string[] = "(null)";
116#define NDIG 80 116#define NDIG 80
117 117
118/* buf must have at least NDIG bytes */ 118/* buf must have at least NDIG bytes */
119static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign, 119static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign,
120 int eflag, char *buf) 120 int eflag, char *buf)
121{ 121{
122 register int r2; 122 register int r2;
123 double fi, fj; 123 double fi, fj;
124 register char *p, *p1; 124 register char *p, *p1;
125 125
126 if (ndigits >= NDIG - 1) 126 if (ndigits >= NDIG - 1)
127 ndigits = NDIG - 2; 127 ndigits = NDIG - 2;
128 r2 = 0; 128 r2 = 0;
@@ -387,7 +387,7 @@ static char *conv_10(register apr_int32_t num, register int is_unsigned,
387 *is_negative = (num < 0); 387 *is_negative = (num < 0);
388 388
389 /* 389 /*
390 * On a 2's complement machine, negating the most negative integer 390 * On a 2's complement machine, negating the most negative integer
391 * results in a number that cannot be represented as a signed integer. 391 * results in a number that cannot be represented as a signed integer.
392 * Here is what we do to obtain the number's magnitude: 392 * Here is what we do to obtain the number's magnitude:
393 * a. add 1 to the number 393 * a. add 1 to the number
@@ -402,7 +402,7 @@ static char *conv_10(register apr_int32_t num, register int is_unsigned,
402 } 402 }
403 403
404 /* 404 /*
405 * We use a do-while loop so that we write at least 1 digit 405 * We use a do-while loop so that we write at least 1 digit
406 */ 406 */
407 do { 407 do {
408 register apr_uint32_t new_magnitude = magnitude / 10; 408 register apr_uint32_t new_magnitude = magnitude / 10;
@@ -439,7 +439,7 @@ static char *conv_10_quad(apr_int64_t num, register int is_unsigned,
439 *is_negative = (num < 0); 439 *is_negative = (num < 0);
440 440
441 /* 441 /*
442 * On a 2's complement machine, negating the most negative integer 442 * On a 2's complement machine, negating the most negative integer
443 * results in a number that cannot be represented as a signed integer. 443 * results in a number that cannot be represented as a signed integer.
444 * Here is what we do to obtain the number's magnitude: 444 * Here is what we do to obtain the number's magnitude:
445 * a. add 1 to the number 445 * a. add 1 to the number
@@ -454,7 +454,7 @@ static char *conv_10_quad(apr_int64_t num, register int is_unsigned,
454 } 454 }
455 455
456 /* 456 /*
457 * We use a do-while loop so that we write at least 1 digit 457 * We use a do-while loop so that we write at least 1 digit
458 */ 458 */
459 do { 459 do {
460 apr_uint64_t new_magnitude = magnitude / 10; 460 apr_uint64_t new_magnitude = magnitude / 10;
@@ -885,7 +885,7 @@ static int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
885 (sizeof(APR_INT64_T_FMT) == 3 && 885 (sizeof(APR_INT64_T_FMT) == 3 &&
886 fmt[0] == APR_INT64_T_FMT[0]) || 886 fmt[0] == APR_INT64_T_FMT[0]) ||
887 (sizeof(APR_INT64_T_FMT) > 4 && 887 (sizeof(APR_INT64_T_FMT) > 4 &&
888 strncmp(fmt, APR_INT64_T_FMT, 888 strncmp(fmt, APR_INT64_T_FMT,
889 sizeof(APR_INT64_T_FMT) - 2) == 0)) { 889 sizeof(APR_INT64_T_FMT) - 2) == 0)) {
890 /* Need to account for trailing 'd' and null in sizeof() */ 890 /* Need to account for trailing 'd' and null in sizeof() */
891 var_type = IS_QUAD; 891 var_type = IS_QUAD;
@@ -1413,7 +1413,7 @@ static int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *),
1413 } 1413 }
1414 1414
1415 /* 1415 /*
1416 * Print the string s. 1416 * Print the string s.
1417 */ 1417 */
1418 if (print_something == YES) { 1418 if (print_something == YES) {
1419 for (i = s_len; i != 0; i--) { 1419 for (i = s_len; i != 0; i--) {
diff --git a/base/gstext.c b/base/gstext.c
index bb258d39f..bcf21ec59 100644
--- a/base/gstext.c
+++ b/base/gstext.c
@@ -340,7 +340,7 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
340 cmm_dev_profile_t* dev_profile; 340 cmm_dev_profile_t* dev_profile;
341 341
342 dev_proc(dev, get_profile)(dev, &dev_profile); 342 dev_proc(dev, get_profile)(dev, &dev_profile);
343 if (dev_profile->sim_overprint && 343 if (dev_profile->sim_overprint &&
344 (dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsCMYK || 344 (dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsCMYK ||
345 dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsNCHANNEL)) { 345 dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->data_cs == gsNCHANNEL)) {
346 if (pgs->text_rendering_mode == 0) { 346 if (pgs->text_rendering_mode == 0) {
diff --git a/base/gstype42.c b/base/gstype42.c
index 558892013..fff36d349 100644
--- a/base/gstype42.c
+++ b/base/gstype42.c
@@ -348,7 +348,7 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
348 gs_free_object(pfont->memory, pfont->data.len_glyphs, "gs_len_glyphs_release"); 348 gs_free_object(pfont->memory, pfont->data.len_glyphs, "gs_len_glyphs_release");
349 return code; 349 return code;
350 } 350 }
351 351
352 /* The 'loca' may not be in order, so we construct a glyph length array */ 352 /* The 'loca' may not be in order, so we construct a glyph length array */
353 /* Since 'loca' is usually sorted, first try the simple linear scan to */ 353 /* Since 'loca' is usually sorted, first try the simple linear scan to */
354 /* avoid the need to perform the more expensive process. */ 354 /* avoid the need to perform the more expensive process. */
@@ -386,7 +386,7 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
386 gs_type42_font_init_sort_t *psortary = 386 gs_type42_font_init_sort_t *psortary =
387 (gs_type42_font_init_sort_t *)gs_alloc_byte_array(pfont->memory, 387 (gs_type42_font_init_sort_t *)gs_alloc_byte_array(pfont->memory,
388 loca_size, sizeof(gs_type42_font_init_sort_t), "gs_type42_font_init(sort loca)"); 388 loca_size, sizeof(gs_type42_font_init_sort_t), "gs_type42_font_init(sort loca)");
389 389
390 if (psortary == 0) 390 if (psortary == 0)
391 return_error(gs_error_VMerror); 391 return_error(gs_error_VMerror);
392 /* loca_size > 0 due to condition above, so we always have the 0th element. */ 392 /* loca_size > 0 due to condition above, so we always have the 0th element. */
@@ -406,7 +406,7 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
406 return_error(gs_error_invalidfont); 406 return_error(gs_error_invalidfont);
407 for (i = num_valid_loca_elm; i--;) { 407 for (i = num_valid_loca_elm; i--;) {
408 long old_length; 408 long old_length;
409 409
410 psort = psortary + i; 410 psort = psortary + i;
411 old_length = psort->glyph_length; 411 old_length = psort->glyph_length;
412 if (old_length < 0 || old_length > 2000 /* arbitrary */) { 412 if (old_length < 0 || old_length > 2000 /* arbitrary */) {
diff --git a/base/gxccman.c b/base/gxccman.c
index b2d84305a..0cc1a9d5b 100644
--- a/base/gxccman.c
+++ b/base/gxccman.c
@@ -79,7 +79,7 @@ gx_char_cache_alloc(gs_memory_t * struct_mem, gs_memory_t * bits_mem,
79 cache character memory before filling the table. The searching 79 cache character memory before filling the table. The searching
80 code uses an empty table entry as a sentinel. */ 80 code uses an empty table entry as a sentinel. */
81 chsize = max(chsize, ROUND_UP(bmax, sizeof_cached_char) / sizeof_cached_char + 1); 81 chsize = max(chsize, ROUND_UP(bmax, sizeof_cached_char) / sizeof_cached_char + 1);
82 82
83 /* Round up chsize to a power of 2. */ 83 /* Round up chsize to a power of 2. */
84 while (chsize & (chsize + 1)) 84 while (chsize & (chsize + 1))
85 chsize |= chsize >> 1; 85 chsize |= chsize >> 1;
diff --git a/base/gxcht.c b/base/gxcht.c
index e4b47ce44..ea93ed13d 100644
--- a/base/gxcht.c
+++ b/base/gxcht.c
@@ -841,12 +841,12 @@ static const gx_const_strip_bitmap ht_no_bitmap = {
841 841
842/* Set the color value(s) and halftone mask for one plane. */ 842/* Set the color value(s) and halftone mask for one plane. */
843static inline void set_plane_color(int i, color_values_pair_t *pvp, const gx_device_color * pdc, 843static inline void set_plane_color(int i, color_values_pair_t *pvp, const gx_device_color * pdc,
844 const gx_const_strip_bitmap * sbits[MAX_DCC], gx_ht_cache * caches[MAX_DCC], 844 const gx_const_strip_bitmap * sbits[MAX_DCC], gx_ht_cache * caches[MAX_DCC],
845 gx_color_value max_color, bool invert) 845 gx_color_value max_color, bool invert)
846{ 846{
847 uint q = pdc->colors.colored.c_base[i]; 847 uint q = pdc->colors.colored.c_base[i];
848 uint r = pdc->colors.colored.c_level[i]; 848 uint r = pdc->colors.colored.c_level[i];
849 849
850 pvp->values[0][i] = fractional_color(q, max_color); 850 pvp->values[0][i] = fractional_color(q, max_color);
851 if (r == 0) 851 if (r == 0)
852 pvp->values[1][i] = pvp->values[0][i], sbits[i] = &ht_no_bitmap; 852 pvp->values[1][i] = pvp->values[0][i], sbits[i] = &ht_no_bitmap;
@@ -855,7 +855,7 @@ static inline void set_plane_color(int i, color_values_pair_t *pvp, const gx_dev
855 sbits[i] = (const gx_const_strip_bitmap *) &gx_render_ht(caches[i], r)->tiles; 855 sbits[i] = (const gx_const_strip_bitmap *) &gx_render_ht(caches[i], r)->tiles;
856 } else { 856 } else {
857 const gx_device_halftone *pdht = pdc->colors.colored.c_ht; 857 const gx_device_halftone *pdht = pdc->colors.colored.c_ht;
858 int nlevels = 858 int nlevels =
859 (pdht->components ? pdht->components[i].corder.num_levels : pdht->order.num_levels); 859 (pdht->components ? pdht->components[i].corder.num_levels : pdht->order.num_levels);
860 pvp->values[1][i] = pvp->values[0][i]; 860 pvp->values[1][i] = pvp->values[0][i];
861 pvp->values[0][i] = fractional_color(q + 1, max_color); 861 pvp->values[0][i] = fractional_color(q + 1, max_color);
diff --git a/base/gxcldev.h b/base/gxcldev.h
index 00dca1c81..621dca445 100644
--- a/base/gxcldev.h
+++ b/base/gxcldev.h
@@ -271,7 +271,7 @@ struct gx_clist_state_s {
271 short clip_enabled; /* 0 = don't clip, 1 = do clip, */ 271 short clip_enabled; /* 0 = don't clip, 1 = do clip, */
272 /* -1 is used internally */ 272 /* -1 is used internally */
273 bool color_is_alpha; /* for copy_color_alpha */ 273 bool color_is_alpha; /* for copy_color_alpha */
274 bool color_is_devn; /* more overload of copy_color_alpha for devn support */ 274 bool color_is_devn; /* more overload of copy_color_alpha for devn support */
275 uint known; /* flags for whether this band */ 275 uint known; /* flags for whether this band */
276 /* knows various misc. parameters */ 276 /* knows various misc. parameters */
277 /* We assign 'known' flags here from the high end; */ 277 /* We assign 'known' flags here from the high end; */
@@ -451,7 +451,7 @@ typedef struct {
451 451
452extern const clist_select_color_t 452extern const clist_select_color_t
453 clist_select_color0, clist_select_color1, clist_select_tile_color0, 453 clist_select_color0, clist_select_color1, clist_select_tile_color0,
454 clist_select_tile_color1, clist_select_devn_color0, 454 clist_select_tile_color1, clist_select_devn_color0,
455 clist_select_devn_color1; 455 clist_select_devn_color1;
456 456
457/* See comments in gxclutil.c */ 457/* See comments in gxclutil.c */
@@ -565,8 +565,8 @@ const byte *cmd_read_matrix(gs_matrix * pmat, const byte * cbp);
565int cmd_write_rect_cmd(gx_device_clist_writer * cldev, gx_clist_state * pcls, 565int cmd_write_rect_cmd(gx_device_clist_writer * cldev, gx_clist_state * pcls,
566 int op, int x, int y, int width, int height); 566 int op, int x, int y, int width, int height);
567/* Put out a fill with a devn color */ 567/* Put out a fill with a devn color */
568int cmd_write_rect_hl_cmd(gx_device_clist_writer * cldev, 568int cmd_write_rect_hl_cmd(gx_device_clist_writer * cldev,
569 gx_clist_state * pcls, int op, int x, int y, 569 gx_clist_state * pcls, int op, int x, int y,
570 int width, int height, bool extended_command); 570 int width, int height, bool extended_command);
571/* Put out a fill or tile rectangle command for fillpage. */ 571/* Put out a fill or tile rectangle command for fillpage. */
572int cmd_write_page_rect_cmd(gx_device_clist_writer * cldev, int op); 572int cmd_write_page_rect_cmd(gx_device_clist_writer * cldev, int op);
diff --git a/base/gxclimag.c b/base/gxclimag.c
index 9747c8991..5b6ea513d 100644
--- a/base/gxclimag.c
+++ b/base/gxclimag.c
@@ -797,7 +797,7 @@ clist_begin_typed_image(gx_device * dev, const gs_gstate * pgs,
797 if (!indexed) { 797 if (!indexed) {
798 pie->monitor_color = true; 798 pie->monitor_color = true;
799 /* Set up the unpacking proc for monitoring */ 799 /* Set up the unpacking proc for monitoring */
800 get_unpack_proc((gx_image_enum_common_t*) pie, &(pie->decode), 800 get_unpack_proc((gx_image_enum_common_t*) pie, &(pie->decode),
801 pim->format, pim->Decode); 801 pim->format, pim->Decode);
802 get_map(&(pie->decode), pim->format, pim->Decode); 802 get_map(&(pie->decode), pim->format, pim->Decode);
803 if (pie->decode.unpack == NULL) { 803 if (pie->decode.unpack == NULL) {
@@ -2004,7 +2004,7 @@ cmd_image_plane_data_mon(gx_device_clist_writer * cldev, gx_clist_state * pcls,
2004 to see if we have any non-neutral colors */ 2004 to see if we have any non-neutral colors */
2005 int pdata_x; 2005 int pdata_x;
2006 byte *data_ptr = (byte *)(planes[0].data + i * planes[0].raster + offsets[0] + offset); 2006 byte *data_ptr = (byte *)(planes[0].data + i * planes[0].raster + offsets[0] + offset);
2007 byte *buffer = (byte *)(*pie_c->decode.unpack)(pie_c->buffer, &pdata_x, 2007 byte *buffer = (byte *)(*pie_c->decode.unpack)(pie_c->buffer, &pdata_x,
2008 data_ptr, 0, dsize, pie_c->decode.map, 2008 data_ptr, 0, dsize, pie_c->decode.map,
2009 pie_c->decode.spread, pie_c->decode.spp); 2009 pie_c->decode.spread, pie_c->decode.spp);
2010 2010
diff --git a/base/gxclip.c b/base/gxclip.c
index f566e09fe..40479976b 100644
--- a/base/gxclip.c
+++ b/base/gxclip.c
@@ -590,7 +590,7 @@ clip_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
590} 590}
591 591
592int 592int
593clip_call_fill_rectangle_hl_color(clip_callback_data_t * pccd, int xc, int yc, 593clip_call_fill_rectangle_hl_color(clip_callback_data_t * pccd, int xc, int yc,
594 int xec, int yec) 594 int xec, int yec)
595{ 595{
596 gs_fixed_rect rect; 596 gs_fixed_rect rect;
@@ -1245,7 +1245,7 @@ clip_copy_alpha(gx_device * dev,
1245} 1245}
1246 1246
1247int 1247int
1248clip_call_copy_alpha_hl_color(clip_callback_data_t * pccd, int xc, int yc, 1248clip_call_copy_alpha_hl_color(clip_callback_data_t * pccd, int xc, int yc,
1249 int xec, int yec) 1249 int xec, int yec)
1250{ 1250{
1251 return (*dev_proc(pccd->tdev, copy_alpha_hl_color)) 1251 return (*dev_proc(pccd->tdev, copy_alpha_hl_color))
@@ -1308,8 +1308,8 @@ clip_call_strip_tile_rect_devn(clip_callback_data_t * pccd, int xc, int yc, int
1308static int 1308static int
1309clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles, 1309clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
1310 int x, int y, int w, int h, 1310 int x, int y, int w, int h,
1311 const gx_drawing_color *pdcolor0, 1311 const gx_drawing_color *pdcolor0,
1312 const gx_drawing_color *pdcolor1, int phase_x, 1312 const gx_drawing_color *pdcolor1, int phase_x,
1313 int phase_y) 1313 int phase_y)
1314{ 1314{
1315 gx_device_clip *rdev = (gx_device_clip *) dev; 1315 gx_device_clip *rdev = (gx_device_clip *) dev;
diff --git a/base/gxclip2.c b/base/gxclip2.c
index 1b4d15585..810669317 100644
--- a/base/gxclip2.c
+++ b/base/gxclip2.c
@@ -155,7 +155,7 @@ tile_clip_set_phase(gx_device_tile_clip * cdev, int px, int py)
155/* Fill a rectangle with high level devn color by tiling with the mask. */ 155/* Fill a rectangle with high level devn color by tiling with the mask. */
156static int 156static int
157tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, 157tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
158 const gs_gstate *pgs, const gx_drawing_color *pdcolor, 158 const gs_gstate *pgs, const gx_drawing_color *pdcolor,
159 const gx_clip_path *pcpath) 159 const gx_clip_path *pcpath)
160{ 160{
161 gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev; 161 gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev;
@@ -177,7 +177,7 @@ tile_clip_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
177 w = fixed2int(rect->q.x) - x; 177 w = fixed2int(rect->q.x) - x;
178 h = fixed2int(rect->q.y) - y; 178 h = fixed2int(rect->q.y) - y;
179 return (*dev_proc(tdev, strip_tile_rect_devn))(tdev, &cdev->tiles, 179 return (*dev_proc(tdev, strip_tile_rect_devn))(tdev, &cdev->tiles,
180 x, y, w, h, &dcolor0, &dcolor1, 180 x, y, w, h, &dcolor0, &dcolor1,
181 cdev->phase.x, cdev->phase.y); 181 cdev->phase.x, cdev->phase.y);
182} 182}
183 183
@@ -379,7 +379,7 @@ tile_clip_copy_alpha(gx_device * dev,
379static int 379static int
380tile_clip_copy_alpha_hl_color(gx_device * dev, 380tile_clip_copy_alpha_hl_color(gx_device * dev,
381 const byte * data, int sourcex, int raster, gx_bitmap_id id, 381 const byte * data, int sourcex, int raster, gx_bitmap_id id,
382 int x, int y, int w, int h, const gx_drawing_color *pdcolor, 382 int x, int y, int w, int h, const gx_drawing_color *pdcolor,
383 int depth) 383 int depth)
384{ 384{
385 gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev; 385 gx_device_tile_clip *cdev = (gx_device_tile_clip *) dev;
diff --git a/base/gxclipm.c b/base/gxclipm.c
index ec02ba9a8..5723126a3 100644
--- a/base/gxclipm.c
+++ b/base/gxclipm.c
@@ -152,7 +152,7 @@ mask_clip_fill_rectangle_hl_color(gx_device *dev,
152 /* It would be nice to have a higher level way to do this operation 152 /* It would be nice to have a higher level way to do this operation
153 like a copy_mono_hl_color */ 153 like a copy_mono_hl_color */
154 return (pdcolor->type->fill_masked) 154 return (pdcolor->type->fill_masked)
155 (pdcolor, cdev->tiles.data + my0 * cdev->tiles.raster, mx0, 155 (pdcolor, cdev->tiles.data + my0 * cdev->tiles.raster, mx0,
156 cdev->tiles.raster, cdev->tiles.id, mx0 - cdev->phase.x, 156 cdev->tiles.raster, cdev->tiles.id, mx0 - cdev->phase.x,
157 my0 - cdev->phase.y, mx1 - mx0, my1 - my0, 157 my0 - cdev->phase.y, mx1 - mx0, my1 - my0,
158 tdev, lop_default, false); 158 tdev, lop_default, false);
@@ -404,7 +404,7 @@ mask_clip_copy_alpha(gx_device * dev,
404static int 404static int
405mask_clip_copy_alpha_hl_color(gx_device * dev, 405mask_clip_copy_alpha_hl_color(gx_device * dev,
406 const byte * data, int sourcex, int raster, gx_bitmap_id id, 406 const byte * data, int sourcex, int raster, gx_bitmap_id id,
407 int x, int y, int w, int h, const gx_drawing_color *pdcolor, 407 int x, int y, int w, int h, const gx_drawing_color *pdcolor,
408 int depth) 408 int depth)
409{ 409{
410 gx_device_mask_clip *cdev = (gx_device_mask_clip *) dev; 410 gx_device_mask_clip *cdev = (gx_device_mask_clip *) dev;
@@ -437,7 +437,7 @@ mask_clip_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles,
437static int 437static int
438mask_clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles, 438mask_clip_strip_tile_rect_devn(gx_device * dev, const gx_strip_bitmap * tiles,
439 int x, int y, int w, int h, 439 int x, int y, int w, int h,
440 const gx_drawing_color *pdcolor0, 440 const gx_drawing_color *pdcolor0,
441 const gx_drawing_color *pdcolor1, 441 const gx_drawing_color *pdcolor1,
442 int phase_x, int phase_y) 442 int phase_x, int phase_y)
443{ 443{
diff --git a/base/gxdcolor.c b/base/gxdcolor.c
index b4178871d..b5c17dd9f 100644
--- a/base/gxdcolor.c
+++ b/base/gxdcolor.c
@@ -853,7 +853,7 @@ gx_dc_pure_fill_masked(const gx_device_color * pdevc, const byte * data,
853 853
854 if (!rop3_uses_S(lop)) 854 if (!rop3_uses_S(lop))
855 lop |= rop3_S; 855 lop |= rop3_S;
856 856
857 return (*dev_proc(dev, strip_copy_rop)) 857 return (*dev_proc(dev, strip_copy_rop))
858 (dev, data, data_x, raster, id, scolors, 858 (dev, data, data_x, raster, id, scolors,
859 NULL, tcolors, x, y, w, h, 0, 0, 859 NULL, tcolors, x, y, w, h, 0, 0,
diff --git a/base/gxfapi.c b/base/gxfapi.c
index e6bc445d9..ae464de5b 100644
--- a/base/gxfapi.c
+++ b/base/gxfapi.c
@@ -285,7 +285,7 @@ recreate_multiple_master(gs_font_base *pbfont)
285 changed = (memcmp(I->face.WeightVector.values, pfont1->data.WeightVector.values, 285 changed = (memcmp(I->face.WeightVector.values, pfont1->data.WeightVector.values,
286 pfont1->data.WeightVector.count * sizeof(pfont1->data.WeightVector.values[0])) != 0); 286 pfont1->data.WeightVector.count * sizeof(pfont1->data.WeightVector.values[0])) != 0);
287 } 287 }
288 288
289 if (changed) { 289 if (changed) {
290 r = (I->set_mm_weight_vector(I, &I->ff, pfont1->data.WeightVector.values, pfont1->data.WeightVector.count) == gs_error_invalidaccess); 290 r = (I->set_mm_weight_vector(I, &I->ff, pfont1->data.WeightVector.values, pfont1->data.WeightVector.count) == gs_error_invalidaccess);
291 I->face.WeightVector.count = pfont1->data.WeightVector.count; 291 I->face.WeightVector.count = pfont1->data.WeightVector.count;
@@ -849,7 +849,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
849 code = gs_gstate_color_load(pgs); 849 code = gs_gstate_color_load(pgs);
850 if (code < 0) 850 if (code < 0)
851 return code; 851 return code;
852 852
853 code = gx_image_fill_masked(dev, r, 0, dstr, gx_no_bitmap_id, 853 code = gx_image_fill_masked(dev, r, 0, dstr, gx_no_bitmap_id,
854 (int)dx, (int)dy, 854 (int)dx, (int)dy,
855 rast->width, rast->height, 855 rast->width, rast->height,
@@ -872,7 +872,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
872 byte *bold_lines = NULL; 872 byte *bold_lines = NULL;
873 byte *line = NULL; 873 byte *line = NULL;
874 int ascent = 0; 874 int ascent = 0;
875 875
876 pie = gs_image_enum_alloc(mem, "image_char(image_enum)"); 876 pie = gs_image_enum_alloc(mem, "image_char(image_enum)");
877 if (!pie) { 877 if (!pie) {
878 return_error(gs_error_VMerror); 878 return_error(gs_error_VMerror);
@@ -943,7 +943,7 @@ fapi_image_uncached_glyph(gs_font *pfont, gs_gstate *pgs, gs_show_enum *penum,
943 943
944 bits_merge(merged_line(y - kmask), merged_line(y - (kmask >> 1)), dest_bytes); 944 bits_merge(merged_line(y - kmask), merged_line(y - (kmask >> 1)), dest_bytes);
945 } 945 }
946 } 946 }
947 947
948 /* 948 /*
949 * As of this point in the loop, we maintain the following 949 * As of this point in the loop, we maintain the following
@@ -1695,7 +1695,7 @@ gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *fon
1695 I->ff.fapi_set_cache(penum, pbfont, &enc_char_name_string, index, 1695 I->ff.fapi_set_cache(penum, pbfont, &enc_char_name_string, index,
1696 sbw + 2, &char_bbox, sbwp, &imagenow); 1696 sbw + 2, &char_bbox, sbwp, &imagenow);
1697 } 1697 }
1698 1698
1699 /* If we can render the glyph now, do so. 1699 /* If we can render the glyph now, do so.
1700 * we may not be able to in the PS world if there's a CDevProc in the font 1700 * we may not be able to in the PS world if there's a CDevProc in the font
1701 * in which case gs_fapi_finish_render() will be called from the PS 1701 * in which case gs_fapi_finish_render() will be called from the PS
@@ -1746,12 +1746,12 @@ gs_fapi_passfont(gs_font *pfont, int subfont, char *font_file_path,
1746 int code = 0; 1746 int code = 0;
1747 gs_fapi_server *I, **list; 1747 gs_fapi_server *I, **list;
1748 bool free_params = false; 1748 bool free_params = false;
1749 gs_memory_t *mem = pfont->memory; 1749 gs_memory_t *mem = pfont->memory;
1750 const char *decodingID = NULL; 1750 const char *decodingID = NULL;
1751 bool do_restart = false; 1751 bool do_restart = false;
1752 1752
1753 list = gs_fapi_get_server_list(mem); 1753 list = gs_fapi_get_server_list(mem);
1754 1754
1755 if (!list) /* Should never happen */ 1755 if (!list) /* Should never happen */
1756 return_error(gs_error_unregistered); 1756 return_error(gs_error_unregistered);
1757 1757
diff --git a/base/gxfapi.h b/base/gxfapi.h
index a1a747b6c..75fdc0c4f 100644
--- a/base/gxfapi.h
+++ b/base/gxfapi.h
@@ -334,9 +334,9 @@ struct gs_fapi_server_s
334 /* Used to use the stored 'OrigFont' entry but */ 334 /* Used to use the stored 'OrigFont' entry but */
335 /* this did not change f a font was defined */ 335 /* this did not change f a font was defined */
336 /* using an existing base font */ 336 /* using an existing base font */
337 337
338 338
339 339
340 gs_fapi_retcode(*ensure_open) (gs_fapi_server *server, const char *param, int param_size); 340 gs_fapi_retcode(*ensure_open) (gs_fapi_server *server, const char *param, int param_size);
341 gs_fapi_retcode(*get_scaled_font) (gs_fapi_server *server, gs_fapi_font *ff, const gs_fapi_font_scale *scale, const char *xlatmap, gs_fapi_descendant_code dc); 341 gs_fapi_retcode(*get_scaled_font) (gs_fapi_server *server, gs_fapi_font *ff, const gs_fapi_font_scale *scale, const char *xlatmap, gs_fapi_descendant_code dc);
342 gs_fapi_retcode(*get_decodingID) (gs_fapi_server *server, gs_fapi_font *ff, const char **decodingID); 342 gs_fapi_retcode(*get_decodingID) (gs_fapi_server *server, gs_fapi_font *ff, const char **decodingID);
@@ -352,7 +352,7 @@ struct gs_fapi_server_s
352 gs_fapi_retcode(*get_char_outline_metrics) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, gs_fapi_metrics *metrics); 352 gs_fapi_retcode(*get_char_outline_metrics) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, gs_fapi_metrics *metrics);
353 gs_fapi_retcode(*get_char_outline) (gs_fapi_server *server, gs_fapi_path *p); 353 gs_fapi_retcode(*get_char_outline) (gs_fapi_server *server, gs_fapi_path *p);
354 gs_fapi_retcode(*release_char_data) (gs_fapi_server *server); 354 gs_fapi_retcode(*release_char_data) (gs_fapi_server *server);
355 355
356 gs_fapi_retcode(*release_typeface) (gs_fapi_server *server, void *server_font_data); 356 gs_fapi_retcode(*release_typeface) (gs_fapi_server *server, void *server_font_data);
357 gs_fapi_retcode(*check_cmap_for_GID) (gs_fapi_server *server, uint *index); 357 gs_fapi_retcode(*check_cmap_for_GID) (gs_fapi_server *server, uint *index);
358 gs_fapi_retcode(*get_font_info) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_font_info item, int index, void *data, int *datalen); 358 gs_fapi_retcode(*get_font_info) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_font_info item, int index, void *data, int *datalen);
@@ -442,7 +442,7 @@ gs_fapi_do_char(gs_font *pfont, gs_gstate *pgs, gs_text_enum_t *penum, char *fon
442 * to hold the requested information - data == NULL, or data_len too 442 * to hold the requested information - data == NULL, or data_len too
443 * small will see data_len set to the required amount, and an error 443 * small will see data_len set to the required amount, and an error
444 * returned. 444 * returned.
445 */ 445 */
446int 446int
447gs_fapi_get_font_info(gs_font *pfont, gs_fapi_font_info item, int index, 447gs_fapi_get_font_info(gs_font *pfont, gs_fapi_font_info item, int index,
448 void *data, int *data_len); 448 void *data, int *data_len);
diff --git a/base/gximdecode.c b/base/gximdecode.c
index b41de6a0d..f2096afda 100644
--- a/base/gximdecode.c
+++ b/base/gximdecode.c
@@ -22,7 +22,7 @@ monitoring in clist and for creating TIFF files for xpswrite device */
22/* We need to have the unpacking proc so that we can monitor the data for color 22/* We need to have the unpacking proc so that we can monitor the data for color
23 or decode during xpswrite */ 23 or decode during xpswrite */
24void 24void
25get_unpack_proc(gx_image_enum_common_t *pie, image_decode_t *imd, 25get_unpack_proc(gx_image_enum_common_t *pie, image_decode_t *imd,
26 gs_image_format_t format, const float *decode) { 26 gs_image_format_t format, const float *decode) {
27 27
28 static sample_unpack_proc_t procs[2][6] = { 28 static sample_unpack_proc_t procs[2][6] = {
diff --git a/base/gxpath.h b/base/gxpath.h
index 01a04240c..fcceed424 100644
--- a/base/gxpath.h
+++ b/base/gxpath.h
@@ -44,10 +44,10 @@ typedef enum {
44 sn_dash_tail = 8, /* segment is followed by dash break */ 44 sn_dash_tail = 8, /* segment is followed by dash break */
45} segment_notes; 45} segment_notes;
46 46
47/* 47/*
48 * Used by interpreters for optimizing bbox size for transparency groups. 48 * Used by interpreters for optimizing bbox size for transparency groups.
49 * Depending upon the option we will return a bbox that may just included the 49 * Depending upon the option we will return a bbox that may just included the
50 * clip path or may include the intersection of the current path and the clip 50 * clip path or may include the intersection of the current path and the clip
51 * path and may include an adjustement for the stroke width. 51 * path and may include an adjustement for the stroke width.
52*/ 52*/
53typedef enum { 53typedef enum {
@@ -311,7 +311,7 @@ int gx_default_clip_box(const gs_gstate *, gs_fixed_rect *);
311int gx_effective_clip_path(gs_gstate *, gx_clip_path **); 311int gx_effective_clip_path(gs_gstate *, gx_clip_path **);
312int gx_curr_fixed_bbox(gs_gstate * pgs, gs_fixed_rect *bbox, gs_bbox_comp_t comp_type); 312int gx_curr_fixed_bbox(gs_gstate * pgs, gs_fixed_rect *bbox, gs_bbox_comp_t comp_type);
313int gx_curr_bbox(gs_gstate * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type); 313int gx_curr_bbox(gs_gstate * pgs, gs_rect *bbox, gs_bbox_comp_t comp_type);
314 314
315 315
316/* Opaque type for a clip list. */ 316/* Opaque type for a clip list. */
317typedef struct gx_clip_list_s gx_clip_list; 317typedef struct gx_clip_list_s gx_clip_list;
diff --git a/base/gxshade1.c b/base/gxshade1.c
index 4b86d138d..212c7c11f 100644
--- a/base/gxshade1.c
+++ b/base/gxshade1.c
@@ -343,7 +343,7 @@ gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
343 * For the purposes of explanation, we shall label the octants as below: 343 * For the purposes of explanation, we shall label the octants as below:
344 * 344 *
345 * \2|1/ and Quadrants as: | 345 * \2|1/ and Quadrants as: |
346 * 3\|/0 Q1 | Q0 346 * 3\|/0 Q1 | Q0
347 * ---+--- ----+---- 347 * ---+--- ----+----
348 * 4/|\7 Q2 | Q3 348 * 4/|\7 Q2 | Q3
349 * /5|6\ | 349 * /5|6\ |
@@ -351,7 +351,7 @@ gs_shading_A_fill_rectangle(const gs_shading_t * psh0, const gs_rect * rect,
351 * We find (dx,dy), the difference between the centres of the circles. 351 * We find (dx,dy), the difference between the centres of the circles.
352 * We look to see which octant this falls in. Firstly, this tells us which 352 * We look to see which octant this falls in. Firstly, this tells us which
353 * quadrant of the circle we need to draw first (Octant n, starts with 353 * quadrant of the circle we need to draw first (Octant n, starts with
354 * Quadrant floor(n/2)). Secondly, it tells us which direction to form the 354 * Quadrant floor(n/2)). Secondly, it tells us which direction to form the
355 * tensor patch in; we always want to draw from the side 'closest' to 355 * tensor patch in; we always want to draw from the side 'closest' to
356 * dx/dy to the side further away. This ensures that we don't overwrite 356 * dx/dy to the side further away. This ensures that we don't overwrite
357 * pixels in the incorrect order as the patch decomposes. 357 * pixels in the incorrect order as the patch decomposes.
diff --git a/base/gxtext.h b/base/gxtext.h
index afe0bc894..ba18fca8e 100644
--- a/base/gxtext.h
+++ b/base/gxtext.h
@@ -168,7 +168,7 @@ rc_free_proc(rc_free_text_enum);
168 show_width_status width_status; \ 168 show_width_status width_status; \
169 /*gs_log2_scale_point log2_scale;*/ \ 169 /*gs_log2_scale_point log2_scale;*/ \
170 int (*continue_proc) (gs_show_enum *) /* continuation procedure */ 170 int (*continue_proc) (gs_show_enum *) /* continuation procedure */
171 171
172/* The typedef is in gstext.h. */ 172/* The typedef is in gstext.h. */
173struct gs_text_enum_s { 173struct gs_text_enum_s {
174 gs_text_enum_common; 174 gs_text_enum_common;
diff --git a/base/icc34.h b/base/icc34.h
index a58b0b9dc..be36c272f 100644
--- a/base/icc34.h
+++ b/base/icc34.h
@@ -2,55 +2,55 @@
2#ifndef ICC_H 2#ifndef ICC_H
3#define ICC_H 3#define ICC_H
4 4
5/***************************************************************** 5/*****************************************************************
6 Copyright (c) 1994-1996 SunSoft, Inc. 6 Copyright (c) 1994-1996 SunSoft, Inc.
7 7
8 Rights Reserved 8 Rights Reserved
9 9
10Permission is hereby granted, free of charge, to any person 10Permission is hereby granted, free of charge, to any person
11obtaining a copy of this software and associated documentation 11obtaining a copy of this software and associated documentation
12files (the "Software"), to deal in the Software without restrict- 12files (the "Software"), to deal in the Software without restrict-
13ion, including without limitation the rights to use, copy, modify, 13ion, including without limitation the rights to use, copy, modify,
14merge, publish distribute, sublicense, and/or sell copies of the 14merge, publish distribute, sublicense, and/or sell copies of the
15Software, and to permit persons to whom the Software is furnished 15Software, and to permit persons to whom the Software is furnished
16to do so, subject to the following conditions: 16to do so, subject to the following conditions:
17 17
18The above copyright notice and this permission notice shall be 18The above copyright notice and this permission notice shall be
19included in all copies or substantial portions of the Software. 19included in all copies or substantial portions of the Software.
20 20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- 23OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-
24INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT 24INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT
25COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28OTHER DEALINGS IN THE SOFTWARE. 28OTHER DEALINGS IN THE SOFTWARE.
29 29
30Except as contained in this notice, the name of SunSoft, Inc. 30Except as contained in this notice, the name of SunSoft, Inc.
31shall not be used in advertising or otherwise to promote the 31shall not be used in advertising or otherwise to promote the
32sale, use or other dealings in this Software without written 32sale, use or other dealings in this Software without written
33authorization from SunSoft Inc. 33authorization from SunSoft Inc.
34******************************************************************/ 34******************************************************************/
35 35
36/* 36/*
37 * This version of the header file corresponds to the profile 37 * This version of the header file corresponds to the profile
38 * specification version 3.4. 38 * specification version 3.4.
39 * 39 *
40 * All header file entries are pre-fixed with "ic" to help 40 * All header file entries are pre-fixed with "ic" to help
41 * avoid name space collisions. Signatures are pre-fixed with 41 * avoid name space collisions. Signatures are pre-fixed with
42 * icSig. 42 * icSig.
43 * 43 *
44 * The structures defined in this header file were created to 44 * The structures defined in this header file were created to
45 * represent a description of an ICC profile on disk. Rather 45 * represent a description of an ICC profile on disk. Rather
46 * than use pointers a technique is used where a single byte array 46 * than use pointers a technique is used where a single byte array
47 * was placed at the end of each structure. This allows us in "C" 47 * was placed at the end of each structure. This allows us in "C"
48 * to extend the structure by allocating more data than is needed 48 * to extend the structure by allocating more data than is needed
49 * to account for variable length structures. 49 * to account for variable length structures.
50 * 50 *
51 * This also ensures that data following is allocated 51 * This also ensures that data following is allocated
52 * contiguously and makes it easier to write and read data from 52 * contiguously and makes it easier to write and read data from
53 * the file. 53 * the file.
54 * 54 *
55 * For example to allocate space for a 256 count length UCR 55 * For example to allocate space for a 256 count length UCR
56 * and BG array, and fill the allocated data. Note strlen + 1 56 * and BG array, and fill the allocated data. Note strlen + 1
@@ -62,20 +62,20 @@ authorization from SunSoft Inc.
62 char ucr_string[100], *ucr_char; 62 char ucr_string[100], *ucr_char;
63 63
64 strcpy(ucr_string, "Example ucrBG curves"); 64 strcpy(ucr_string, "Example ucrBG curves");
65 ucr_nbytes = sizeof(icUInt32Number) + 65 ucr_nbytes = sizeof(icUInt32Number) +
66 (UCR_CURVE_SIZE * sizeof(icUInt16Number)); 66 (UCR_CURVE_SIZE * sizeof(icUInt16Number));
67 bg_nbytes = sizeof(icUInt32Number) + 67 bg_nbytes = sizeof(icUInt32Number) +
68 (BG_CURVE_SIZE * sizeof(icUInt16Number)); 68 (BG_CURVE_SIZE * sizeof(icUInt16Number));
69 string_bytes = strlen(ucr_string) + 1; 69 string_bytes = strlen(ucr_string) + 1;
70 70
71 ucrBgWrite = (icUcrBg *)malloc( 71 ucrBgWrite = (icUcrBg *)malloc(
72 (ucr_nbytes + bg_nbytes + string_bytes)); 72 (ucr_nbytes + bg_nbytes + string_bytes));
73 73
74 ucrCurve = (icUcrBgCurve *)ucrBgWrite->data; 74 ucrCurve = (icUcrBgCurve *)ucrBgWrite->data;
75 ucrCurve->count = UCR_CURVE_SIZE; 75 ucrCurve->count = UCR_CURVE_SIZE;
76 for (i=0; i<ucrCurve->count; i++) 76 for (i=0; i<ucrCurve->count; i++)
77 ucrCurve->curve[i] = (icUInt16Number)i; 77 ucrCurve->curve[i] = (icUInt16Number)i;
78 78
79 bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes); 79 bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes);
80 bgCurve->count = BG_CURVE_SIZE; 80 bgCurve->count = BG_CURVE_SIZE;
81 for (i=0; i<bgCurve->count; i++) 81 for (i=0; i<bgCurve->count; i++)
@@ -106,7 +106,7 @@ authorization from SunSoft Inc.
106#define icLinesPerInch 0x00000002L /* Bit pos 1 */ 106#define icLinesPerInch 0x00000002L /* Bit pos 1 */
107#define icLinesPerCm 0x00000000L /* Bit pos 1 */ 107#define icLinesPerCm 0x00000000L /* Bit pos 1 */
108 108
109/* 109/*
110 * Device attributes, currently defined values correspond 110 * Device attributes, currently defined values correspond
111 * to the low 4 bytes of the 8 byte attribute quantity, see 111 * to the low 4 bytes of the 8 byte attribute quantity, see
112 * the header for their location. 112 * the header for their location.
@@ -126,10 +126,10 @@ authorization from SunSoft Inc.
126#define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */ 126#define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */
127 127
128/* Ascii or Binary data */ 128/* Ascii or Binary data */
129#define icAsciiData 0x00000000L 129#define icAsciiData 0x00000000L
130#define icBinaryData 0x00000001L 130#define icBinaryData 0x00000001L
131 131
132/* 132/*
133 * Define used to indicate that this is a variable length array 133 * Define used to indicate that this is a variable length array
134 */ 134 */
135#define icAny 1 135#define icAny 1
@@ -147,8 +147,8 @@ authorization from SunSoft Inc.
147#ifdef PACKAGE_NAME 147#ifdef PACKAGE_NAME
148/* 148/*
149 June 9, 2003, Adapted for use with configure by Bob Friesenhahn 149 June 9, 2003, Adapted for use with configure by Bob Friesenhahn
150 Added the stupid check for autoconf by Marti Maria. 150 Added the stupid check for autoconf by Marti Maria.
151 PACKAGE_NAME is defined if autoconf is being used 151 PACKAGE_NAME is defined if autoconf is being used
152*/ 152*/
153 153
154typedef @UINT8_T@ icUInt8Number; 154typedef @UINT8_T@ icUInt8Number;
@@ -163,7 +163,7 @@ typedef @INT32_T@ icInt64Number[2];
163 163
164#elif defined (__digital__) && defined (__unix__) 164#elif defined (__digital__) && defined (__unix__)
165 165
166/* 166/*
167 *Apr-17-2002: Modified by Marti Maria in order to provide wider portability. 167 *Apr-17-2002: Modified by Marti Maria in order to provide wider portability.
168 */ 168 */
169 169
@@ -267,16 +267,16 @@ typedef icUInt32Number icU16Fixed16Number;
267/*------------------------------------------------------------------------*/ 267/*------------------------------------------------------------------------*/
268/* public tags and sizes */ 268/* public tags and sizes */
269typedef enum { 269typedef enum {
270 icSigAToB0Tag = 0x41324230L, /* 'A2B0' */ 270 icSigAToB0Tag = 0x41324230L, /* 'A2B0' */
271 icSigAToB1Tag = 0x41324231L, /* 'A2B1' */ 271 icSigAToB1Tag = 0x41324231L, /* 'A2B1' */
272 icSigAToB2Tag = 0x41324232L, /* 'A2B2' */ 272 icSigAToB2Tag = 0x41324232L, /* 'A2B2' */
273 icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */ 273 icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */
274 icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */ 274 icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */
275 icSigBToA0Tag = 0x42324130L, /* 'B2A0' */ 275 icSigBToA0Tag = 0x42324130L, /* 'B2A0' */
276 icSigBToA1Tag = 0x42324131L, /* 'B2A1' */ 276 icSigBToA1Tag = 0x42324131L, /* 'B2A1' */
277 icSigBToA2Tag = 0x42324132L, /* 'B2A2' */ 277 icSigBToA2Tag = 0x42324132L, /* 'B2A2' */
278 icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */ 278 icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
279 icSigCharTargetTag = 0x74617267L, /* 'targ' */ 279 icSigCharTargetTag = 0x74617267L, /* 'targ' */
280 icSigCopyrightTag = 0x63707274L, /* 'cprt' */ 280 icSigCopyrightTag = 0x63707274L, /* 'cprt' */
281 icSigCrdInfoTag = 0x63726469L, /* 'crdi' */ 281 icSigCrdInfoTag = 0x63726469L, /* 'crdi' */
282 icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */ 282 icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
@@ -289,7 +289,7 @@ typedef enum {
289 icSigMeasurementTag = 0x6D656173L, /* 'meas' */ 289 icSigMeasurementTag = 0x6D656173L, /* 'meas' */
290 icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */ 290 icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
291 icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */ 291 icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */
292 icSigNamedColorTag = 0x6E636f6CL, /* 'ncol' 292 icSigNamedColorTag = 0x6E636f6CL, /* 'ncol'
293 * OBSOLETE, use ncl2 */ 293 * OBSOLETE, use ncl2 */
294 icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */ 294 icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
295 icSigPreview0Tag = 0x70726530L, /* 'pre0' */ 295 icSigPreview0Tag = 0x70726530L, /* 'pre0' */
@@ -311,7 +311,7 @@ typedef enum {
311 icSigUcrBgTag = 0x62666420L, /* 'bfd ' */ 311 icSigUcrBgTag = 0x62666420L, /* 'bfd ' */
312 icSigViewingCondDescTag = 0x76756564L, /* 'vued' */ 312 icSigViewingCondDescTag = 0x76756564L, /* 'vued' */
313 icSigViewingConditionsTag = 0x76696577L, /* 'view' */ 313 icSigViewingConditionsTag = 0x76696577L, /* 'view' */
314 icMaxEnumTag = 0xFFFFFFFFL 314 icMaxEnumTag = 0xFFFFFFFFL
315} icTagSignature; 315} icTagSignature;
316 316
317/* technology signature descriptions */ 317/* technology signature descriptions */
@@ -319,7 +319,7 @@ typedef enum {
319 icSigDigitalCamera = 0x6463616DL, /* 'dcam' */ 319 icSigDigitalCamera = 0x6463616DL, /* 'dcam' */
320 icSigFilmScanner = 0x6673636EL, /* 'fscn' */ 320 icSigFilmScanner = 0x6673636EL, /* 'fscn' */
321 icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */ 321 icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */
322 icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */ 322 icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */
323 icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */ 323 icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */
324 icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */ 324 icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
325 icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */ 325 icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */
@@ -338,7 +338,7 @@ typedef enum {
338 icSigOffsetLithography = 0x6F666673L, /* 'offs' */ 338 icSigOffsetLithography = 0x6F666673L, /* 'offs' */
339 icSigSilkscreen = 0x73696C6BL, /* 'silk' */ 339 icSigSilkscreen = 0x73696C6BL, /* 'silk' */
340 icSigFlexography = 0x666C6578L, /* 'flex' */ 340 icSigFlexography = 0x666C6578L, /* 'flex' */
341 icMaxEnumTechnology = 0xFFFFFFFFL 341 icMaxEnumTechnology = 0xFFFFFFFFL
342} icTechnologySignature; 342} icTechnologySignature;
343 343
344/* type signatures */ 344/* type signatures */
@@ -349,7 +349,7 @@ typedef enum {
349 icSigLut16Type = 0x6d667432L, /* 'mft2' */ 349 icSigLut16Type = 0x6d667432L, /* 'mft2' */
350 icSigLut8Type = 0x6d667431L, /* 'mft1' */ 350 icSigLut8Type = 0x6d667431L, /* 'mft1' */
351 icSigMeasurementType = 0x6D656173L, /* 'meas' */ 351 icSigMeasurementType = 0x6D656173L, /* 'meas' */
352 icSigNamedColorType = 0x6E636f6CL, /* 'ncol' 352 icSigNamedColorType = 0x6E636f6CL, /* 'ncol'
353 * OBSOLETE, use ncl2 */ 353 * OBSOLETE, use ncl2 */
354 icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */ 354 icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */
355 icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */ 355 icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */
@@ -368,14 +368,14 @@ typedef enum {
368 icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */ 368 icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */
369 icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */ 369 icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */
370 icSigCrdInfoType = 0x63726469L, /* 'crdi' */ 370 icSigCrdInfoType = 0x63726469L, /* 'crdi' */
371 icMaxEnumType = 0xFFFFFFFFL 371 icMaxEnumType = 0xFFFFFFFFL
372} icTagTypeSignature; 372} icTagTypeSignature;
373 373
374/* 374/*
375 * Color Space Signatures 375 * Color Space Signatures
376 * Note that only icSigXYZData and icSigLabData are valid 376 * Note that only icSigXYZData and icSigLabData are valid
377 * Profile Connection Spaces (PCSs) 377 * Profile Connection Spaces (PCSs)
378 */ 378 */
379typedef enum { 379typedef enum {
380 icSigXYZData = 0x58595A20L, /* 'XYZ ' */ 380 icSigXYZData = 0x58595A20L, /* 'XYZ ' */
381 icSigLabData = 0x4C616220L, /* 'Lab ' */ 381 icSigLabData = 0x4C616220L, /* 'Lab ' */
@@ -402,7 +402,7 @@ typedef enum {
402 icSig13colorData = 0x44434C52L, /* 'DCLR' */ 402 icSig13colorData = 0x44434C52L, /* 'DCLR' */
403 icSig14colorData = 0x45434C52L, /* 'ECLR' */ 403 icSig14colorData = 0x45434C52L, /* 'ECLR' */
404 icSig15colorData = 0x46434C52L, /* 'FCLR' */ 404 icSig15colorData = 0x46434C52L, /* 'FCLR' */
405 icMaxEnumData = 0xFFFFFFFFL 405 icMaxEnumData = 0xFFFFFFFFL
406} icColorSpaceSignature; 406} icColorSpaceSignature;
407 407
408/* profileClass enumerations */ 408/* profileClass enumerations */
@@ -414,7 +414,7 @@ typedef enum {
414 icSigAbstractClass = 0x61627374L, /* 'abst' */ 414 icSigAbstractClass = 0x61627374L, /* 'abst' */
415 icSigColorSpaceClass = 0x73706163L, /* 'spac' */ 415 icSigColorSpaceClass = 0x73706163L, /* 'spac' */
416 icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */ 416 icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */
417 icMaxEnumClass = 0xFFFFFFFFL 417 icMaxEnumClass = 0xFFFFFFFFL
418} icProfileClassSignature; 418} icProfileClassSignature;
419 419
420/* Platform Signatures */ 420/* Platform Signatures */
@@ -424,7 +424,7 @@ typedef enum {
424 icSigSolaris = 0x53554E57L, /* 'SUNW' */ 424 icSigSolaris = 0x53554E57L, /* 'SUNW' */
425 icSigSGI = 0x53474920L, /* 'SGI ' */ 425 icSigSGI = 0x53474920L, /* 'SGI ' */
426 icSigTaligent = 0x54474E54L, /* 'TGNT' */ 426 icSigTaligent = 0x54474E54L, /* 'TGNT' */
427 icMaxEnumPlatform = 0xFFFFFFFFL 427 icMaxEnumPlatform = 0xFFFFFFFFL
428} icPlatformSignature; 428} icPlatformSignature;
429 429
430/*------------------------------------------------------------------------*/ 430/*------------------------------------------------------------------------*/
@@ -436,7 +436,7 @@ typedef enum {
436typedef enum { 436typedef enum {
437 icFlare0 = 0x00000000L, /* 0% flare */ 437 icFlare0 = 0x00000000L, /* 0% flare */
438 icFlare100 = 0x00000001L, /* 100% flare */ 438 icFlare100 = 0x00000001L, /* 100% flare */
439 icMaxFlare = 0xFFFFFFFFL 439 icMaxFlare = 0xFFFFFFFFL
440} icMeasurementFlare; 440} icMeasurementFlare;
441 441
442/* Measurement Geometry, used in the measurmentType tag */ 442/* Measurement Geometry, used in the measurmentType tag */
@@ -444,7 +444,7 @@ typedef enum {
444 icGeometryUnknown = 0x00000000L, /* Unknown */ 444 icGeometryUnknown = 0x00000000L, /* Unknown */
445 icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */ 445 icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */
446 icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */ 446 icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */
447 icMaxGeometry = 0xFFFFFFFFL 447 icMaxGeometry = 0xFFFFFFFFL
448} icMeasurementGeometry; 448} icMeasurementGeometry;
449 449
450/* Rendering Intents, used in the profile header */ 450/* Rendering Intents, used in the profile header */
@@ -453,7 +453,7 @@ typedef enum {
453 icRelativeColorimetric = 1, 453 icRelativeColorimetric = 1,
454 icSaturation = 2, 454 icSaturation = 2,
455 icAbsoluteColorimetric = 3, 455 icAbsoluteColorimetric = 3,
456 icMaxEnumIntent = 0xFFFFFFFFL 456 icMaxEnumIntent = 0xFFFFFFFFL
457} icRenderingIntent; 457} icRenderingIntent;
458 458
459/* Different Spot Shapes currently defined, used for screeningType */ 459/* Different Spot Shapes currently defined, used for screeningType */
@@ -466,7 +466,7 @@ typedef enum {
466 icSpotShapeLine = 5, 466 icSpotShapeLine = 5,
467 icSpotShapeSquare = 6, 467 icSpotShapeSquare = 6,
468 icSpotShapeCross = 7, 468 icSpotShapeCross = 7,
469 icMaxEnumSpot = 0xFFFFFFFFL 469 icMaxEnumSpot = 0xFFFFFFFFL
470} icSpotShape; 470} icSpotShape;
471 471
472/* Standard Observer, used in the measurmentType tag */ 472/* Standard Observer, used in the measurmentType tag */
@@ -474,7 +474,7 @@ typedef enum {
474 icStdObsUnknown = 0x00000000L, /* Unknown */ 474 icStdObsUnknown = 0x00000000L, /* Unknown */
475 icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */ 475 icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
476 icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */ 476 icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */
477 icMaxStdObs = 0xFFFFFFFFL 477 icMaxStdObs = 0xFFFFFFFFL
478} icStandardObserver; 478} icStandardObserver;
479 479
480/* Pre-defined illuminants, used in measurement and viewing conditions type */ 480/* Pre-defined illuminants, used in measurement and viewing conditions type */
@@ -486,15 +486,15 @@ typedef enum {
486 icIlluminantF2 = 0x00000004L, 486 icIlluminantF2 = 0x00000004L,
487 icIlluminantD55 = 0x00000005L, 487 icIlluminantD55 = 0x00000005L,
488 icIlluminantA = 0x00000006L, 488 icIlluminantA = 0x00000006L,
489 icIlluminantEquiPowerE = 0x00000007L, 489 icIlluminantEquiPowerE = 0x00000007L,
490 icIlluminantF8 = 0x00000008L, 490 icIlluminantF8 = 0x00000008L,
491 icMaxEnumIluminant = 0xFFFFFFFFL 491 icMaxEnumIluminant = 0xFFFFFFFFL
492} icIlluminant; 492} icIlluminant;
493 493
494 494
495/*------------------------------------------------------------------------*/ 495/*------------------------------------------------------------------------*/
496/* 496/*
497 * Arrays of numbers 497 * Arrays of numbers
498 */ 498 */
499 499
500/* Int8 Array */ 500/* Int8 Array */
@@ -536,7 +536,7 @@ typedef struct {
536typedef struct { 536typedef struct {
537 icInt64Number data[icAny]; /* Variable array of values */ 537 icInt64Number data[icAny]; /* Variable array of values */
538} icInt64Array; 538} icInt64Array;
539 539
540/* u16Fixed16 Array */ 540/* u16Fixed16 Array */
541typedef struct { 541typedef struct {
542 icU16Fixed16Number data[icAny]; /* Variable array of values */ 542 icU16Fixed16Number data[icAny]; /* Variable array of values */
@@ -592,13 +592,13 @@ typedef struct {
592 icUInt8Number clutPoints; /* Number of grid points */ 592 icUInt8Number clutPoints; /* Number of grid points */
593 icInt8Number pad; /* Padding for byte alignment */ 593 icInt8Number pad; /* Padding for byte alignment */
594 icS15Fixed16Number e00; /* e00 in the 3 * 3 */ 594 icS15Fixed16Number e00; /* e00 in the 3 * 3 */
595 icS15Fixed16Number e01; /* e01 in the 3 * 3 */ 595 icS15Fixed16Number e01; /* e01 in the 3 * 3 */
596 icS15Fixed16Number e02; /* e02 in the 3 * 3 */ 596 icS15Fixed16Number e02; /* e02 in the 3 * 3 */
597 icS15Fixed16Number e10; /* e10 in the 3 * 3 */ 597 icS15Fixed16Number e10; /* e10 in the 3 * 3 */
598 icS15Fixed16Number e11; /* e11 in the 3 * 3 */ 598 icS15Fixed16Number e11; /* e11 in the 3 * 3 */
599 icS15Fixed16Number e12; /* e12 in the 3 * 3 */ 599 icS15Fixed16Number e12; /* e12 in the 3 * 3 */
600 icS15Fixed16Number e20; /* e20 in the 3 * 3 */ 600 icS15Fixed16Number e20; /* e20 in the 3 * 3 */
601 icS15Fixed16Number e21; /* e21 in the 3 * 3 */ 601 icS15Fixed16Number e21; /* e21 in the 3 * 3 */
602 icS15Fixed16Number e22; /* e22 in the 3 * 3 */ 602 icS15Fixed16Number e22; /* e22 in the 3 * 3 */
603 icUInt16Number inputEnt; /* Num of in-table entries */ 603 icUInt16Number inputEnt; /* Num of in-table entries */
604 icUInt16Number outputEnt; /* Num of out-table entries */ 604 icUInt16Number outputEnt; /* Num of out-table entries */
@@ -607,7 +607,7 @@ typedef struct {
607 * Data that follows is of this form 607 * Data that follows is of this form
608 * 608 *
609 * icUInt16Number inputTable[inputChan][icAny]; * The in-table 609 * icUInt16Number inputTable[inputChan][icAny]; * The in-table
610 * icUInt16Number clutTable[icAny]; * The clut 610 * icUInt16Number clutTable[icAny]; * The clut
611 * icUInt16Number outputTable[outputChan][icAny]; * The out-table 611 * icUInt16Number outputTable[outputChan][icAny]; * The out-table
612 */ 612 */
613} icLut16; 613} icLut16;
@@ -619,20 +619,20 @@ typedef struct {
619 icUInt8Number clutPoints; /* Num of grid points */ 619 icUInt8Number clutPoints; /* Num of grid points */
620 icInt8Number pad; 620 icInt8Number pad;
621 icS15Fixed16Number e00; /* e00 in the 3 * 3 */ 621 icS15Fixed16Number e00; /* e00 in the 3 * 3 */
622 icS15Fixed16Number e01; /* e01 in the 3 * 3 */ 622 icS15Fixed16Number e01; /* e01 in the 3 * 3 */
623 icS15Fixed16Number e02; /* e02 in the 3 * 3 */ 623 icS15Fixed16Number e02; /* e02 in the 3 * 3 */
624 icS15Fixed16Number e10; /* e10 in the 3 * 3 */ 624 icS15Fixed16Number e10; /* e10 in the 3 * 3 */
625 icS15Fixed16Number e11; /* e11 in the 3 * 3 */ 625 icS15Fixed16Number e11; /* e11 in the 3 * 3 */
626 icS15Fixed16Number e12; /* e12 in the 3 * 3 */ 626 icS15Fixed16Number e12; /* e12 in the 3 * 3 */
627 icS15Fixed16Number e20; /* e20 in the 3 * 3 */ 627 icS15Fixed16Number e20; /* e20 in the 3 * 3 */
628 icS15Fixed16Number e21; /* e21 in the 3 * 3 */ 628 icS15Fixed16Number e21; /* e21 in the 3 * 3 */
629 icS15Fixed16Number e22; /* e22 in the 3 * 3 */ 629 icS15Fixed16Number e22; /* e22 in the 3 * 3 */
630 icUInt8Number data[icAny]; /* Data follows see spec */ 630 icUInt8Number data[icAny]; /* Data follows see spec */
631/* 631/*
632 * Data that follows is of this form 632 * Data that follows is of this form
633 * 633 *
634 * icUInt8Number inputTable[inputChan][256]; * The in-table 634 * icUInt8Number inputTable[inputChan][256]; * The in-table
635 * icUInt8Number clutTable[icAny]; * The clut 635 * icUInt8Number clutTable[icAny]; * The clut
636 * icUInt8Number outputTable[outputChan][256]; * The out-table 636 * icUInt8Number outputTable[outputChan][256]; * The out-table
637 */ 637 */
638} icLut8; 638} icLut8;
@@ -649,7 +649,7 @@ typedef struct {
649/* Named color */ 649/* Named color */
650 650
651/* 651/*
652 * icNamedColor2 takes the place of icNamedColor 652 * icNamedColor2 takes the place of icNamedColor
653 */ 653 */
654typedef struct { 654typedef struct {
655 icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */ 655 icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
@@ -670,16 +670,16 @@ typedef struct {
670 * : 670 * :
671 * : 671 * :
672 * Repeat for name and PCS and device color coordinates up to (count-1) 672 * Repeat for name and PCS and device color coordinates up to (count-1)
673 * 673 *
674 * NOTES: 674 * NOTES:
675 * PCS and device space can be determined from the header. 675 * PCS and device space can be determined from the header.
676 * 676 *
677 * PCS coordinates are icUInt16 numbers and are described in Annex A of 677 * PCS coordinates are icUInt16 numbers and are described in Annex A of
678 * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of 678 * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of
679 * coordinates is consistent with the headers PCS. 679 * coordinates is consistent with the headers PCS.
680 * 680 *
681 * Device coordinates are icUInt16 numbers where 0x0000 represents 681 * Device coordinates are icUInt16 numbers where 0x0000 represents
682 * the minimum value and 0xFFFF represents the maximum value. 682 * the minimum value and 0xFFFF represents the maximum value.
683 * If the nDeviceCoords value is 0 this field is not given. 683 * If the nDeviceCoords value is 0 this field is not given.
684 */ 684 */
685} icNamedColor2; 685} icNamedColor2;
@@ -693,7 +693,7 @@ typedef struct {
693 icInt8Number data[icAny]; /* Desc text follows */ 693 icInt8Number data[icAny]; /* Desc text follows */
694/* 694/*
695 * Data that follows is of this form, this is an icInt8Number 695 * Data that follows is of this form, this is an icInt8Number
696 * to avoid problems with a compiler generating bad code as 696 * to avoid problems with a compiler generating bad code as
697 * these arrays are variable in length. 697 * these arrays are variable in length.
698 * 698 *
699 * icTextDescription deviceMfgDesc; * Manufacturer text 699 * icTextDescription deviceMfgDesc; * Manufacturer text
@@ -753,7 +753,7 @@ typedef struct {
753 icInt8Number data[icAny]; /* The Ucr BG data */ 753 icInt8Number data[icAny]; /* The Ucr BG data */
754/* 754/*
755 * Data that follows is of this form, this is a icInt8Number 755 * Data that follows is of this form, this is a icInt8Number
756 * to avoid problems with a compiler generating bad code as 756 * to avoid problems with a compiler generating bad code as
757 * these arrays are variable in length. 757 * these arrays are variable in length.
758 * 758 *
759 * icUcrBgCurve ucr; * Ucr curve 759 * icUcrBgCurve ucr; * Ucr curve
@@ -900,7 +900,7 @@ typedef struct {
900 icTagBase base; /* Signature, "ui64" */ 900 icTagBase base; /* Signature, "ui64" */
901 icUInt64Array data; /* Variable array of values */ 901 icUInt64Array data; /* Variable array of values */
902} icUInt64ArrayType; 902} icUInt64ArrayType;
903 903
904/* uInt8Type */ 904/* uInt8Type */
905typedef struct { 905typedef struct {
906 icTagBase base; /* Signature, "ui08" */ 906 icTagBase base; /* Signature, "ui08" */
@@ -927,11 +927,11 @@ typedef struct {
927 icCrdInfo info; /* 5 sets of counts & strings */ 927 icCrdInfo info; /* 5 sets of counts & strings */
928}icCrdInfoType; 928}icCrdInfoType;
929 /* icCrdInfo productName; PS product count/string */ 929 /* icCrdInfo productName; PS product count/string */
930 /* icCrdInfo CRDName0; CRD name for intent 0 */ 930 /* icCrdInfo CRDName0; CRD name for intent 0 */
931 /* icCrdInfo CRDName1; CRD name for intent 1 */ 931 /* icCrdInfo CRDName1; CRD name for intent 1 */
932 /* icCrdInfo CRDName2; CRD name for intent 2 */ 932 /* icCrdInfo CRDName2; CRD name for intent 2 */
933 /* icCrdInfo CRDName3; CRD name for intent 3 */ 933 /* icCrdInfo CRDName3; CRD name for intent 3 */
934 934
935/*------------------------------------------------------------------------*/ 935/*------------------------------------------------------------------------*/
936 936
937/* 937/*
@@ -941,8 +941,8 @@ typedef struct {
941/* A tag */ 941/* A tag */
942typedef struct { 942typedef struct {
943 icTagSignature sig; /* The tag signature */ 943 icTagSignature sig; /* The tag signature */
944 icUInt32Number offset; /* Start of tag relative to 944 icUInt32Number offset; /* Start of tag relative to
945 * start of header, Spec 945 * start of header, Spec
946 * Clause 5 */ 946 * Clause 5 */
947 icUInt32Number size; /* Size in bytes */ 947 icUInt32Number size; /* Size in bytes */
948} icTag; 948} icTag;
@@ -974,8 +974,8 @@ typedef struct {
974 icInt8Number reserved[44]; /* Reserved */ 974 icInt8Number reserved[44]; /* Reserved */
975} icHeader; 975} icHeader;
976 976
977/* 977/*
978 * A profile, 978 * A profile,
979 * we can't use icTagList here because its not at the end of the structure 979 * we can't use icTagList here because its not at the end of the structure
980 */ 980 */
981typedef struct { 981typedef struct {
@@ -985,10 +985,10 @@ typedef struct {
985/* 985/*
986 * Data that follows is of the form 986 * Data that follows is of the form
987 * 987 *
988 * icTag tagTable[icAny]; * The tag table 988 * icTag tagTable[icAny]; * The tag table
989 * icInt8Number tagData[icAny]; * The tag data 989 * icInt8Number tagData[icAny]; * The tag data
990 */ 990 */
991} icProfile; 991} icProfile;
992 992
993/*------------------------------------------------------------------------*/ 993/*------------------------------------------------------------------------*/
994/* Obsolete entries */ 994/* Obsolete entries */
@@ -1001,12 +1001,12 @@ typedef struct {
1001/* 1001/*
1002 * Data that follows is of this form 1002 * Data that follows is of this form
1003 * 1003 *
1004 * icInt8Number prefix[icAny]; * Prefix 1004 * icInt8Number prefix[icAny]; * Prefix
1005 * icInt8Number suffix[icAny]; * Suffix 1005 * icInt8Number suffix[icAny]; * Suffix
1006 * icInt8Number root1[icAny]; * Root name 1006 * icInt8Number root1[icAny]; * Root name
1007 * icInt8Number coords1[icAny]; * Color coordinates 1007 * icInt8Number coords1[icAny]; * Color coordinates
1008 * icInt8Number root2[icAny]; * Root name 1008 * icInt8Number root2[icAny]; * Root name
1009 * icInt8Number coords2[icAny]; * Color coordinates 1009 * icInt8Number coords2[icAny]; * Color coordinates
1010 * : 1010 * :
1011 * : 1011 * :
1012 * Repeat for root name and color coordinates up to (count-1) 1012 * Repeat for root name and color coordinates up to (count-1)
diff --git a/base/pack_ps.c b/base/pack_ps.c
index 2ab4117c6..044e934cd 100644
--- a/base/pack_ps.c
+++ b/base/pack_ps.c
@@ -439,7 +439,7 @@ main(int argc, char *argv[])
439#endif 439#endif
440 440
441 /* Display processing statistics. */ 441 /* Display processing statistics. */
442 printf(" Processed %d lines of PostScript data.\n", total_code_lines); 442 printf(" Processed %d lines of PostScript data.\n", total_code_lines);
443 printf(" %d bytes of PostScript data packed down to %d bytes.\n", total_input_length, total_output_length); 443 printf(" %d bytes of PostScript data packed down to %d bytes.\n", total_input_length, total_output_length);
444#if STRIP_PDFR_DEBUG_CALLS 444#if STRIP_PDFR_DEBUG_CALLS
445 printf(" %d PDFR_DEBUG calls removed from the code.\n", pdfr_debug_start_count); 445 printf(" %d PDFR_DEBUG calls removed from the code.\n", pdfr_debug_start_count);
diff --git a/base/scfd.c b/base/scfd.c
index 97fa96b69..f2698a7a3 100644
--- a/base/scfd.c
+++ b/base/scfd.c
@@ -211,7 +211,7 @@ static inline int invert_data(stream_CFD_state *ss, stream_cursor_read *pr, int
211 if (q >= ss->lbuf + ss->raster + CFD_BUFFER_SLOP) { 211 if (q >= ss->lbuf + ss->raster + CFD_BUFFER_SLOP) {
212 return(-1); 212 return(-1);
213 } 213 }
214 214
215 if ( (*rlen) > qbit ) 215 if ( (*rlen) > qbit )
216 { 216 {
217 if (q + ((*rlen - qbit) >> 3) > ss->lbuf + ss->raster + CFD_BUFFER_SLOP) { 217 if (q + ((*rlen - qbit) >> 3) > ss->lbuf + ss->raster + CFD_BUFFER_SLOP) {
diff --git a/base/sdctd.c b/base/sdctd.c
index ec54a9e28..338f84369 100644
--- a/base/sdctd.c
+++ b/base/sdctd.c
@@ -251,7 +251,7 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
251 /*case JPEG_HEADER_OK: */ 251 /*case JPEG_HEADER_OK: */
252 } 252 }
253 253
254 /* 254 /*
255 * Default the color transform if not set and check for 255 * Default the color transform if not set and check for
256 * the Adobe marker and use Adobe's transform if the 256 * the Adobe marker and use Adobe's transform if the
257 * marker is set. 257 * marker is set.
@@ -262,10 +262,10 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr,
262 else 262 else
263 ss->ColorTransform = 0; 263 ss->ColorTransform = 0;
264 } 264 }
265 265
266 if (jddp->dinfo.saw_Adobe_marker) 266 if (jddp->dinfo.saw_Adobe_marker)
267 ss->ColorTransform = jddp->dinfo.Adobe_transform; 267 ss->ColorTransform = jddp->dinfo.Adobe_transform;
268 268
269 switch (jddp->dinfo.num_components) { 269 switch (jddp->dinfo.num_components) {
270 case 3: 270 case 3:
271 jddp->dinfo.jpeg_color_space = 271 jddp->dinfo.jpeg_color_space =
diff --git a/base/sdcte.c b/base/sdcte.c
index ecbaf6558..bd6708643 100644
--- a/base/sdcte.c
+++ b/base/sdcte.c
@@ -25,7 +25,7 @@
25#include "sdct.h" 25#include "sdct.h"
26#include "sjpeg.h" 26#include "sjpeg.h"
27 27
28#define ICC_OVERHEAD 16 28#define ICC_OVERHEAD 16
29#define MAX_MARKER_DATA_SIZE (65535 - ICC_OVERHEAD) 29#define MAX_MARKER_DATA_SIZE (65535 - ICC_OVERHEAD)
30 30
31public_st_jpeg_compress_data(); 31public_st_jpeg_compress_data();
@@ -135,9 +135,9 @@ s_DCTE_process(stream_state * st, stream_cursor_read * pr,
135 dest->free_in_buffer = pw->limit - pw->ptr; 135 dest->free_in_buffer = pw->limit - pw->ptr;
136 ss->phase = 3; 136 ss->phase = 3;
137 /* falls through */ 137 /* falls through */
138 case 3: 138 case 3:
139 /* If we have it, then write out the ICC profile */ 139 /* If we have it, then write out the ICC profile */
140 /* Due to size limitations allowed in APP0 markers, the profile 140 /* Due to size limitations allowed in APP0 markers, the profile
141 may have to be written in mutiple markers */ 141 may have to be written in mutiple markers */
142 if (ss->icc_profile != NULL) { 142 if (ss->icc_profile != NULL) {
143 static const char marker[2] = {0xFF, 0xE2}; /* JPEG_APP0 + 2 */ 143 static const char marker[2] = {0xFF, 0xE2}; /* JPEG_APP0 + 2 */
@@ -156,7 +156,7 @@ s_DCTE_process(stream_state * st, stream_cursor_read * pr,
156 if (size > MAX_MARKER_DATA_SIZE) 156 if (size > MAX_MARKER_DATA_SIZE)
157 size = MAX_MARKER_DATA_SIZE; 157 size = MAX_MARKER_DATA_SIZE;
158 158
159 /* In this case we are just getting started with the 159 /* In this case we are just getting started with the
160 header of the marker. Write that portion out */ 160 header of the marker. Write that portion out */
161 if (ss->icc_position == -1) { 161 if (ss->icc_position == -1) {
162 byte length_byte[2]; 162 byte length_byte[2];
diff --git a/base/sidscale.c b/base/sidscale.c
index 9415d8543..dd488da69 100644
--- a/base/sidscale.c
+++ b/base/sidscale.c
@@ -240,9 +240,9 @@ s_ISpecialDownScale_init(stream_state * st)
240 ss->sizeofPixelIn = ss->params.BitsPerComponentIn / 8; 240 ss->sizeofPixelIn = ss->params.BitsPerComponentIn / 8;
241 ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8; 241 ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8;
242 242
243 ss->src_size = 243 ss->src_size =
244 ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp; 244 ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp;
245 ss->dst_size = 245 ss->dst_size =
246 ss->params.WidthOut * ss->sizeofPixelOut * ss->params.spp_interp; 246 ss->params.WidthOut * ss->sizeofPixelOut * ss->params.spp_interp;
247 247
248 /* Initialize destination DDAs. */ 248 /* Initialize destination DDAs. */
@@ -254,14 +254,14 @@ s_ISpecialDownScale_init(stream_state * st)
254 dda_init(ss->dda_y, 0, ss->params.HeightOut, ss->params.HeightIn); 254 dda_init(ss->dda_y, 0, ss->params.HeightOut, ss->params.HeightIn);
255 255
256 /* create intermediate image to hold horizontal zoom */ 256 /* create intermediate image to hold horizontal zoom */
257 ss->tmp = 257 ss->tmp =
258 gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp, 258 gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp,
259 ss->sizeofPixelIn, "image_scale tmp"); 259 ss->sizeofPixelIn, "image_scale tmp");
260 /* Allocate buffers for 1 row of source and destination. */ 260 /* Allocate buffers for 1 row of source and destination. */
261 ss->dst = 261 ss->dst =
262 gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp, 262 gs_alloc_byte_array(mem, (size_t)ss->params.WidthOut * ss->params.spp_interp,
263 ss->sizeofPixelOut, "image_scale dst"); 263 ss->sizeofPixelOut, "image_scale dst");
264 ss->src = 264 ss->src =
265 gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp, 265 gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp,
266 ss->sizeofPixelIn, "image_scale src"); 266 ss->sizeofPixelIn, "image_scale src");
267 if (ss->tmp == 0 || ss->dst == 0 || ss->src == 0) { 267 if (ss->tmp == 0 || ss->dst == 0 || ss->src == 0) {
diff --git a/base/simscale_foo.c b/base/simscale_foo.c
index bae9d5c7c..aaef5cdb1 100644
--- a/base/simscale_foo.c
+++ b/base/simscale_foo.c
@@ -123,7 +123,7 @@ unsigned int imscale_foo(unsigned int v5x5) {
123 unsigned int r3 = ( v5x5 >> 20 ) & 0x1f; 123 unsigned int r3 = ( v5x5 >> 20 ) & 0x1f;
124 unsigned int r4 = ( v5x5 >> 25 ) & 0x1f; 124 unsigned int r4 = ( v5x5 >> 25 ) & 0x1f;
125#endif 125#endif
126 126
127 switch(v3x3) { 127 switch(v3x3) {
128 case 0: 128 case 0:
129 case 1: 129 case 1:
diff --git a/base/siscale.c b/base/siscale.c
index cc575d20a..3c22e3671 100644
--- a/base/siscale.c
+++ b/base/siscale.c
@@ -930,7 +930,7 @@ do_init(stream_state *st,
930 ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8; 930 ss->sizeofPixelOut = ss->params.BitsPerComponentOut / 8;
931 931
932 ss->src_y = 0; 932 ss->src_y = 0;
933 ss->src_size = 933 ss->src_size =
934 ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp; 934 ss->params.WidthIn * ss->sizeofPixelIn * ss->params.spp_interp;
935 ss->src_offset = 0; 935 ss->src_offset = 0;
936 ss->dst_y = 0; 936 ss->dst_y = 0;
@@ -965,10 +965,10 @@ do_init(stream_state *st,
965 ss->max_support*2, 965 ss->max_support*2,
966 sizeof(CONTRIB), "image_scale contrib_dst[*]"); 966 sizeof(CONTRIB), "image_scale contrib_dst[*]");
967 /* Allocate buffers for 1 row of source and destination. */ 967 /* Allocate buffers for 1 row of source and destination. */
968 ss->dst = 968 ss->dst =
969 gs_alloc_byte_array(mem, (size_t)limited_WidthOut * ss->params.spp_interp, 969 gs_alloc_byte_array(mem, (size_t)limited_WidthOut * ss->params.spp_interp,
970 ss->sizeofPixelOut, "image_scale dst"); 970 ss->sizeofPixelOut, "image_scale dst");
971 ss->src = 971 ss->src =
972 gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp, 972 gs_alloc_byte_array(mem, (size_t)ss->params.WidthIn * ss->params.spp_interp,
973 ss->sizeofPixelIn, "image_scale src"); 973 ss->sizeofPixelIn, "image_scale src");
974 if (ss->tmp == 0 || ss->contrib == 0 || ss->items == 0 || 974 if (ss->tmp == 0 || ss->contrib == 0 || ss->items == 0 ||
diff --git a/base/sjpegc.c b/base/sjpegc.c
index bea397a3a..97df90cdf 100644
--- a/base/sjpegc.c
+++ b/base/sjpegc.c
@@ -173,7 +173,7 @@ static long gs_j_mem_init (j_common_ptr cinfo)
173 if (gs_memory_chunk_wrap(&(cmem), mem) < 0) { 173 if (gs_memory_chunk_wrap(&(cmem), mem) < 0) {
174 return (-1); 174 return (-1);
175 } 175 }
176 176
177 (void)jpeg_cust_mem_set_private(GET_CUST_MEM_DATA(cinfo), cmem); 177 (void)jpeg_cust_mem_set_private(GET_CUST_MEM_DATA(cinfo), cmem);
178 178
179 return 0; 179 return 0;
@@ -229,7 +229,7 @@ gs_jpeg_mem_term(j_common_ptr cinfo)
229 if (cinfo->client_data) { 229 if (cinfo->client_data) {
230 jpeg_cust_mem_data *custmptr = (jpeg_cust_mem_data *)cinfo->client_data; 230 jpeg_cust_mem_data *custmptr = (jpeg_cust_mem_data *)cinfo->client_data;
231 gs_memory_t *mem = (gs_memory_t *)(GET_CUST_MEM_DATA(cinfo)->priv); 231 gs_memory_t *mem = (gs_memory_t *)(GET_CUST_MEM_DATA(cinfo)->priv);
232 232
233 gs_free_object(mem, custmptr, "gs_jpeg_mem_term"); 233 gs_free_object(mem, custmptr, "gs_jpeg_mem_term");
234 cinfo->client_data = NULL; 234 cinfo->client_data = NULL;
235 } 235 }
diff --git a/base/sjpegd.c b/base/sjpegd.c
index 16b71df65..cb6ac75f3 100644
--- a/base/sjpegd.c
+++ b/base/sjpegd.c
@@ -39,7 +39,7 @@ gs_jpeg_create_decompress(stream_DCT_state * st)
39 return_error(gs_jpeg_log_error(st)); 39 return_error(gs_jpeg_log_error(st));
40 40
41 jpeg_stream_data_common_init(st->data.decompress); 41 jpeg_stream_data_common_init(st->data.decompress);
42 42
43 if (gs_jpeg_mem_init (st->memory, (j_common_ptr)&st->data.decompress->dinfo) < 0) 43 if (gs_jpeg_mem_init (st->memory, (j_common_ptr)&st->data.decompress->dinfo) < 0)
44 return_error(gs_error_VMerror); 44 return_error(gs_error_VMerror);
45 45
diff --git a/base/sjpx_openjpeg.c b/base/sjpx_openjpeg.c
index f0db34e11..efb4a5fa6 100644
--- a/base/sjpx_openjpeg.c
+++ b/base/sjpx_openjpeg.c
@@ -560,12 +560,12 @@ static int process_one_trunk(stream_jpxd_state * const state, stream_cursor_writ
560 for (b=0; b<bytepp1; b++) 560 for (b=0; b<bytepp1; b++)
561 *row++ = (((*(state->pdata[compno]) << shift_bit) >> (8*(bytepp1-b-1)))) 561 *row++ = (((*(state->pdata[compno]) << shift_bit) >> (8*(bytepp1-b-1))))
562 + (b==0 ? state->sign_comps[compno] : 0); /* split and shift input int to output bytes */ 562 + (b==0 ? state->sign_comps[compno] : 0); /* split and shift input int to output bytes */
563 state->pdata[compno]++; 563 state->pdata[compno]++;
564 } 564 }
565 } 565 }
566 } 566 }
567 else 567 else
568 { 568 {
569 /* shift_bit = 0, bpp < 8 */ 569 /* shift_bit = 0, bpp < 8 */
570 int bt=0; 570 int bt=0;
571 int bit_pos = 0; 571 int bit_pos = 0;
@@ -678,7 +678,7 @@ s_opjd_process(stream_state * ss, stream_cursor_read * pr,
678 int locked = 0; 678 int locked = 0;
679 int code; 679 int code;
680 680
681 if (in_size > 0) 681 if (in_size > 0)
682 { 682 {
683 /* buffer available data */ 683 /* buffer available data */
684 code = opj_lock(ss->memory); 684 code = opj_lock(ss->memory);
@@ -703,7 +703,7 @@ s_opjd_process(stream_state * ss, stream_cursor_read * pr,
703 } 703 }
704 } 704 }
705 705
706 if (last == 1) 706 if (last == 1)
707 { 707 {
708 if (state->image == NULL) 708 if (state->image == NULL)
709 { 709 {
@@ -774,11 +774,11 @@ s_opjd_release(stream_state *ss)
774 /* free image data structure */ 774 /* free image data structure */
775 if (state->image) 775 if (state->image)
776 opj_image_destroy(state->image); 776 opj_image_destroy(state->image);
777 777
778 /* free stream */ 778 /* free stream */
779 if (state->stream) 779 if (state->stream)
780 opj_stream_destroy(state->stream); 780 opj_stream_destroy(state->stream);
781 781
782 /* free decoder handle */ 782 /* free decoder handle */
783 if (state->codec) 783 if (state->codec)
784 opj_destroy_codec(state->codec); 784 opj_destroy_codec(state->codec);
diff --git a/base/sjpx_openjpeg.h b/base/sjpx_openjpeg.h
index be129983d..d6ac36107 100644
--- a/base/sjpx_openjpeg.h
+++ b/base/sjpx_openjpeg.h
@@ -72,4 +72,4 @@ typedef struct stream_jpxd_state_s
72 72
73extern const stream_template s_jpxd_template; 73extern const stream_template s_jpxd_template;
74 74
75#endif 75#endif
diff --git a/contrib/gdevdj9.c b/contrib/gdevdj9.c
index 1800b3cb8..efbeaef58 100644
--- a/contrib/gdevdj9.c
+++ b/contrib/gdevdj9.c
@@ -634,7 +634,7 @@ static int
634cdj970_get_params(gx_device * pdev, gs_param_list * plist) 634cdj970_get_params(gx_device * pdev, gs_param_list * plist)
635{ 635{
636 int code; 636 int code;
637 637
638 (void) ( 638 (void) (
639 (code = gdev_prn_get_params(pdev, plist)) < 0 || 639 (code = gdev_prn_get_params(pdev, plist)) < 0 ||
640 (code = param_write_int(plist, "Quality", &cdj970->quality)) < 0 || 640 (code = param_write_int(plist, "Quality", &cdj970->quality)) < 0 ||
diff --git a/contrib/lips4/gdevl4r.c b/contrib/lips4/gdevl4r.c
index f5015b1dc..d8bcec7ef 100644
--- a/contrib/lips4/gdevl4r.c
+++ b/contrib/lips4/gdevl4r.c
@@ -647,7 +647,7 @@ lips4type_print_page_copies(gx_device_printer * pdev, gp_file * prn_stream, int
647 { 647 {
648 if (!(lprn->CompBuf = gs_malloc(pdev->memory->non_gc_memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)"))) 648 if (!(lprn->CompBuf = gs_malloc(pdev->memory->non_gc_memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
649 return_error(gs_error_VMerror); 649 return_error(gs_error_VMerror);
650 650
651 /* This buffer is used by lips_rle_encode(), which can require double 651 /* This buffer is used by lips_rle_encode(), which can require double
652 input size plus 2 bytes. */ 652 input size plus 2 bytes. */
653 if (!(lprn->CompBuf2 = gs_malloc(pdev->memory->non_gc_memory, bpl * 2 + 2, maxY, "(CompBuf2)"))) 653 if (!(lprn->CompBuf2 = gs_malloc(pdev->memory->non_gc_memory, bpl * 2 + 2, maxY, "(CompBuf2)")))
diff --git a/devices/gdevcmykog.c b/devices/gdevcmykog.c
index 4330258ed..76206808d 100644
--- a/devices/gdevcmykog.c
+++ b/devices/gdevcmykog.c
@@ -171,9 +171,9 @@ cmykog_open(gx_device * pdev)
171 dev->icc_struct->supports_devn = true; 171 dev->icc_struct->supports_devn = true;
172 172
173 /* This device is a DeviceN color based device but unlike psdcmyk and 173 /* This device is a DeviceN color based device but unlike psdcmyk and
174 tiffsep it can't change its color characteristics. It remains as 174 tiffsep it can't change its color characteristics. It remains as
175 a 6 color cmykog device. Postsript files can change the maxseparations 175 a 6 color cmykog device. Postsript files can change the maxseparations
176 (example Bug 696600 29-07E.PS) The gdevdevn code will, if it 176 (example Bug 696600 29-07E.PS) The gdevdevn code will, if it
177 detects a change occured, close the device and reopen (see 177 detects a change occured, close the device and reopen (see
178 devn_printer_put_params) possibly resetting the color info. tiffsep 178 devn_printer_put_params) possibly resetting the color info. tiffsep
179 and psdcmyk, when reopened, will reset their color characteristics based upon 179 and psdcmyk, when reopened, will reset their color characteristics based upon
diff --git a/devices/gdevepsc.c b/devices/gdevepsc.c
index 830d76683..ed9d8a696 100644
--- a/devices/gdevepsc.c
+++ b/devices/gdevepsc.c
@@ -182,7 +182,7 @@ epsc_print_page(gx_device_printer * pdev, gp_file * prn_stream)
182 char start_graphics; 182 char start_graphics;
183 int first_pass; 183 int first_pass;
184 int last_pass; 184 int last_pass;
185 int dots_per_space; 185 int dots_per_space;
186 int bytes_per_space; 186 int bytes_per_space;
187 int skip = 0, lnum = 0, code = 0, pass; 187 int skip = 0, lnum = 0, code = 0, pass;
188 188
@@ -201,7 +201,7 @@ epsc_print_page(gx_device_printer * pdev, gp_file * prn_stream)
201 if (x_dpi > max_dpi) { 201 if (x_dpi > max_dpi) {
202 return_error(gs_error_rangecheck); 202 return_error(gs_error_rangecheck);
203 } 203 }
204 204
205 start_graphics = (char) 205 start_graphics = (char)
206 ((y_24pin ? graphics_modes_24 : graphics_modes_9)[x_dpi / 60]); 206 ((y_24pin ? graphics_modes_24 : graphics_modes_9)[x_dpi / 60]);
207 first_pass = (start_graphics & DD ? 1 : 0); 207 first_pass = (start_graphics & DD ? 1 : 0);
diff --git a/devices/gdevepsn.c b/devices/gdevepsn.c
index 7b77b9988..88b930bfd 100644
--- a/devices/gdevepsn.c
+++ b/devices/gdevepsn.c
@@ -171,7 +171,7 @@ eps_print_page(gx_device_printer *pdev, gp_file *prn_stream, int y_9pin_high,
171 int tab_min_pixels = x_dpi * MIN_TAB_10THS / 10; 171 int tab_min_pixels = x_dpi * MIN_TAB_10THS / 10;
172 int skip = 0, lnum = 0, pass, ypass; 172 int skip = 0, lnum = 0, pass, ypass;
173 int code = 0; 173 int code = 0;
174 174
175 char start_graphics; 175 char start_graphics;
176 int first_pass; 176 int first_pass;
177 int last_pass; 177 int last_pass;
@@ -195,12 +195,12 @@ eps_print_page(gx_device_printer *pdev, gp_file *prn_stream, int y_9pin_high,
195 /* This avoids divide by zero later on, bug 701843. */ 195 /* This avoids divide by zero later on, bug 701843. */
196 return_error(gs_error_rangecheck); 196 return_error(gs_error_rangecheck);
197 } 197 }
198 198
199 buf1 = (byte *)gs_malloc(pdev->memory, in_size, 1, "eps_print_page(buf1)"); 199 buf1 = (byte *)gs_malloc(pdev->memory, in_size, 1, "eps_print_page(buf1)");
200 buf2 = (byte *)gs_malloc(pdev->memory, in_size, 1, "eps_print_page(buf2)"); 200 buf2 = (byte *)gs_malloc(pdev->memory, in_size, 1, "eps_print_page(buf2)");
201 in = buf1; 201 in = buf1;
202 out = buf2; 202 out = buf2;
203 203
204 204
205 /* Check allocations */ 205 /* Check allocations */
206 if ( buf1 == 0 || buf2 == 0 ) { 206 if ( buf1 == 0 || buf2 == 0 ) {
diff --git a/devices/gdevfax.c b/devices/gdevfax.c
index 27b3c8889..f97e6a2be 100644
--- a/devices/gdevfax.c
+++ b/devices/gdevfax.c
@@ -69,7 +69,7 @@ gdev_fax_get_params(gx_device * dev, gs_param_list * plist)
69 ecode = code; 69 ecode = code;
70 if ((code = param_write_bool(plist, "BlackIs1", &fdev->BlackIs1)) < 0) 70 if ((code = param_write_bool(plist, "BlackIs1", &fdev->BlackIs1)) < 0)
71 ecode = code; 71 ecode = code;
72 72
73 return ecode; 73 return ecode;
74} 74}
75int 75int
diff --git a/devices/gdevicov.c b/devices/gdevicov.c
index 355be2403..db735c64f 100644
--- a/devices/gdevicov.c
+++ b/devices/gdevicov.c
@@ -77,7 +77,7 @@ cov_write_page(gx_device_printer *pdev, gp_file *file)
77 k = (double)k_pix / total_pix; 77 k = (double)k_pix / total_pix;
78 } 78 }
79 79
80 80
81 if (IS_LIBCTX_STDOUT(pdev->memory, gp_get_file(file))) { 81 if (IS_LIBCTX_STDOUT(pdev->memory, gp_get_file(file))) {
82 outprintf(pdev->memory, "%8.5f %8.5f %8.5f %8.5f CMYK %s\n", 82 outprintf(pdev->memory, "%8.5f %8.5f %8.5f %8.5f CMYK %s\n",
83 c, m, y, k, code ? "ERROR" : "OK"); 83 c, m, y, k, code ? "ERROR" : "OK");
@@ -122,13 +122,13 @@ static int cov_write_page_ink(gx_device_printer *pdev, gp_file *file)
122 end = row + raster; 122 end = row + raster;
123 123
124 for (; row < end; row += 4) { 124 for (; row < end; row += 4) {
125 125
126 dc_pix += row[0]; 126 dc_pix += row[0];
127 127
128 dm_pix += row[1]; 128 dm_pix += row[1];
129 129
130 dy_pix += row[2]; 130 dy_pix += row[2];
131 131
132 dk_pix += row[3]; 132 dk_pix += row[3];
133 133
134 ++total_pix; 134 ++total_pix;
diff --git a/devices/gdevlxm.c b/devices/gdevlxm.c
index 6e557edef..b804f9554 100644
--- a/devices/gdevlxm.c
+++ b/devices/gdevlxm.c
@@ -298,7 +298,7 @@ lxm5700m_print_page(gx_device_printer *pdev, gp_file *prn_stream)
298 sxMask = 0x80>>(sx%8); 298 sxMask = 0x80>>(sx%8);
299 299
300 /* loop through all the swipeHeight bits of this column. 300 /* loop through all the swipeHeight bits of this column.
301 301
302 Note that <sx> looks like it can get out of range, so we 302 Note that <sx> looks like it can get out of range, so we
303 check for this here. This fixes bug 701842. 303 check for this here. This fixes bug 701842.
304 304
diff --git a/devices/gdevxcf.c b/devices/gdevxcf.c
index c4c44bf64..5ca2fee8b 100644
--- a/devices/gdevxcf.c
+++ b/devices/gdevxcf.c
@@ -1241,7 +1241,7 @@ xcf_icc_to_tile(gx_device_printer *pdev, xcf_write_ctx *xc, byte **tile_data, co
1241 understand what is going on in the loop 1241 understand what is going on in the loop
1242 with the 255^row[row_idx++] operation */ 1242 with the 255^row[row_idx++] operation */
1243 1243
1244 gscms_transform_color((gx_device*) pdev, link, 1244 gscms_transform_color((gx_device*) pdev, link,
1245 (void *) (&(row[row_idx])), 1245 (void *) (&(row[row_idx])),
1246 &(base_ptr[base_idx]), 1); 1246 &(base_ptr[base_idx]), 1);
1247 1247
diff --git a/devices/gdevxini.c b/devices/gdevxini.c
index ca8ca2f97..77e109c5c 100644
--- a/devices/gdevxini.c
+++ b/devices/gdevxini.c
@@ -892,7 +892,7 @@ gdev_x_put_params(gx_device * dev, gs_param_list * plist)
892 dev->width, dev->height, dev->dname); 892 dev->width, dev->height, dev->dname);
893 return_error(gs_error_rangecheck); 893 return_error(gs_error_rangecheck);
894 } 894 }
895 895
896 /* points */ 896 /* points */
897 dev->MediaSize[0] = (float)dev->width / xdev->x_pixels_per_inch * 72; 897 dev->MediaSize[0] = (float)dev->width / xdev->x_pixels_per_inch * 72;
898 dev->MediaSize[1] = (float)dev->height / xdev->y_pixels_per_inch * 72; 898 dev->MediaSize[1] = (float)dev->height / xdev->y_pixels_per_inch * 72;
@@ -927,7 +927,7 @@ gdev_x_put_params(gx_device * dev, gs_param_list * plist)
927 } 927 }
928 xdev->MaxTempPixmap = values.MaxTempPixmap; 928 xdev->MaxTempPixmap = values.MaxTempPixmap;
929 xdev->MaxTempImage = values.MaxTempImage; 929 xdev->MaxTempImage = values.MaxTempImage;
930 930
931 if (clear_window || xdev->space_params.MaxBitmap != orig_MaxBitmap) { 931 if (clear_window || xdev->space_params.MaxBitmap != orig_MaxBitmap) {
932 if (xdev->is_open) 932 if (xdev->is_open)
933 gdev_x_clear_window(xdev); 933 gdev_x_clear_window(xdev);
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c
index 39da7ea4a..8bd240c7a 100644
--- a/devices/vector/gdevpdfg.c
+++ b/devices/vector/gdevpdfg.c
@@ -2371,7 +2371,7 @@ pdf_write_spot_function(gx_device_pdf *pdev, const gx_ht_order *porder,
2371 return code; 2371 return code;
2372} 2372}
2373 2373
2374/* if (memcmp(order.levels, porder->levels, order.num_levels * sizeof(*order.levels))) */ 2374/* if (memcmp(order.levels, porder->levels, order.num_levels * sizeof(*order.levels))) */
2375static int 2375static int
2376compare_gx_ht_order_levels(const gx_ht_order *order1, const gx_ht_order *order2) { 2376compare_gx_ht_order_levels(const gx_ht_order *order1, const gx_ht_order *order2) {
2377 int i; 2377 int i;
diff --git a/devices/vector/gdevpdfk.c b/devices/vector/gdevpdfk.c
index e48718d1f..88f0a142e 100644
--- a/devices/vector/gdevpdfk.c
+++ b/devices/vector/gdevpdfk.c
@@ -115,7 +115,7 @@ cie_to_xyz(const double *in, double out[3], const gs_color_space *pcs,
115 handles mapping to CIE D50. This forces an achromatic result */ 115 handles mapping to CIE D50. This forces an achromatic result */
116 xyz_float[0] = pWhitePoint->u * xyz_float[1]; 116 xyz_float[0] = pWhitePoint->u * xyz_float[1];
117 xyz_float[2] = pWhitePoint->w * xyz_float[1]; 117 xyz_float[2] = pWhitePoint->w * xyz_float[1];
118 } 118 }
119 119
120 /* Do wp mapping to D50 in XYZ for now. We should do bradford correction. 120 /* Do wp mapping to D50 in XYZ for now. We should do bradford correction.
121 Will add that in next release */ 121 Will add that in next release */
diff --git a/devices/vector/gdevpsdu.c b/devices/vector/gdevpsdu.c
index c4be6ac06..33f9600b8 100644
--- a/devices/vector/gdevpsdu.c
+++ b/devices/vector/gdevpsdu.c
@@ -408,8 +408,8 @@ psdf_DCT_filter(gs_param_list *plist /* may be NULL */,
408 /* Make sure we get at least a full scan line of input. */ 408 /* Make sure we get at least a full scan line of input. */
409 ss->scan_line_size = jcdp->cinfo.input_components * 409 ss->scan_line_size = jcdp->cinfo.input_components *
410 jcdp->cinfo.image_width; 410 jcdp->cinfo.image_width;
411 /* Profile not used in pdfwrite output */ 411 /* Profile not used in pdfwrite output */
412 ss->icc_profile = NULL; 412 ss->icc_profile = NULL;
413 jcdp->templat.min_in_size = 413 jcdp->templat.min_in_size =
414 max(s_DCTE_template.min_in_size, ss->scan_line_size); 414 max(s_DCTE_template.min_in_size, ss->scan_line_size);
415 /* Make sure we can write the user markers in a single go. */ 415 /* Make sure we can write the user markers in a single go. */
diff --git a/devices/vector/gdevpx.c b/devices/vector/gdevpx.c
index 5195339f7..438cf3c26 100644
--- a/devices/vector/gdevpx.c
+++ b/devices/vector/gdevpx.c
@@ -1353,7 +1353,7 @@ pclxl_setdash(gx_device_vector * vdev, const float *pattern, uint count,
1353 pattern_length += (uint) (pattern[i]); 1353 pattern_length += (uint) (pattern[i]);
1354 if (pattern_length == 0) 1354 if (pattern_length == 0)
1355 return_error(gs_error_rangecheck); 1355 return_error(gs_error_rangecheck);
1356 1356
1357 spputc(s, pxt_uint16_array); 1357 spputc(s, pxt_uint16_array);
1358 px_put_ub(s, (byte) count); 1358 px_put_ub(s, (byte) count);
1359 for (i = 0; i < count; ++i) 1359 for (i = 0; i < count; ++i)
@@ -2078,7 +2078,7 @@ pclxl_begin_image(gx_device * dev,
2078 goto use_default; 2078 goto use_default;
2079 } 2079 }
2080 2080
2081 /* 2081 /*
2082 * NOTE: this predicate should be fixed to be readable and easily 2082 * NOTE: this predicate should be fixed to be readable and easily
2083 * debugged. Each condition should be separate. See the large 2083 * debugged. Each condition should be separate. See the large
2084 * similar conditional in clist_begin_typed_image which has 2084 * similar conditional in clist_begin_typed_image which has
diff --git a/devices/vector/gdevxps.c b/devices/vector/gdevxps.c
index 8eb26196d..fa9124fd2 100644
--- a/devices/vector/gdevxps.c
+++ b/devices/vector/gdevxps.c
@@ -120,7 +120,7 @@ typedef struct gx_device_xps_f2i_s {
120 struct gx_device_xps_f2i_s *next; 120 struct gx_device_xps_f2i_s *next;
121} gx_device_xps_f2i_t; 121} gx_device_xps_f2i_t;
122 122
123/* Used for keeping track of icc profiles that we have written. This way we 123/* Used for keeping track of icc profiles that we have written. This way we
124 avoid writing the same one multiple times. It would be nice to do this 124 avoid writing the same one multiple times. It would be nice to do this
125 based upon the gs_id for images, but that id is really created after we 125 based upon the gs_id for images, but that id is really created after we
126 have already drawn the path. Not clear to me how to get a source ID. */ 126 have already drawn the path. Not clear to me how to get a source ID. */
@@ -373,13 +373,13 @@ zip_new_info_node(gx_device_xps *xps_dev, const char *filename)
373 int lenstr; 373 int lenstr;
374 374
375 /* NB should use GC */ 375 /* NB should use GC */
376 gx_device_xps_zinfo_t *info = 376 gx_device_xps_zinfo_t *info =
377 (gx_device_xps_zinfo_t *)gs_alloc_bytes(mem->non_gc_memory, sizeof(gx_device_xps_zinfo_t), "zinfo"); 377 (gx_device_xps_zinfo_t *)gs_alloc_bytes(mem->non_gc_memory, sizeof(gx_device_xps_zinfo_t), "zinfo");
378 gx_device_xps_f2i_t *f2i = 378 gx_device_xps_f2i_t *f2i =
379 (gx_device_xps_f2i_t *)gs_alloc_bytes(mem->non_gc_memory, sizeof(gx_device_xps_f2i_t), "zinfo node"); 379 (gx_device_xps_f2i_t *)gs_alloc_bytes(mem->non_gc_memory, sizeof(gx_device_xps_f2i_t), "zinfo node");
380 380
381 if_debug1m('_', dev->memory, "new node %s\n", filename); 381 if_debug1m('_', dev->memory, "new node %s\n", filename);
382 382
383 if (info == NULL || f2i == NULL) 383 if (info == NULL || f2i == NULL)
384 return gs_throw_code(gs_error_Fatal); 384 return gs_throw_code(gs_error_Fatal);
385 385
@@ -397,7 +397,7 @@ zip_new_info_node(gx_device_xps *xps_dev, const char *filename)
397 lenstr = strlen(filename); 397 lenstr = strlen(filename);
398 f2i->filename = (char*)gs_alloc_bytes(mem->non_gc_memory, lenstr + 1, "zinfo_filename"); 398 f2i->filename = (char*)gs_alloc_bytes(mem->non_gc_memory, lenstr + 1, "zinfo_filename");
399 strcpy(f2i->filename, filename); 399 strcpy(f2i->filename, filename);
400 400
401 info->data.fp = 0; 401 info->data.fp = 0;
402 info->data.count = 0; 402 info->data.count = 0;
403 info->saved = false; 403 info->saved = false;
@@ -408,7 +408,7 @@ zip_new_info_node(gx_device_xps *xps_dev, const char *filename)
408 int node = 1; 408 int node = 1;
409 gx_device_xps_f2i_t *prev_f2i; 409 gx_device_xps_f2i_t *prev_f2i;
410#endif 410#endif
411 411
412 while (f2i != NULL) { 412 while (f2i != NULL) {
413 if_debug2m('_', dev->memory, "node:%d %s\n", node++, f2i->filename); 413 if_debug2m('_', dev->memory, "node:%d %s\n", node++, f2i->filename);
414#ifdef DEBUG 414#ifdef DEBUG
@@ -454,14 +454,14 @@ zip_append_data(gs_memory_t *mem, gx_device_xps_zinfo_t *info, byte *data, uint
454 archive file, open a temporary file to store the data. */ 454 archive file, open a temporary file to store the data. */
455 if (info->data.count == 0) { 455 if (info->data.count == 0) {
456 char *filename = 456 char *filename =
457 (char *)gs_alloc_bytes(mem->non_gc_memory, gp_file_name_sizeof, 457 (char *)gs_alloc_bytes(mem->non_gc_memory, gp_file_name_sizeof,
458 "zip_append_data(filename)"); 458 "zip_append_data(filename)");
459 gp_file *fp; 459 gp_file *fp;
460 460
461 if (!filename) { 461 if (!filename) {
462 return(gs_throw_code(gs_error_VMerror)); 462 return(gs_throw_code(gs_error_VMerror));
463 } 463 }
464 464
465 fp = gp_open_scratch_file_rm(mem, "xpsdata-", 465 fp = gp_open_scratch_file_rm(mem, "xpsdata-",
466 filename, "wb+"); 466 filename, "wb+");
467 gs_free_object(mem->non_gc_memory, filename, "zip_append_data(filename)"); 467 gs_free_object(mem->non_gc_memory, filename, "zip_append_data(filename)");
@@ -737,7 +737,7 @@ zip_close_archive_file(gx_device_xps *xps_dev, const char *filename)
737 } 737 }
738 /* If this is a TIFF file, then update the data count information. 738 /* If this is a TIFF file, then update the data count information.
739 During the writing of the TIFF directory there is seeking and 739 During the writing of the TIFF directory there is seeking and
740 relocations that occur, which make data.count incorrect. 740 relocations that occur, which make data.count incorrect.
741 We could just do this for all the files and avoid the test. */ 741 We could just do this for all the files and avoid the test. */
742 len = strlen(filename); 742 len = strlen(filename);
743 if (len > 3 && (strncmp("tif", &(filename[len - 3]), 3) == 0)) { 743 if (len > 3 && (strncmp("tif", &(filename[len - 3]), 3) == 0)) {
@@ -934,7 +934,7 @@ xps_open_device(gx_device *dev)
934 fixed_document_sequence); 934 fixed_document_sequence);
935 if (code < 0) 935 if (code < 0)
936 return gs_rethrow_code(code); 936 return gs_rethrow_code(code);
937 937
938 code = write_str_to_zip_file(xps, (char *)"[Content_Types].xml", 938 code = write_str_to_zip_file(xps, (char *)"[Content_Types].xml",
939 xps_content_types); 939 xps_content_types);
940 if (code < 0) 940 if (code < 0)
@@ -969,7 +969,7 @@ write_str_to_current_page(gx_device_xps *xps, const char *str)
969 int code = gs_sprintf(buf, page_template, xps->page_count+1); 969 int code = gs_sprintf(buf, page_template, xps->page_count+1);
970 if (code < 0) 970 if (code < 0)
971 return gs_rethrow_code(code); 971 return gs_rethrow_code(code);
972 972
973 return write_str_to_zip_file(xps, buf, str); 973 return write_str_to_zip_file(xps, buf, str);
974} 974}
975 975
@@ -987,7 +987,7 @@ add_new_relationship(gx_device_xps *xps, const char *str)
987 return gs_rethrow_code(code); 987 return gs_rethrow_code(code);
988 988
989 /* Check if this is our first one */ 989 /* Check if this is our first one */
990 if (xps->relationship_count == 0) 990 if (xps->relationship_count == 0)
991 write_str_to_zip_file(xps, buf, rels_header); 991 write_str_to_zip_file(xps, buf, rels_header);
992 992
993 /* Now add the reference */ 993 /* Now add the reference */
@@ -1232,10 +1232,10 @@ static int
1232set_state_color(gx_device_vector *vdev, const gx_drawing_color *pdc, gx_color_index *color) 1232set_state_color(gx_device_vector *vdev, const gx_drawing_color *pdc, gx_color_index *color)
1233{ 1233{
1234 gx_device_xps *xps = (gx_device_xps *)vdev; 1234 gx_device_xps *xps = (gx_device_xps *)vdev;
1235 1235
1236 /* hack so beginpage is called */ 1236 /* hack so beginpage is called */
1237 (void)gdev_vector_stream((gx_device_vector*)xps); 1237 (void)gdev_vector_stream((gx_device_vector*)xps);
1238 1238
1239 /* Usually this is not an actual error but a signal to the 1239 /* Usually this is not an actual error but a signal to the
1240 graphics library to simplify the color */ 1240 graphics library to simplify the color */
1241 if (!gx_dc_is_pure(pdc)) { 1241 if (!gx_dc_is_pure(pdc)) {
@@ -1252,7 +1252,7 @@ xps_setfillcolor(gx_device_vector *vdev, const gs_gstate *pgs, const gx_drawing_
1252 gx_device_xps *xps = (gx_device_xps *)vdev; 1252 gx_device_xps *xps = (gx_device_xps *)vdev;
1253 1253
1254 if_debug1m('_', xps->memory, "xps_setfillcolor:%06X\n", (uint32_t)gx_dc_pure_color(pdc)); 1254 if_debug1m('_', xps->memory, "xps_setfillcolor:%06X\n", (uint32_t)gx_dc_pure_color(pdc));
1255 1255
1256 return set_state_color(vdev, pdc, &xps->fillcolor); 1256 return set_state_color(vdev, pdc, &xps->fillcolor);
1257} 1257}
1258 1258
@@ -1260,9 +1260,9 @@ static int
1260xps_setstrokecolor(gx_device_vector *vdev, const gs_gstate *pgs, const gx_drawing_color *pdc) 1260xps_setstrokecolor(gx_device_vector *vdev, const gs_gstate *pgs, const gx_drawing_color *pdc)
1261{ 1261{
1262 gx_device_xps *xps = (gx_device_xps *)vdev; 1262 gx_device_xps *xps = (gx_device_xps *)vdev;
1263 1263
1264 if_debug1m('_', xps->memory, "xps_setstrokecolor:%06X\n", (uint32_t)gx_dc_pure_color(pdc)); 1264 if_debug1m('_', xps->memory, "xps_setstrokecolor:%06X\n", (uint32_t)gx_dc_pure_color(pdc));
1265 1265
1266 return set_state_color(vdev, pdc, &xps->strokecolor); 1266 return set_state_color(vdev, pdc, &xps->strokecolor);
1267} 1267}
1268 1268
@@ -1473,8 +1473,8 @@ xps_dorect(gx_device_vector *vdev, fixed x0, fixed y0,
1473 fixed2float(x0), fixed2float(y1), 1473 fixed2float(x0), fixed2float(y1),
1474 fixed2float(x1), fixed2float(y1), 1474 fixed2float(x1), fixed2float(y1),
1475 fixed2float(x1), fixed2float(y0)); 1475 fixed2float(x1), fixed2float(y0));
1476 1476
1477 1477
1478 /* skip non-drawing paths for now */ 1478 /* skip non-drawing paths for now */
1479 if (!drawing_path(type, xps->filltype)) { 1479 if (!drawing_path(type, xps->filltype)) {
1480 if_debug1m('_', xps->memory, "xps_dorect: type not supported %x\n", type); 1480 if_debug1m('_', xps->memory, "xps_dorect: type not supported %x\n", type);
@@ -1552,7 +1552,7 @@ gdev_xps_stroke_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
1552 } 1552 }
1553 return gdev_vector_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath); 1553 return gdev_vector_stroke_path(dev, pgs, ppath, params, pdcolor, pcpath);
1554} 1554}
1555 1555
1556static int 1556static int
1557xps_beginpath(gx_device_vector *vdev, gx_path_type_t type) 1557xps_beginpath(gx_device_vector *vdev, gx_path_type_t type)
1558{ 1558{
@@ -1560,7 +1560,7 @@ xps_beginpath(gx_device_vector *vdev, gx_path_type_t type)
1560 gx_device_xps *xps = (gx_device_xps *)vdev; 1560 gx_device_xps *xps = (gx_device_xps *)vdev;
1561 uint32_t c; 1561 uint32_t c;
1562 const char *fmt; 1562 const char *fmt;
1563 1563
1564 (void)gdev_vector_stream((gx_device_vector*)xps); 1564 (void)gdev_vector_stream((gx_device_vector*)xps);
1565 1565
1566 /* skip non-drawing paths for now */ 1566 /* skip non-drawing paths for now */
@@ -1588,7 +1588,7 @@ xps_beginpath(gx_device_vector *vdev, gx_path_type_t type)
1588 else { 1588 else {
1589 write_str_to_current_page(xps, "<Path Data=\""); 1589 write_str_to_current_page(xps, "<Path Data=\"");
1590 } 1590 }
1591 1591
1592 if_debug1m('_', xps->memory, "xps_beginpath %s\n", line); 1592 if_debug1m('_', xps->memory, "xps_beginpath %s\n", line);
1593 1593
1594 return 0; 1594 return 0;
@@ -1623,7 +1623,7 @@ xps_lineto(gx_device_vector *vdev, double x0, double y0,
1623 char line[200]; 1623 char line[200];
1624 1624
1625 if_debug2m('_', xps->memory, "xps_lineto %g %g\n", x, y); 1625 if_debug2m('_', xps->memory, "xps_lineto %g %g\n", x, y);
1626 1626
1627 /* skip non-drawing paths for now */ 1627 /* skip non-drawing paths for now */
1628 if (!drawing_path(type, xps->filltype)) { 1628 if (!drawing_path(type, xps->filltype)) {
1629 if_debug1m('_', xps->memory, "xps_lineto: type not supported %x\n", type); 1629 if_debug1m('_', xps->memory, "xps_lineto: type not supported %x\n", type);
@@ -1642,18 +1642,18 @@ xps_curveto(gx_device_vector *vdev, double x0, double y0,
1642{ 1642{
1643 gx_device_xps *xps = (gx_device_xps *)vdev; 1643 gx_device_xps *xps = (gx_device_xps *)vdev;
1644 char line[200]; 1644 char line[200];
1645 1645
1646 /* skip non-drawing paths for now */ 1646 /* skip non-drawing paths for now */
1647 if (!drawing_path(type, xps->filltype)) { 1647 if (!drawing_path(type, xps->filltype)) {
1648 if_debug1m('_', xps->memory, "xps_curveto: type not supported %x\n", type); 1648 if_debug1m('_', xps->memory, "xps_curveto: type not supported %x\n", type);
1649 return 0; 1649 return 0;
1650 } 1650 }
1651 1651
1652 gs_sprintf(line, " C %g,%g %g,%g %g,%g", x1, y1, 1652 gs_sprintf(line, " C %g,%g %g,%g %g,%g", x1, y1,
1653 x2,y2,x3,y3); 1653 x2,y2,x3,y3);
1654 write_str_to_current_page(xps,line); 1654 write_str_to_current_page(xps,line);
1655 if_debug1m('_', xps->memory, "xps_curveto %s\n", line); 1655 if_debug1m('_', xps->memory, "xps_curveto %s\n", line);
1656 1656
1657 return 0; 1657 return 0;
1658} 1658}
1659 1659
@@ -1716,7 +1716,7 @@ static const gx_image_enum_procs_t xps_image_enum_procs = {
1716/* Prototypes */ 1716/* Prototypes */
1717static TIFF* tiff_from_name(gx_device_xps *dev, const char *name, int big_endian, 1717static TIFF* tiff_from_name(gx_device_xps *dev, const char *name, int big_endian,
1718 bool usebigtiff); 1718 bool usebigtiff);
1719static int tiff_set_values(xps_image_enum_t *pie, TIFF *tif, 1719static int tiff_set_values(xps_image_enum_t *pie, TIFF *tif,
1720 cmm_profile_t *profile, bool force8bit); 1720 cmm_profile_t *profile, bool force8bit);
1721static void xps_tiff_set_handlers(void); 1721static void xps_tiff_set_handlers(void);
1722 1722
@@ -1770,7 +1770,7 @@ xps_add_icc_relationship(xps_image_enum_t *pie)
1770 return 0; 1770 return 0;
1771} 1771}
1772 1772
1773static int 1773static int
1774xps_add_image_relationship(xps_image_enum_t *pie) 1774xps_add_image_relationship(xps_image_enum_t *pie)
1775{ 1775{
1776 gx_device_xps *xps = (gx_device_xps*) (pie->dev); 1776 gx_device_xps *xps = (gx_device_xps*) (pie->dev);
@@ -1796,8 +1796,8 @@ xps_write_profile(const gs_gstate *pgs, char *name, cmm_profile_t *profile, gx_d
1796} 1796}
1797 1797
1798static int 1798static int
1799xps_begin_image(gx_device *dev, const gs_gstate *pgs, 1799xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1800 const gs_image_t *pim, gs_image_format_t format, 1800 const gs_image_t *pim, gs_image_format_t format,
1801 const gs_int_rect *prect, const gx_drawing_color *pdcolor, 1801 const gs_int_rect *prect, const gx_drawing_color *pdcolor,
1802 const gx_clip_path *pcpath, gs_memory_t *mem, 1802 const gx_clip_path *pcpath, gs_memory_t *mem,
1803 gx_image_enum_common_t **pinfo) 1803 gx_image_enum_common_t **pinfo)
@@ -1814,7 +1814,7 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1814 int bits_per_pixel; 1814 int bits_per_pixel;
1815 int num_components; 1815 int num_components;
1816 int bsize; 1816 int bsize;
1817 cmm_profile_t *icc_profile = NULL; 1817 cmm_profile_t *icc_profile = NULL;
1818 gs_color_space_index csindex; 1818 gs_color_space_index csindex;
1819 float index_decode[2]; 1819 float index_decode[2];
1820 gsicc_rendering_param_t rendering_params; 1820 gsicc_rendering_param_t rendering_params;
@@ -1856,8 +1856,8 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1856 /* We need this set a bit early for the ICC relationship writing */ 1856 /* We need this set a bit early for the ICC relationship writing */
1857 pie->dev = (gx_device*) xdev; 1857 pie->dev = (gx_device*) xdev;
1858 1858
1859 /* If the color space is DeviceN, Sep or indexed these end up getting 1859 /* If the color space is DeviceN, Sep or indexed these end up getting
1860 mapped to the color space defined by the device profile. XPS only 1860 mapped to the color space defined by the device profile. XPS only
1861 support RGB indexed images so we just expand if for now. ICC link 1861 support RGB indexed images so we just expand if for now. ICC link
1862 creation etc is handled during the remap/concretization of the colors */ 1862 creation etc is handled during the remap/concretization of the colors */
1863 if (csindex == gs_color_space_index_Indexed || 1863 if (csindex == gs_color_space_index_Indexed ||
@@ -1927,7 +1927,7 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1927 xdev->icc_data = icc_data; 1927 xdev->icc_data = icc_data;
1928 } 1928 }
1929 1929
1930 /* Get name for mark up and for relationship. Have to wait and do 1930 /* Get name for mark up and for relationship. Have to wait and do
1931 this after it is added to the package */ 1931 this after it is added to the package */
1932 code = xps_create_icc_name(xdev, icc_profile, &(pie->icc_name[0])); 1932 code = xps_create_icc_name(xdev, icc_profile, &(pie->icc_name[0]));
1933 if (code < 0) 1933 if (code < 0)
@@ -1965,8 +1965,8 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1965 pcpath = &cpath; 1965 pcpath = &cpath;
1966 } else { 1966 } else {
1967 /* Force vector device to do new path as the clip path is the image 1967 /* Force vector device to do new path as the clip path is the image
1968 path. I had a case where the clip path ids were the same but the 1968 path. I had a case where the clip path ids were the same but the
1969 CTM was changing which resulted in subsequent images coming up 1969 CTM was changing which resulted in subsequent images coming up
1970 missing on the page. i.e. only the first one was shown. */ 1970 missing on the page. i.e. only the first one was shown. */
1971 ((gx_device_vector*) vdev)->clip_path_id = vdev->no_clip_path_id; 1971 ((gx_device_vector*) vdev)->clip_path_id = vdev->no_clip_path_id;
1972 } 1972 }
@@ -1996,7 +1996,7 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
1996 pie->bytes_comp = (pie->decode_st.bps > 8 ? 2 : 1); 1996 pie->bytes_comp = (pie->decode_st.bps > 8 ? 2 : 1);
1997 pie->decode_st.spp = num_components; 1997 pie->decode_st.spp = num_components;
1998 pie->decode_st.unpack = NULL; 1998 pie->decode_st.unpack = NULL;
1999 get_unpack_proc((gx_image_enum_common_t*)pie, &(pie->decode_st), pim->format, 1999 get_unpack_proc((gx_image_enum_common_t*)pie, &(pie->decode_st), pim->format,
2000 pim->Decode); 2000 pim->Decode);
2001 2001
2002 /* The decode mapping for index colors needs an adjustment */ 2002 /* The decode mapping for index colors needs an adjustment */
@@ -2011,7 +2011,7 @@ xps_begin_image(gx_device *dev, const gs_gstate *pgs,
2011 } 2011 }
2012 get_map(&(pie->decode_st), pim->format, index_decode); 2012 get_map(&(pie->decode_st), pim->format, index_decode);
2013 } else { 2013 } else {
2014 get_map(&(pie->decode_st), pim->format, pim->Decode); 2014 get_map(&(pie->decode_st), pim->format, pim->Decode);
2015 } 2015 }
2016 2016
2017 /* Allocate our decode buffer. */ 2017 /* Allocate our decode buffer. */
@@ -2232,7 +2232,7 @@ exit:
2232#define TIFF_PRINT_BUF_LENGTH 1024 2232#define TIFF_PRINT_BUF_LENGTH 1024
2233static const char tifs_msg_truncated[] = "\n*** Previous line has been truncated.\n"; 2233static const char tifs_msg_truncated[] = "\n*** Previous line has been truncated.\n";
2234 2234
2235static int 2235static int
2236tiff_set_values(xps_image_enum_t *pie, TIFF *tif, cmm_profile_t *profile, 2236tiff_set_values(xps_image_enum_t *pie, TIFF *tif, cmm_profile_t *profile,
2237 bool force8bit) 2237 bool force8bit)
2238{ 2238{
@@ -2283,7 +2283,7 @@ tiff_set_values(xps_image_enum_t *pie, TIFF *tif, cmm_profile_t *profile,
2283typedef struct tifs_io_xps_t 2283typedef struct tifs_io_xps_t
2284{ 2284{
2285 gx_device_xps *pdev; 2285 gx_device_xps *pdev;
2286 gp_file *fid; 2286 gp_file *fid;
2287} tifs_io_xps; 2287} tifs_io_xps;
2288 2288
2289/* libtiff i/o hooks */ 2289/* libtiff i/o hooks */
@@ -2384,7 +2384,7 @@ xps_tifsSizeProc(thandle_t fd)
2384} 2384}
2385 2385
2386static void 2386static void
2387xps_tifsWarningHandlerEx(thandle_t client_data, const char *module, 2387xps_tifsWarningHandlerEx(thandle_t client_data, const char *module,
2388 const char *fmt, va_list ap) 2388 const char *fmt, va_list ap)
2389{ 2389{
2390 tifs_io_xps *tiffio = (tifs_io_xps *)client_data; 2390 tifs_io_xps *tiffio = (tifs_io_xps *)client_data;
@@ -2403,7 +2403,7 @@ xps_tifsWarningHandlerEx(thandle_t client_data, const char *module,
2403} 2403}
2404 2404
2405static void 2405static void
2406xps_tifsErrorHandlerEx(thandle_t client_data, const char *module, 2406xps_tifsErrorHandlerEx(thandle_t client_data, const char *module,
2407 const char *fmt, va_list ap) 2407 const char *fmt, va_list ap)
2408{ 2408{
2409 tifs_io_xps *tiffio = (tifs_io_xps *)client_data; 2409 tifs_io_xps *tiffio = (tifs_io_xps *)client_data;
diff --git a/pcl/pcl/pccid.c b/pcl/pcl/pccid.c
index 99bc9622a..9fea5e4df 100644
--- a/pcl/pcl/pccid.c
+++ b/pcl/pcl/pccid.c
@@ -313,7 +313,7 @@ check_cid_hdr(pcl_state_t * pcs, pcl_cid_data_t * pcid)
313 pcidh->bits_per_primary[2] = 8; 313 pcidh->bits_per_primary[2] = 8;
314 } 314 }
315 315
316 /* 316 /*
317 * All long form color commands appear to be deprecated on modern 317 * All long form color commands appear to be deprecated on modern
318 * HP devices. We simply truncate all long form commands to the 6 318 * HP devices. We simply truncate all long form commands to the 6
319 * byte short form. 319 * byte short form.
diff --git a/pcl/pcl/pcdraw.c b/pcl/pcl/pcdraw.c
index 778aff9b0..bc09b2456 100644
--- a/pcl/pcl/pcdraw.c
+++ b/pcl/pcl/pcdraw.c
@@ -142,9 +142,9 @@ pcl_grestore(pcl_state_t * pcs)
142 /* check for bottom of graphic state stack */ 142 /* check for bottom of graphic state stack */
143 if (pcs == 0 || pcs->pids == 0 || pcs->pids->prev == 0) 143 if (pcs == 0 || pcs->pids == 0 || pcs->pids->prev == 0)
144 return e_Range; 144 return e_Range;
145 145
146 pids = pcs->pids->prev; 146 pids = pcs->pids->prev;
147 147
148 if ((code = gs_grestore(pcs->pgs)) >= 0) { 148 if ((code = gs_grestore(pcs->pgs)) >= 0) {
149 pcs->pids->prev = pids->prev; 149 pcs->pids->prev = pids->prev;
150 pcl_ccolor_copy_from(pcs->pids->pccolor, pids->pccolor); 150 pcl_ccolor_copy_from(pcs->pids->pccolor, pids->pccolor);
diff --git a/pcl/pcl/pcfrgrnd.c b/pcl/pcl/pcfrgrnd.c
index 96fd330af..6ea7fdb6a 100644
--- a/pcl/pcl/pcfrgrnd.c
+++ b/pcl/pcl/pcfrgrnd.c
@@ -102,7 +102,7 @@ build_foreground(pcl_state_t * pcs,
102 } 102 }
103 103
104 num_entries = pindexed->num_entries; 104 num_entries = pindexed->num_entries;
105 105
106 /* release the existing foreground */ 106 /* release the existing foreground */
107 if (pfrgrnd != 0) { 107 if (pfrgrnd != 0) {
108 rc_decrement(pfrgrnd, "build pcl foreground"); 108 rc_decrement(pfrgrnd, "build pcl foreground");
diff --git a/pcl/pcl/pcfsel.c b/pcl/pcl/pcfsel.c
index 88b16163c..8544aa42e 100644
--- a/pcl/pcl/pcfsel.c
+++ b/pcl/pcl/pcfsel.c
@@ -343,7 +343,7 @@ score_match(const pcl_state_t * pcs, const pcl_font_selection_t * pfs,
343 tscore = 14 + delta; 343 tscore = 14 + delta;
344 score[score_weight] = tscore; 344 score[score_weight] = tscore;
345 345
346 /* 346 /*
347 * The following is a workaround needed because our font 347 * The following is a workaround needed because our font
348 * selection algorithm is different than HP's. HP uses a 348 * selection algorithm is different than HP's. HP uses a
349 * filtering algorithm where fonts cannot be given points 349 * filtering algorithm where fonts cannot be given points
@@ -422,7 +422,7 @@ score_match(const pcl_state_t * pcs, const pcl_font_selection_t * pfs,
422 * (undocumented). Negate the font number so that smaller numbers 422 * (undocumented). Negate the font number so that smaller numbers
423 * have a higher score. 423 * have a higher score.
424 */ 424 */
425 425
426 score[score_pjl_fontnumber] = -fp->params.pjl_font_number; 426 score[score_pjl_fontnumber] = -fp->params.pjl_font_number;
427 427
428#ifdef DEBUG 428#ifdef DEBUG
diff --git a/pcl/pcl/pcjob.c b/pcl/pcl/pcjob.c
index 4a4ca5f0f..98d48dcfc 100644
--- a/pcl/pcl/pcjob.c
+++ b/pcl/pcl/pcjob.c
@@ -182,7 +182,7 @@ pcl_duplex_page_side_select(pcl_args_t * pargs, pcl_state_t * pcs)
182 if (errcode < 0) 182 if (errcode < 0)
183 return errcode; 183 return errcode;
184 } 184 }
185 185
186 /* if there is an error (code < 0) or the page is unmarked (code 186 /* if there is an error (code < 0) or the page is unmarked (code
187 == 0) then nothing to update */ 187 == 0) then nothing to update */
188 if (code <= 0) 188 if (code <= 0)
@@ -330,7 +330,7 @@ pcjob_do_reset(pcl_state_t * pcs, pcl_reset_type_t type)
330 /* resolution is always a single number in PJL */ 330 /* resolution is always a single number in PJL */
331 res[0] = res[1] = pcl_pjl_res(pcs); 331 res[0] = res[1] = pcl_pjl_res(pcs);
332 332
333 /* 333 /*
334 * again we only have a single number from PJL so just 334 * again we only have a single number from PJL so just
335 * check the width 335 * check the width
336 */ 336 */
diff --git a/pcl/pcl/pcpage.c b/pcl/pcl/pcpage.c
index 5089490db..0ecbfbc22 100644
--- a/pcl/pcl/pcpage.c
+++ b/pcl/pcl/pcpage.c
@@ -44,9 +44,9 @@
44/* 44/*
45 * The PCL printable region. In older HP printers this region was set to 45 * The PCL printable region. In older HP printers this region was set to
46 * 1/6" from the edge of the paper, irrespecitve of the paper size or the 46 * 1/6" from the edge of the paper, irrespecitve of the paper size or the
47 * device. However, recent HP printers allow the margin to be configurable 47 * device. However, recent HP printers allow the margin to be configurable
48 * and even set to 0 for full bleed. If a non-zero margin is needed it can be 48 * and even set to 0 for full bleed. If a non-zero margin is needed it can be
49 * set on the command line via -H (e.g. -H12x12x12x12 restores the previous 49 * set on the command line via -H (e.g. -H12x12x12x12 restores the previous
50 * 1/6" margin). See doc/ghostpdl.pdf for details. 50 * 1/6" margin). See doc/ghostpdl.pdf for details.
51 */ 51 */
52#define PRINTABLE_MARGIN_CP inch2coord(0.0) 52#define PRINTABLE_MARGIN_CP inch2coord(0.0)
@@ -393,7 +393,7 @@ new_page_size(pcl_state_t * pcs,
393 reset_margins(pcs, for_passthrough); 393 reset_margins(pcs, for_passthrough);
394 394
395 /* check if update_xfm_state changed the page size */ 395 /* check if update_xfm_state changed the page size */
396 changed_page_size = !((int)old_page_size[0] == pcs->xfm_state.paper_size->width/100 && 396 changed_page_size = !((int)old_page_size[0] == pcs->xfm_state.paper_size->width/100 &&
397 (int)old_page_size[1] == pcs->xfm_state.paper_size->height/100); 397 (int)old_page_size[1] == pcs->xfm_state.paper_size->height/100);
398 398
399 /* 399 /*
@@ -522,12 +522,12 @@ pcl_mark_page_for_current_pos(pcl_state_t * pcs)
522 if (code < 0) 522 if (code < 0)
523 /* shouldn't happen. */ 523 /* shouldn't happen. */
524 return code; 524 return code;
525 525
526 code = gx_path_current_point(gx_current_path(pcs->pgs), &pt); 526 code = gx_path_current_point(gx_current_path(pcs->pgs), &pt);
527 if (code < 0) 527 if (code < 0)
528 /* shouldn't happen */ 528 /* shouldn't happen */
529 return code; 529 return code;
530 530
531 531
532 /* half-open lower - not sure this is correct */ 532 /* half-open lower - not sure this is correct */
533 if (pt.x >= page_box.p.x && pt.y >= page_box.p.y && 533 if (pt.x >= page_box.p.x && pt.y >= page_box.p.y &&
@@ -571,7 +571,7 @@ pcl_mark_page_for_character(pcl_state_t * pcs, gs_fixed_point *org)
571 return 0; 571 return 0;
572} 572}
573 573
574/* 574/*
575 * Just use the current position to see if we marked the page. This 575 * Just use the current position to see if we marked the page. This
576 * could be improved by using the bounding box of the path object but 576 * could be improved by using the bounding box of the path object but
577 * for page marking that case does not seem to come up in practice. 577 * for page marking that case does not seem to come up in practice.
@@ -1055,8 +1055,8 @@ set_logical_page(pcl_args_t * pargs, pcl_state_t * pcs)
1055 return code; 1055 return code;
1056} 1056}
1057 1057
1058/* 1058/*
1059 * Custom Paper Width/Length 1059 * Custom Paper Width/Length
1060 * from Windows Driver "HP Universal Printing PCL 5" (.GPD files) and 1060 * from Windows Driver "HP Universal Printing PCL 5" (.GPD files) and
1061 * http://www.office.xerox.com/support/dctips/dc10cc0471.pdf 1061 * http://www.office.xerox.com/support/dctips/dc10cc0471.pdf
1062 * 1062 *
@@ -1087,7 +1087,7 @@ set_paper_width(pcl_args_t * pargs, pcl_state_t * pcs)
1087 return 0; 1087 return 0;
1088} 1088}
1089 1089
1090int 1090int
1091pcl_set_custom_paper_size(pcl_state_t *pcs, pcl_paper_size_t *p) 1091pcl_set_custom_paper_size(pcl_state_t *pcs, pcl_paper_size_t *p)
1092{ 1092{
1093 pcl_paper_size_t *psize = NULL; 1093 pcl_paper_size_t *psize = NULL;
@@ -1107,7 +1107,7 @@ pcl_set_custom_paper_size(pcl_state_t *pcs, pcl_paper_size_t *p)
1107 /* this should never happen - the custom paper size is 1107 /* this should never happen - the custom paper size is
1108 always in the table */ 1108 always in the table */
1109 return -1; 1109 return -1;
1110 1110
1111 return new_logical_page(pcs, 0, psize, false, false); 1111 return new_logical_page(pcs, 0, psize, false, false);
1112} 1112}
1113/* 1113/*
diff --git a/pcl/pcl/pcsymbol.c b/pcl/pcl/pcsymbol.c
index d12ed6e3c..9c56c96a3 100644
--- a/pcl/pcl/pcsymbol.c
+++ b/pcl/pcl/pcsymbol.c
@@ -103,7 +103,7 @@ pcl_define_symbol_set(pcl_args_t * pargs, pcl_state_t * pcs)
103 103
104 if (last_code > 255 || first_code > last_code) 104 if (last_code > 255 || first_code > last_code)
105 return e_Range; 105 return e_Range;
106 106
107 { 107 {
108 int num_codes = last_code - first_code + 1; /* must be in [0,256] now. */ 108 int num_codes = last_code - first_code + 1; /* must be in [0,256] now. */
109 int i; 109 int i;
@@ -185,13 +185,13 @@ pcl_symbol_set_control(pcl_args_t * pargs, pcl_state_t * pcs)
185 185
186 switch (int_arg(pargs)) { 186 switch (int_arg(pargs)) {
187 case 0: 187 case 0:
188 { 188 {
189 /* Delete all user-defined symbol sets. */ 189 /* Delete all user-defined symbol sets. */
190 /* Note: When deleting symbol set(s), it is easier 190 /* Note: When deleting symbol set(s), it is easier
191 * (safer?) to decache and reselect fonts 191 * (safer?) to decache and reselect fonts
192 * unconditionally. (Consider, for example, deleting 192 * unconditionally. (Consider, for example, deleting
193 * a downloaded overload of a built-in which might be 193 * a downloaded overload of a built-in which might be
194 * the default ID.) 194 * the default ID.)
195 */ 195 */
196 pl_dict_release(&pcs->soft_symbol_sets); 196 pl_dict_release(&pcs->soft_symbol_sets);
197 pcl_decache_font(pcs, -1, true); 197 pcl_decache_font(pcs, -1, true);
diff --git a/pcl/pcl/pgchar.c b/pcl/pcl/pgchar.c
index f1b011b44..65c38b632 100644
--- a/pcl/pcl/pgchar.c
+++ b/pcl/pcl/pgchar.c
@@ -349,7 +349,7 @@ hpgl_DV(hpgl_args_t * pargs, hpgl_state_t * pgls)
349 349
350 if (!hpgl_arg_c_int(pgls->memory, pargs, &path)) 350 if (!hpgl_arg_c_int(pgls->memory, pargs, &path))
351 path = 0; 351 path = 0;
352 352
353 if (!hpgl_arg_c_int(pgls->memory, pargs, &line)) 353 if (!hpgl_arg_c_int(pgls->memory, pargs, &line))
354 line = 0; 354 line = 0;
355 355
diff --git a/pcl/pcl/pgconfig.c b/pcl/pcl/pgconfig.c
index 9a72330e2..80f57e99e 100644
--- a/pcl/pcl/pgconfig.c
+++ b/pcl/pcl/pgconfig.c
@@ -367,17 +367,17 @@ hpgl_scaling_points_set(hpgl_state_t *pgls, int32 *ptxy, bool track)
367 367
368 pgls->g.P1.x = ptxy[0]; 368 pgls->g.P1.x = ptxy[0];
369 pgls->g.P1.y = ptxy[1]; 369 pgls->g.P1.y = ptxy[1];
370 370
371 /* if either coordinate is equal it is incremented by 1 */ 371 /* if either coordinate is equal it is incremented by 1 */
372 if (pgls->g.P1.x == pgls->g.P2.x) 372 if (pgls->g.P1.x == pgls->g.P2.x)
373 pgls->g.P2.x++; 373 pgls->g.P2.x++;
374 if (pgls->g.P1.y == pgls->g.P2.y) 374 if (pgls->g.P1.y == pgls->g.P2.y)
375 pgls->g.P2.y++; 375 pgls->g.P2.y++;
376 376
377 return 0; 377 return 0;
378} 378}
379 379
380 380
381/* IP p1x,p1y[,p2x,p2y]; */ 381/* IP p1x,p1y[,p2x,p2y]; */
382/* IP; */ 382/* IP; */
383int 383int
diff --git a/pcl/pcl/pglfill.c b/pcl/pcl/pglfill.c
index a8169cd3c..44d81bfad 100644
--- a/pcl/pcl/pglfill.c
+++ b/pcl/pcl/pglfill.c
@@ -75,7 +75,7 @@ hpgl_FT(hpgl_args_t * pargs, hpgl_state_t * pgls)
75 75
76 if (!hpgl_arg_int(pgls->memory, pargs, &type)) 76 if (!hpgl_arg_int(pgls->memory, pargs, &type))
77 type = hpgl_FT_pattern_solid_pen1; 77 type = hpgl_FT_pattern_solid_pen1;
78 78
79 switch (type) { 79 switch (type) {
80 80
81 case hpgl_FT_pattern_solid_pen1: /* 1 */ 81 case hpgl_FT_pattern_solid_pen1: /* 1 */
diff --git a/pcl/pcl/pgparse.c b/pcl/pcl/pgparse.c
index d0451140b..300ca6bcf 100644
--- a/pcl/pcl/pgparse.c
+++ b/pcl/pcl/pgparse.c
@@ -220,7 +220,7 @@ hpgl_process(hpgl_parser_state_t * pst, hpgl_state_t * pgls,
220 */ 220 */
221 if (pgls->macro_level > 0 && (code == gs_error_NeedInput)) 221 if (pgls->macro_level > 0 && (code == gs_error_NeedInput))
222 code = gs_error_Fatal; 222 code = gs_error_Fatal;
223 223
224 return (code == gs_error_NeedInput ? 0 : code); 224 return (code == gs_error_NeedInput ? 0 : code);
225} 225}
226 226
diff --git a/pcl/pcl/rtgmode.c b/pcl/pcl/rtgmode.c
index ddbc8bf4b..a2d072b45 100644
--- a/pcl/pcl/rtgmode.c
+++ b/pcl/pcl/rtgmode.c
@@ -403,7 +403,7 @@ pcl_end_graphics_mode(pcl_state_t * pcs)
403int 403int
404pcl_end_graphics_mode_implicit(pcl_state_t * pcs, bool ignore_in_rtl) 404pcl_end_graphics_mode_implicit(pcl_state_t * pcs, bool ignore_in_rtl)
405{ 405{
406 406
407#ifdef DEBUG 407#ifdef DEBUG
408 if_debug0('I', "Graphics exited implicitly\n"); 408 if_debug0('I', "Graphics exited implicitly\n");
409#endif 409#endif
@@ -431,7 +431,7 @@ pcl_end_graphics_mode_implicit(pcl_state_t * pcs, bool ignore_in_rtl)
431 * integer resolution, and we do the same in RTL mode. 431 * integer resolution, and we do the same in RTL mode.
432 */ 432 */
433 433
434/* 434/*
435 * A table to round up to the next higher permitted resolution. Note 435 * A table to round up to the next higher permitted resolution. Note
436 * there are duplicates in the table because some factors are not 436 * there are duplicates in the table because some factors are not
437 * supported and they default to the next higher resolution. 437 * supported and they default to the next higher resolution.
@@ -766,12 +766,12 @@ gmode_do_reset(pcl_state_t * pcs, pcl_reset_type_t type)
766 766
767 prstate->gmargin_cp = 0L; 767 prstate->gmargin_cp = 0L;
768 768
769 /* 769 /*
770 * The raster resolution default is device dependent, we've 770 * The raster resolution default is device dependent, we've
771 * decided to use 75 dpi for regular PCL mode and the PJL 771 * decided to use 75 dpi for regular PCL mode and the PJL
772 * resolution for HPGL/2 rtl mode based on our experience with 772 * resolution for HPGL/2 rtl mode based on our experience with
773 * various HP products, but we doubt it is always correct. 773 * various HP products, but we doubt it is always correct.
774 */ 774 */
775 775
776 prstate->resolution = 75; 776 prstate->resolution = 75;
777 if (pcs->personality == rtl) { 777 if (pcs->personality == rtl) {
diff --git a/pcl/pl/plsymbol.c b/pcl/pl/plsymbol.c
index 03240dc07..5aff8cf1b 100644
--- a/pcl/pl/plsymbol.c
+++ b/pcl/pl/plsymbol.c
@@ -3615,7 +3615,7 @@ static const pl_symbol_map_t map_12N_unicode = {
3615 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xffff 3615 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xffff
3616 } 3616 }
3617}; 3617};
3618 3618
3619/************************************************************* 3619/*************************************************************
3620 * HP-GL/2 stick font extended character set Unicode mapping * 3620 * HP-GL/2 stick font extended character set Unicode mapping *
3621 * (Note: this symbol set is not documented anywhere.) * 3621 * (Note: this symbol set is not documented anywhere.) *
diff --git a/pcl/pl/plwmainc.c b/pcl/pl/plwmainc.c
index c42372137..21c690bf3 100644
--- a/pcl/pl/plwmainc.c
+++ b/pcl/pl/plwmainc.c
@@ -358,7 +358,7 @@ main_utf8(int argc, char *argv[])
358 return 1; 358 return 1;
359 } 359 }
360 360
361#ifndef METRO 361#ifndef METRO
362 if (_beginthread(winthread, 65535, NULL) == -1) { 362 if (_beginthread(winthread, 65535, NULL) == -1) {
363 fprintf(stderr, "GUI thread creation failed\n"); 363 fprintf(stderr, "GUI thread creation failed\n");
364 } 364 }
diff --git a/pcl/pxl/pxffont.c b/pcl/pxl/pxffont.c
index 50d9094ab..d8f0d4ef1 100644
--- a/pcl/pxl/pxffont.c
+++ b/pcl/pxl/pxffont.c
@@ -95,7 +95,7 @@ px_find_existing_font(px_value_t * pfnv, px_font_t ** ppxfont,
95 void *pxfont; 95 void *pxfont;
96 96
97 *ppxfont = NULL; 97 *ppxfont = NULL;
98 98
99 /* Normalize the font name to Unicode. */ 99 /* Normalize the font name to Unicode. */
100 code = px_widen_font_name(pfnv, pxs); 100 code = px_widen_font_name(pfnv, pxs);
101 if (code < 0) 101 if (code < 0)
diff --git a/pcl/pxl/pxfont.c b/pcl/pxl/pxfont.c
index de874672c..8457aeba8 100644
--- a/pcl/pxl/pxfont.c
+++ b/pcl/pxl/pxfont.c
@@ -828,7 +828,7 @@ pxRemoveFont(px_args_t * par, px_state_t * pxs)
828 */ 828 */
829 if (pxfont->pfont == gs_currentfont(pxs->pgs)) 829 if (pxfont->pfont == gs_currentfont(pxs->pgs))
830 gs_setfont(pxs->pgs, NULL); 830 gs_setfont(pxs->pgs, NULL);
831 831
832 px_dict_undef(&pxs->font_dict, par->pv[0]); 832 px_dict_undef(&pxs->font_dict, par->pv[0]);
833 } 833 }
834 834
diff --git a/pcl/pxl/pxpaint.c b/pcl/pxl/pxpaint.c
index 1fc8eed24..bb40b3699 100644
--- a/pcl/pxl/pxpaint.c
+++ b/pcl/pxl/pxpaint.c
@@ -500,7 +500,7 @@ pxPaintPath(px_args_t * par, px_state_t * pxs)
500 500
501 if (code >= 0) 501 if (code >= 0)
502 code = gx_setcurrentpoint_from_path(pxs->pgs, ppath); 502 code = gx_setcurrentpoint_from_path(pxs->pgs, ppath);
503 503
504 return code; 504 return code;
505} 505}
506 506
diff --git a/pcl/pxl/pxptable.c b/pcl/pxl/pxptable.c
index 4cc36b819..9582fcf9d 100644
--- a/pcl/pxl/pxptable.c
+++ b/pcl/pxl/pxptable.c
@@ -190,7 +190,7 @@ const px_attr_value_type_t px_attr_value_types[] = {
190 /* 43 */ xyp(ub | us | rl, checkPageScale), /* PageScale */ 190 /* 43 */ xyp(ub | us | rl, checkPageScale), /* PageScale */
191 /* 44 */ scub(), /* ROP3 */ 191 /* 44 */ scub(), /* ROP3 */
192 /* 45 */ en(pxeTxMode_next), /* TxMode */ 192 /* 45 */ en(pxeTxMode_next), /* TxMode */
193 /* 46 */ none, 193 /* 46 */ none,
194 /* 47 */ xy(us | rl), /* CustomMediaSize */ 194 /* 47 */ xy(us | rl), /* CustomMediaSize */
195 /* 48 */ en(pxeMeasure_next), /* CustomMediaSizeUnits */ 195 /* 48 */ en(pxeMeasure_next), /* CustomMediaSizeUnits */
196 /* 49 */ sc(us), /* PageCopies */ 196 /* 49 */ sc(us), /* PageCopies */
diff --git a/psi/apitest.c b/psi/apitest.c
index 6f5bc41db..fbd12f501 100644
--- a/psi/apitest.c
+++ b/psi/apitest.c
@@ -72,7 +72,7 @@ static void *gs_main(void *arg)
72 gsargv[i] = my_argv[i]; 72 gsargv[i] = my_argv[i];
73 gsargv[my_argv_file] = text; 73 gsargv[my_argv_file] = text;
74 gsargc = my_argc; 74 gsargc = my_argc;
75 75
76 strncpy(text, my_argv[my_argv_file], sizeof(text)); 76 strncpy(text, my_argv[my_argv_file], sizeof(text));
77 text[sizeof(text)-1]=0; 77 text[sizeof(text)-1]=0;
78 pos = strlen(text); 78 pos = strlen(text);
@@ -111,11 +111,11 @@ int main(int argc, char *argv[])
111 111
112 my_argc = argc; 112 my_argc = argc;
113 my_argv = argv; 113 my_argv = argv;
114 114
115 for (i=0; i < argc; i++) 115 for (i=0; i < argc; i++)
116 if (!strcmp(argv[i], "-o")) 116 if (!strcmp(argv[i], "-o"))
117 break; 117 break;
118 118
119 if (i >= argc-1) 119 if (i >= argc-1)
120 { 120 {
121 fprintf(stderr, "Expected a -o argument to rewrite!\n"); 121 fprintf(stderr, "Expected a -o argument to rewrite!\n");
diff --git a/psi/dwmainc.c b/psi/dwmainc.c
index 7fd21b91b..07e890f83 100644
--- a/psi/dwmainc.c
+++ b/psi/dwmainc.c
@@ -168,7 +168,7 @@ gsdll_stdin_utf8(void *instance, char *buf, int len)
168 /* Previously the code here has always just checked for whether 168 /* Previously the code here has always just checked for whether
169 * _read returns <= 0 to see whether we should exit. According 169 * _read returns <= 0 to see whether we should exit. According
170 * to the docs -1 means error, 0 means EOF. Unfortunately, 170 * to the docs -1 means error, 0 means EOF. Unfortunately,
171 * building using VS2015 there appears to be a bug in the 171 * building using VS2015 there appears to be a bug in the
172 * runtime, whereby a line with a single return on it (on an 172 * runtime, whereby a line with a single return on it (on an
173 * ANSI encoded Text file at least) causes a 0 return value. 173 * ANSI encoded Text file at least) causes a 0 return value.
174 * We hack around this by second guessing the code. We clear 174 * We hack around this by second guessing the code. We clear
diff --git a/psi/dxmain.c b/psi/dxmain.c
index 728effd58..6ef1ac1a8 100644
--- a/psi/dxmain.c
+++ b/psi/dxmain.c
@@ -1232,7 +1232,7 @@ int main(int argc, char *argv[])
1232 code = 0; 1232 code = 0;
1233 } 1233 }
1234 } 1234 }
1235 1235
1236 if (code == 0) 1236 if (code == 0)
1237 code = gsapi_init_with_args(instance, nargc, nargv); 1237 code = gsapi_init_with_args(instance, nargc, nargv);
1238 1238
diff --git a/psi/zcolor.c b/psi/zcolor.c
index 0ddc15f4f..4683053f1 100644
--- a/psi/zcolor.c
+++ b/psi/zcolor.c
@@ -1598,7 +1598,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
1598 pcs = gs_cspace_new_DeviceCMYK(imemory); 1598 pcs = gs_cspace_new_DeviceCMYK(imemory);
1599 if (pcs == NULL) 1599 if (pcs == NULL)
1600 return_error(gs_error_VMerror); 1600 return_error(gs_error_VMerror);
1601 /* Bug 693816 unset device color prior to possible overprint 1601 /* Bug 693816 unset device color prior to possible overprint
1602 colorant check */ 1602 colorant check */
1603 gx_unset_dev_color(igs); 1603 gx_unset_dev_color(igs);
1604 code = gs_setcolorspace(igs, pcs); 1604 code = gs_setcolorspace(igs, pcs);
diff --git a/psi/zfapi.c b/psi/zfapi.c
index 19043b84e..aa988ed6e 100644
--- a/psi/zfapi.c
+++ b/psi/zfapi.c
@@ -2873,7 +2873,7 @@ ps_get_glyphname_or_cid(gs_text_enum_t *penum,
2873 cmapnmlen = r_size(&CMapNameStr); 2873 cmapnmlen = r_size(&CMapNameStr);
2874 } 2874 }
2875 } 2875 }
2876 /* We only have to lookup the char code if we're *not* using an identity ordering 2876 /* We only have to lookup the char code if we're *not* using an identity ordering
2877 with the exception of Identity-UTF16 which is a different beast altogether */ 2877 with the exception of Identity-UTF16 which is a different beast altogether */
2878 if (unicode_cp || (cmapnmlen > 0 && !strncmp(cmapnm, utfcmap, cmapnmlen > utfcmaplen ? utfcmaplen : cmapnmlen)) 2878 if (unicode_cp || (cmapnmlen > 0 && !strncmp(cmapnm, utfcmap, cmapnmlen > utfcmaplen ? utfcmaplen : cmapnmlen))
2879 || (dict_find_string(pdr, "CIDSystemInfo", &CIDSystemInfo) > 0 2879 || (dict_find_string(pdr, "CIDSystemInfo", &CIDSystemInfo) > 0
diff --git a/psi/zfimscale.c b/psi/zfimscale.c
index 088a6c5f6..ce180e3d2 100644
--- a/psi/zfimscale.c
+++ b/psi/zfimscale.c
@@ -49,8 +49,8 @@ z_imscale_d(i_ctx_t * i_ctx_p)
49 if (dict_int_param(op, "Height", 0, 1<<24, -1, &height) < 0) 49 if (dict_int_param(op, "Height", 0, 1<<24, -1, &height) < 0)
50 return_error(gs_error_rangecheck); 50 return_error(gs_error_rangecheck);
51 51
52 state.params.spp_decode = 1; 52 state.params.spp_decode = 1;
53 state.params.spp_interp = 1; 53 state.params.spp_interp = 1;
54 state.params.BitsPerComponentIn = 1; 54 state.params.BitsPerComponentIn = 1;
55 state.params.MaxValueIn = 1; 55 state.params.MaxValueIn = 1;
56 state.params.WidthIn = width; 56 state.params.WidthIn = width;
diff --git a/psi/zform.c b/psi/zform.c
index 3c00b5a5e..e2555d698 100644
--- a/psi/zform.c
+++ b/psi/zform.c
@@ -61,7 +61,7 @@ static int zbeginform(i_ctx_t *i_ctx_p)
61 tmplate.BBox.p.y = BBox[1]; 61 tmplate.BBox.p.y = BBox[1];
62 tmplate.BBox.q.x = BBox[2]; 62 tmplate.BBox.q.x = BBox[2];
63 tmplate.BBox.q.y = BBox[3]; 63 tmplate.BBox.q.y = BBox[3];
64 64
65 code = dict_floats_param(imemory, op, "Matrix", 6, Matrix, NULL); 65 code = dict_floats_param(imemory, op, "Matrix", 6, Matrix, NULL);
66 if (code < 0) 66 if (code < 0)
67 return code; 67 return code;
diff --git a/psi/zpdf_r6.c b/psi/zpdf_r6.c
index a958fdb2b..3315291a0 100644
--- a/psi/zpdf_r6.c
+++ b/psi/zpdf_r6.c
@@ -144,7 +144,7 @@ zcheck_r6_password(i_ctx_t * i_ctx_p)
144 return_error(gs_error_typecheck); 144 return_error(gs_error_typecheck);
145 if (!r_has_type(Pref, t_string)) 145 if (!r_has_type(Pref, t_string))
146 return_error(gs_error_typecheck); 146 return_error(gs_error_typecheck);
147 147
148 code = dict_find_string(CryptDict, "O", &Oref); 148 code = dict_find_string(CryptDict, "O", &Oref);
149 if (code < 0) 149 if (code < 0)
150 return code; 150 return code;