diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-11-10 19:09:05 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-11-10 19:16:12 +0000 |
commit | d182ddaf5d46dc68d7f266fcb7f4de1ed64b7b56 (patch) | |
tree | ef6088bebe3016fc150075e06a062dfe453a1fe7 | |
parent | 108bf3d9fd2770c1b97a4eabcd4f09dd13c7fe18 (diff) |
Replace all uses of 'template' with 'templat'.
Using C++ reserved words is bad form, if only because they upset MSVC
when debugging.
59 files changed, 390 insertions, 390 deletions
diff --git a/gs/base/gdevcfax.c b/gs/base/gdevcfax.c index 2b2e961a0..112425f60 100644 --- a/gs/base/gdevcfax.c +++ b/gs/base/gdevcfax.c @@ -120,7 +120,7 @@ cfax_stream_print_page_width(gx_device_printer * pdev, FILE * prn_stream, bool nul = !strcmp(pdev->fname, "nul"); /* Initialize the common part of the encoder state. */ - ss->template = temp; + ss->templat = temp; ss->memory = mem; /* Allocate the buffers. */ diff --git a/gs/base/gdevfax.c b/gs/base/gdevfax.c index 5d3613fe6..4b1f522c9 100644 --- a/gs/base/gdevfax.c +++ b/gs/base/gdevfax.c @@ -167,7 +167,7 @@ gdev_fax_print_strip(gx_device_printer * pdev, FILE * prn_stream, int min_feature_size = ((gx_device_fax *const)pdev)->MinFeatureSize; /* Initialize the common part of the encoder state. */ - ss->template = temp; + ss->templat = temp; ss->memory = mem; /* Now initialize the encoder. */ code = temp->init(ss); diff --git a/gs/base/gdevjbig2.c b/gs/base/gdevjbig2.c index f730fe3e6..c1f7b7c85 100644 --- a/gs/base/gdevjbig2.c +++ b/gs/base/gdevjbig2.c @@ -72,13 +72,13 @@ jbig2_print_page(gx_device_printer * pdev, FILE * prn_stream) } /* Create the jbig2encode state. */ s_init_state((stream_state *)&state, &s_jbig2encode_template, 0); - if (state.template->set_defaults) - (*state.template->set_defaults) ((stream_state *) & state); + if (state.templat->set_defaults) + (*state.templat->set_defaults) ((stream_state *) & state); state.width = jdev->width; state.height = jdev->height; /* Set up the streams. */ - fbuf_size = max(512 /* arbitrary */ , state.template->min_out_size); - jbuf_size = state.template->min_in_size; + fbuf_size = max(512 /* arbitrary */ , state.templat->min_out_size); + jbuf_size = state.templat->min_in_size; if ((fbuf = gs_alloc_bytes(mem, fbuf_size, "jbig2_print_page(fbuf)")) == 0 || (jbuf = gs_alloc_bytes(mem, jbuf_size, "jbig2_print_page(jbuf)")) == 0 ) { @@ -91,10 +91,10 @@ jbig2_print_page(gx_device_printer * pdev, FILE * prn_stream) s_std_init(&cstrm, jbuf, jbuf_size, &s_filter_write_procs, s_mode_write); cstrm.state = (stream_state *) & state; - cstrm.procs.process = state.template->process; + cstrm.procs.process = state.templat->process; cstrm.strm = &fstrm; - if (state.template->init) - (*state.template->init) (cstrm.state); + if (state.templat->init) + (*state.templat->init) (cstrm.state); /* Copy the data to the output. */ for (lnum = 0; lnum < jdev->height; ++lnum) { diff --git a/gs/base/gdevjpeg.c b/gs/base/gdevjpeg.c index 635a0121a..fbafd2151 100644 --- a/gs/base/gdevjpeg.c +++ b/gs/base/gdevjpeg.c @@ -421,11 +421,11 @@ jpeg_print_page(gx_device_printer * pdev, FILE * prn_stream) goto fail; } /* Create the DCT encoder state. */ - jcdp->template = s_DCTE_template; - s_init_state((stream_state *)&state, &jcdp->template, 0); - if (state.template->set_defaults) { + jcdp->templat = s_DCTE_template; + s_init_state((stream_state *)&state, &jcdp->templat, 0); + if (state.templat->set_defaults) { state.memory = mem; - (*state.template->set_defaults) ((stream_state *) & state); + (*state.templat->set_defaults) ((stream_state *) & state); state.memory = NULL; } state.QFactor = 1.0; /* disable quality adjustment in zfdcte.c */ @@ -478,15 +478,15 @@ jpeg_print_page(gx_device_printer * pdev, FILE * prn_stream) /* Make sure we get at least a full scan line of input. */ state.scan_line_size = jcdp->cinfo.input_components * jcdp->cinfo.image_width; - jcdp->template.min_in_size = + jcdp->templat.min_in_size = max(s_DCTE_template.min_in_size, state.scan_line_size); /* Make sure we can write the user markers in a single go. */ - jcdp->template.min_out_size = + jcdp->templat.min_out_size = max(s_DCTE_template.min_out_size, state.Markers.size); /* Set up the streams. */ - fbuf_size = max(512 /* arbitrary */ , jcdp->template.min_out_size); - jbuf_size = jcdp->template.min_in_size; + fbuf_size = max(512 /* arbitrary */ , jcdp->templat.min_out_size); + jbuf_size = jcdp->templat.min_in_size; if ((fbuf = gs_alloc_bytes(mem, fbuf_size, "jpeg_print_page(fbuf)")) == 0 || (jbuf = gs_alloc_bytes(mem, jbuf_size, "jpeg_print_page(jbuf)")) == 0 ) { @@ -499,10 +499,10 @@ jpeg_print_page(gx_device_printer * pdev, FILE * prn_stream) s_std_init(&jstrm, jbuf, jbuf_size, &s_filter_write_procs, s_mode_write); jstrm.state = (stream_state *) & state; - jstrm.procs.process = state.template->process; + jstrm.procs.process = state.templat->process; jstrm.strm = &fstrm; - if (state.template->init) - (*state.template->init) (jstrm.state); + if (state.templat->init) + (*state.templat->init) (jstrm.state); /* Copy the data to the output. */ for (lnum = 0; lnum < pdev->height; ++lnum) { diff --git a/gs/base/gdevjpx.c b/gs/base/gdevjpx.c index d7b4d4177..55bad4f66 100644 --- a/gs/base/gdevjpx.c +++ b/gs/base/gdevjpx.c @@ -154,8 +154,8 @@ jpx_print_page(gx_device_printer * pdev, FILE * prn_stream) } /* Create the jpx encoder state. */ s_init_state((stream_state *)&state, &s_jpxe_template, 0); - if (state.template->set_defaults) - (*state.template->set_defaults) ((stream_state *) & state); + if (state.templat->set_defaults) + (*state.templat->set_defaults) ((stream_state *) & state); state.width = jdev->width; state.height = jdev->height; switch (jdev->color_info.depth) { @@ -175,8 +175,8 @@ jpx_print_page(gx_device_printer * pdev, FILE * prn_stream) /* state.quality = 35; */ /* Set up the streams. */ - fbuf_size = max(512 /* arbitrary */ , state.template->min_out_size); - jbuf_size = state.template->min_in_size; + fbuf_size = max(512 /* arbitrary */ , state.templat->min_out_size); + jbuf_size = state.templat->min_in_size; if ((fbuf = gs_alloc_bytes(mem, fbuf_size, "jpx_print_page(fbuf)")) == 0 || (jbuf = gs_alloc_bytes(mem, jbuf_size, "jpx_print_page(jbuf)")) == 0 ) { @@ -189,10 +189,10 @@ jpx_print_page(gx_device_printer * pdev, FILE * prn_stream) s_std_init(&cstrm, jbuf, jbuf_size, &s_filter_write_procs, s_mode_write); cstrm.state = (stream_state *) & state; - cstrm.procs.process = state.template->process; + cstrm.procs.process = state.templat->process; cstrm.strm = &fstrm; - if (state.template->init) - (*state.template->init) (cstrm.state); + if (state.templat->init) + (*state.templat->init) (cstrm.state); /* Copy the data to the output. */ for (lnum = 0; lnum < jdev->height; ++lnum) { diff --git a/gs/base/gdevpdfd.c b/gs/base/gdevpdfd.c index 0c55fde69..a81ec2280 100644 --- a/gs/base/gdevpdfd.c +++ b/gs/base/gdevpdfd.c @@ -832,13 +832,13 @@ pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd) s.ctm.ty = cvd->m.ty; memset(&inst, 0, sizeof(inst)); inst.saved = (gs_state *)&s; /* HACK : will use s.ctm only. */ - inst.template.PaintType = 1; - inst.template.TilingType = 1; - inst.template.BBox.p.x = inst.template.BBox.p.y = 0; - inst.template.BBox.q.x = cvd->mdev.width; - inst.template.BBox.q.y = cvd->mdev.height; - inst.template.XStep = (float)cvd->mdev.width; - inst.template.YStep = (float)cvd->mdev.height; + inst.templat.PaintType = 1; + inst.templat.TilingType = 1; + inst.templat.BBox.p.x = inst.templat.BBox.p.y = 0; + inst.templat.BBox.q.x = cvd->mdev.width; + inst.templat.BBox.q.y = cvd->mdev.height; + inst.templat.XStep = (float)cvd->mdev.width; + inst.templat.YStep = (float)cvd->mdev.height; code = (*dev_proc(pdev, dev_spec_op))((gx_device *)pdev, gxdso_pattern_start_accum, &inst, id); if (code >= 0) { @@ -1155,7 +1155,7 @@ gdev_pdf_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath pdf_put_matrix(pdev, NULL, &cvd.m, " cm q\n"); cvd.write_matrix = false; if (code >= 0) - code = gs_shading_do_fill_rectangle(pi.template.Shading, + code = gs_shading_do_fill_rectangle(pi.templat.Shading, NULL, (gx_device *)&cvd.mdev, (gs_imager_state *)pgs, !pi.shfill); if (code >= 0) code = pdf_dump_converted_image(pdev, &cvd); diff --git a/gs/base/gdevpdfi.c b/gs/base/gdevpdfi.c index 4424545d1..32f424ef7 100644 --- a/gs/base/gdevpdfi.c +++ b/gs/base/gdevpdfi.c @@ -1013,13 +1013,13 @@ use_image_as_pattern(gx_device_pdf *pdev, pdf_resource_t *pres1, s.ctm.ty = pmat->ty; memset(&inst, 0, sizeof(inst)); inst.saved = (gs_state *)&s; /* HACK : will use s.ctm only. */ - inst.template.PaintType = 1; - inst.template.TilingType = 1; - inst.template.BBox.p.x = inst.template.BBox.p.y = 0; - inst.template.BBox.q.x = 1; - inst.template.BBox.q.y = 1; - inst.template.XStep = 2; /* Set 2 times bigger step against artifacts. */ - inst.template.YStep = 2; + inst.templat.PaintType = 1; + inst.templat.TilingType = 1; + inst.templat.BBox.p.x = inst.templat.BBox.p.y = 0; + inst.templat.BBox.q.x = 1; + inst.templat.BBox.q.y = 1; + inst.templat.XStep = 2; /* Set 2 times bigger step against artifacts. */ + inst.templat.YStep = 2; code = (*dev_proc(pdev, dev_spec_op))((gx_device *)pdev, gxdso_pattern_start_accum, &inst, id); if (code >= 0) diff --git a/gs/base/gdevpdfm.c b/gs/base/gdevpdfm.c index 8ad76fd6b..741d55271 100644 --- a/gs/base/gdevpdfm.c +++ b/gs/base/gdevpdfm.c @@ -305,7 +305,7 @@ setup_pdfmark_stream_compression(gx_device_psdf *pdev0, static const pdf_filter_names_t fnames = { PDF_FILTER_NAMES }; - const stream_template *template = + const stream_template *templat = (pdev->params.UseFlateCompression && pdev->version >= psdf_version_ll3 ? &s_zlibE_template : &s_LZWE_template); @@ -325,13 +325,13 @@ setup_pdfmark_stream_compression(gx_device_psdf *pdev0, return_error(gs_error_VMerror); } } - st = s_alloc_state(mem, template->stype, + st = s_alloc_state(mem, templat->stype, "setup_pdfmark_stream_compression"); if (st == 0) return_error(gs_error_VMerror); - if (template->set_defaults) - (*template->set_defaults) (st); - if (s_add_filter(&pco->input_strm, template, st, mem) == 0) { + if (templat->set_defaults) + (*templat->set_defaults) (st); + if (s_add_filter(&pco->input_strm, templat, st, mem) == 0) { gs_free_object(mem, st, "setup_image_compression"); return_error(gs_error_VMerror); } diff --git a/gs/base/gdevpdfo.c b/gs/base/gdevpdfo.c index 882551ee9..004924d35 100644 --- a/gs/base/gdevpdfo.c +++ b/gs/base/gdevpdfo.c @@ -1650,7 +1650,7 @@ cos_write_stream_alloc(cos_stream_t *pcs, gx_device_pdf *pdev, if (s == 0 || ss == 0 || buf == 0) goto fail; - ss->template = &cos_write_stream_template; + ss->templat = &cos_write_stream_template; ss->pcs = pcs; ss->pcs->stream_md5_valid = 0; gs_md5_init(&ss->pcs->md5); diff --git a/gs/base/gdevpdfu.c b/gs/base/gdevpdfu.c index 263f3ed04..c70c9de9a 100644 --- a/gs/base/gdevpdfu.c +++ b/gs/base/gdevpdfu.c @@ -877,47 +877,47 @@ none_to_stream(gx_device_pdf * pdev) return code; pdev->strm = s; if (pdev->compression == pdf_compress_Flate) { /* Set up the Flate filter. */ - const stream_template *template; + const stream_template *templat; stream *es; byte *buf; compression_filter_state *st; if (!pdev->binary_ok) { /* Set up the A85 filter */ - const stream_template *template = &s_A85E_template; + const stream_template *templat2 = &s_A85E_template; stream *as = s_alloc(pdev->pdf_memory, "PDF contents stream"); byte *buf = gs_alloc_bytes(pdev->pdf_memory, sbuf_size, "PDF contents buffer"); stream_A85E_state *ast = gs_alloc_struct(pdev->pdf_memory, stream_A85E_state, - template->stype, "PDF contents state"); + templat2->stype, "PDF contents state"); if (as == 0 || ast == 0 || buf == 0) return_error(gs_error_VMerror); s_std_init(as, buf, sbuf_size, &s_filter_write_procs, s_mode_write); ast->memory = pdev->pdf_memory; - ast->template = template; + ast->templat = templat2; as->state = (stream_state *) ast; - as->procs.process = template->process; + as->procs.process = templat2->process; as->strm = s; - (*template->init) ((stream_state *) ast); + (*templat2->init) ((stream_state *) ast); pdev->strm = s = as; } - template = &compression_filter_template; + templat = &compression_filter_template; es = s_alloc(pdev->pdf_memory, "PDF compression stream"); buf = gs_alloc_bytes(pdev->pdf_memory, sbuf_size, "PDF compression buffer"); st = gs_alloc_struct(pdev->pdf_memory, compression_filter_state, - template->stype, "PDF compression state"); + templat->stype, "PDF compression state"); if (es == 0 || st == 0 || buf == 0) return_error(gs_error_VMerror); s_std_init(es, buf, sbuf_size, &s_filter_write_procs, s_mode_write); st->memory = pdev->pdf_memory; - st->template = template; + st->templat = templat; es->state = (stream_state *) st; - es->procs.process = template->process; + es->procs.process = templat->process; es->strm = s; - (*template->set_defaults) ((stream_state *) st); - (*template->init) ((stream_state *) st); + (*templat->set_defaults) ((stream_state *) st); + (*templat->init) ((stream_state *) st); pdev->strm = s = es; } } @@ -2081,10 +2081,10 @@ pdf_put_filters(cos_dict_t *pcd, gx_device_pdf *pdev, stream *s, for (; fs != 0; fs = fs->strm) { const stream_state *st = fs->state; - const stream_template *template = st->template; + const stream_template *templat = st->templat; #define TEMPLATE_IS(atemp)\ - (template->process == (atemp).process) + (templat->process == (atemp).process) if (TEMPLATE_IS(s_A85E_template)) binary_ok = false; else if (TEMPLATE_IS(s_CFE_template)) { @@ -2179,16 +2179,16 @@ pdf_put_filters(cos_dict_t *pcd, gx_device_pdf *pdev, stream *s, static int pdf_flate_binary(gx_device_pdf *pdev, psdf_binary_writer *pbw) { - const stream_template *template = (pdev->CompatibilityLevel < 1.3 ? + const stream_template *templat = (pdev->CompatibilityLevel < 1.3 ? &s_LZWE_template : &s_zlibE_template); - stream_state *st = s_alloc_state(pdev->pdf_memory, template->stype, + stream_state *st = s_alloc_state(pdev->pdf_memory, templat->stype, "pdf_write_function"); if (st == 0) return_error(gs_error_VMerror); - if (template->set_defaults) - template->set_defaults(st); - return psdf_encode_binary(pbw, template, st); + if (templat->set_defaults) + templat->set_defaults(st); + return psdf_encode_binary(pbw, templat, st); } /* diff --git a/gs/base/gdevpdfv.c b/gs/base/gdevpdfv.c index 8ca03b324..ca76b3323 100644 --- a/gs/base/gdevpdfv.c +++ b/gs/base/gdevpdfv.c @@ -199,7 +199,7 @@ int pdf_store_pattern1_params(gx_device_pdf *pdev, pdf_resource_t *pres, gs_pattern1_instance_t *pinst) { - gs_pattern1_template_t *t = &pinst->template; + gs_pattern1_template_t *t = &pinst->templat; gs_matrix smat2 = ctm_only((gs_imager_state *)pinst->saved), smat; double scale_x = pdev->HWResolution[0] / 72.0; double scale_y = pdev->HWResolution[1] / 72.0; @@ -903,7 +903,7 @@ pdf_put_pattern2(gx_device_pdf *pdev, const gx_drawing_color *pdc, { const gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdc->ccolor.pattern; - const gs_shading_t *psh = pinst->template.Shading; + const gs_shading_t *psh = pinst->templat.Shading; cos_value_t v; pdf_resource_t *pres; pdf_resource_t *psres; diff --git a/gs/base/gdevpsdi.c b/gs/base/gdevpsdi.c index b7b6a3903..a0e20dd79 100644 --- a/gs/base/gdevpsdi.c +++ b/gs/base/gdevpsdi.c @@ -52,7 +52,7 @@ pixel_resize(psdf_binary_writer * pbw, int width, int num_components, int bpc_in, int bpc_out) { gs_memory_t *mem = pbw->dev->v_memory; - const stream_template *template; + const stream_template *templat; stream_1248_state *st; int code; @@ -64,19 +64,19 @@ pixel_resize(psdf_binary_writer * pbw, int width, int num_components, 0, 0, 0, 0, 0, 0, 0, &s_12_8_template }; - template = exts[bpc_in]; + templat = exts[bpc_in]; } else { static const stream_template *const rets[5] = { 0, &s_8_1_template, &s_8_2_template, 0, &s_8_4_template }; - template = rets[bpc_out]; + templat = rets[bpc_out]; } st = (stream_1248_state *) - s_alloc_state(mem, template->stype, "pixel_resize state"); + s_alloc_state(mem, templat->stype, "pixel_resize state"); if (st == 0) return_error(gs_error_VMerror); - code = psdf_encode_binary(pbw, template, (stream_state *) st); + code = psdf_encode_binary(pbw, templat, (stream_state *) st); if (code < 0) { gs_free_object(mem, st, "pixel_resize state"); return code; @@ -220,7 +220,7 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, { gx_device_psdf *pdev = pbw->dev; gs_memory_t *mem = pdev->v_memory; - const stream_template *template = pdip->filter_template; + const stream_template *templat = pdip->filter_template; const stream_template *lossless_template = (pdev->params.UseFlateCompression && pdev->version >= psdf_version_ll3 ? @@ -251,25 +251,25 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, * called 2 times with different values of the 'lossless' argument. */ if (lossless) { - template = lossless_template; - } else if (template == NULL || template == &s_zlibE_template || - template == &s_LZWE_template) { - template = &s_DCTE_template; + templat = lossless_template; + } else if (templat == NULL || templat == &s_zlibE_template || + templat == &s_LZWE_template) { + templat = &s_DCTE_template; } dict = pdip->ACSDict; } else if (!lossless) return gs_error_rangecheck; /* Reject the alternative stream. */ - if (pdev->version < psdf_version_ll3 && template == &s_zlibE_template) - template = lossless_template; + if (pdev->version < psdf_version_ll3 && templat == &s_zlibE_template) + templat = lossless_template; if (dict != NULL) /* Some interpreters don't supply filter parameters. */ gs_c_param_list_read(dict); /* ensure param list is in read mode */ - if (template == 0) /* no compression */ + if (templat == 0) /* no compression */ return 0; if (pim->Width < 200 && pim->Height < 200) /* Prevent a fixed overflow. */ if (pim->Width * pim->Height * Colors * pim->BitsPerComponent <= 160) return 0; /* not worth compressing */ /* Only use DCTE for 8-bit, non-Indexed data. */ - if (template == &s_DCTE_template) { + if (templat == &s_DCTE_template) { if (Indexed || !(pdip->Downsample ? pdip->Depth == 8 || @@ -277,18 +277,18 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, pim->BitsPerComponent == 8) ) { /* Use LZW/Flate instead. */ - template = lossless_template; + templat = lossless_template; } } - st = s_alloc_state(mem, template->stype, "setup_image_compression"); + st = s_alloc_state(mem, templat->stype, "setup_image_compression"); if (st == 0) return_error(gs_error_VMerror); - if (template->set_defaults) - (*template->set_defaults) (st); - if (template == &s_CFE_template) { + if (templat->set_defaults) + (*templat->set_defaults) (st); + if (templat == &s_CFE_template) { stream_CFE_state *const ss = (stream_CFE_state *) st; - if (pdip->Dict != 0 && pdip->filter_template == template) { + if (pdip->Dict != 0 && pdip->filter_template == templat) { s_CF_put_params((gs_param_list *)pdip->Dict, (stream_CF_state *)ss); /* ignore errors */ } else { @@ -297,22 +297,22 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, } ss->Columns = pim->Width; ss->Rows = (ss->EndOfBlock ? 0 : pim->Height); - } else if ((template == &s_LZWE_template || - template == &s_zlibE_template) && + } else if ((templat == &s_LZWE_template || + templat == &s_zlibE_template) && pdev->version >= psdf_version_ll3) { /* If not Indexed, add a PNGPredictor filter. */ if (!Indexed) { - code = psdf_encode_binary(pbw, template, st); + code = psdf_encode_binary(pbw, templat, st); if (code < 0) goto fail; - template = &s_PNGPE_template; - st = s_alloc_state(mem, template->stype, "setup_image_compression"); + templat = &s_PNGPE_template; + st = s_alloc_state(mem, templat->stype, "setup_image_compression"); if (st == 0) { code = gs_note_error(gs_error_VMerror); goto fail; } - if (template->set_defaults) - (*template->set_defaults) (st); + if (templat->set_defaults) + (*templat->set_defaults) (st); { stream_PNGP_state *const ss = (stream_PNGP_state *) st; @@ -320,7 +320,7 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, ss->Columns = pim->Width; } } - } else if (template == &s_DCTE_template) { + } else if (templat == &s_DCTE_template) { gs_c_param_list list, *param = dict; gs_c_param_list_write(&list, mem); @@ -338,7 +338,7 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, return 0; } else { # ifdef USE_LDF_JB2 - if (template == &s_jbig2encode_template) { + if (templat == &s_jbig2encode_template) { stream_jbig2encode_state *state = (stream_jbig2encode_state *)st; state->width = pim->Width; @@ -346,7 +346,7 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, } # endif # ifdef USE_LWF_JP2 - if (template == &s_jpxe_template) { + if (templat == &s_jpxe_template) { stream_jpxe_state *state = (stream_jpxe_state *)st; int ncomps = pim->ColorSpace->type->num_components(pim->ColorSpace); @@ -372,7 +372,7 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, } # endif } - code = psdf_encode_binary(pbw, template, st); + code = psdf_encode_binary(pbw, templat, st); if (code >= 0) return 0; fail: @@ -401,7 +401,7 @@ setup_downsampling(psdf_binary_writer * pbw, const psdf_image_params * pdip, { gx_device_psdf *pdev = pbw->dev; /* Note: Bicubic is currently interpreted as Average. */ - const stream_template *template = + const stream_template *templat = (pdip->DownsampleType == ds_Subsample ? &s_Subsample_template : &s_Average_template); int factor = (int)(resolution / pdip->Resolution); @@ -411,12 +411,12 @@ setup_downsampling(psdf_binary_writer * pbw, const psdf_image_params * pdip, stream_state *st; int code; - st = s_alloc_state(pdev->v_memory, template->stype, + st = s_alloc_state(pdev->v_memory, templat->stype, "setup_downsampling"); if (st == 0) return_error(gs_error_VMerror); - if (template->set_defaults) - template->set_defaults(st); + if (templat->set_defaults) + templat->set_defaults(st); { stream_Downsample_state *const ss = (stream_Downsample_state *) st; @@ -428,8 +428,8 @@ setup_downsampling(psdf_binary_writer * pbw, const psdf_image_params * pdip, ss->XFactor = ss->YFactor = factor; ss->AntiAlias = pdip->AntiAlias; ss->padX = ss->padY = false; /* should be true */ - if (template->init) - template->init(st); + if (templat->init) + templat->init(st); pim->Width = s_Downsample_size_out(pim->Width, factor, ss->padX); pim->Height = s_Downsample_size_out(pim->Height, factor, ss->padY); pim->BitsPerComponent = pdip->Depth; @@ -440,7 +440,7 @@ setup_downsampling(psdf_binary_writer * pbw, const psdf_image_params * pdip, if ((code = setup_image_compression(pbw, pdip, pim, pis, lossless)) < 0 || (code = pixel_resize(pbw, pim->Width, ss->Colors, 8, pdip->Depth)) < 0 || - (code = psdf_encode_binary(pbw, template, st)) < 0 || + (code = psdf_encode_binary(pbw, templat, st)) < 0 || (code = pixel_resize(pbw, orig_width, ss->Colors, orig_bpc, 8)) < 0 ) { diff --git a/gs/base/gdevpsdp.c b/gs/base/gdevpsdp.c index 3fd1fd03d..b6a619a6c 100644 --- a/gs/base/gdevpsdp.c +++ b/gs/base/gdevpsdp.c @@ -87,7 +87,7 @@ CIE image Cal/ICC Cal/ICC Cal/ICC CalRGB/sRGB typedef struct psdf_image_filter_name_s { const char *pname; - const stream_template *template; + const stream_template *templat; psdf_version min_version; } psdf_image_filter_name; @@ -643,7 +643,7 @@ psdf_put_embed_param(gs_param_list * plist, gs_param_name notpname, static int psdf_put_image_dict_param(gs_param_list * plist, const gs_param_name pname, gs_c_param_list **pplvalue, - const stream_template * template, + const stream_template * templat, ss_put_params_t put_params, gs_memory_t * mem) { gs_param_dict dict; @@ -659,16 +659,16 @@ psdf_put_image_dict_param(gs_param_list * plist, const gs_param_name pname, return 0; case 0: { /* Check the parameter values now. */ - stream_state *ss = s_alloc_state(mem, template->stype, pname); + stream_state *ss = s_alloc_state(mem, templat->stype, pname); if (ss == 0) return_error(gs_error_VMerror); - ss->template = template; - if (template->set_defaults) - template->set_defaults(ss); + ss->templat = templat; + if (templat->set_defaults) + templat->set_defaults(ss); code = put_params(dict.list, ss); - if (template->release) - template->release(ss); + if (templat->release) + templat->release(ss); gs_free_object(mem, ss, pname); if (code < 0) { param_signal_error(plist, pname, code); @@ -726,18 +726,18 @@ psdf_put_image_params(const gx_device_psdf * pdev, gs_param_list * plist, /* (AutoFilter) */ /* (Depth) */ if ((pname = pnames->Dict) != 0) { - const stream_template *template; + const stream_template *templat; ss_put_params_t put_params; /* Hack to determine what kind of a Dict we want: */ if (pnames->Dict[0] == 'M') - template = &s_CFE_template, + templat = &s_CFE_template, put_params = psdf_CF_put_params; else - template = &s_DCTE_template, + templat = &s_DCTE_template, put_params = psdf_DCT_put_params; code = psdf_put_image_dict_param(plist, pname, ¶ms->Dict, - template, put_params, mem); + templat, put_params, mem); if (code < 0) ecode = code; } @@ -772,7 +772,7 @@ psdf_put_image_params(const gx_device_psdf * pdev, gs_param_list * plist, pn++; if (pn->pname != 0 && pn->min_version <= pdev->version) { params->Filter = pn->pname; - params->filter_template = pn->template; + params->filter_template = pn->templat; } break; } @@ -796,7 +796,7 @@ psdf_put_image_params(const gx_device_psdf * pdev, gs_param_list * plist, goto ipe; } params->Filter = pn->pname; - params->filter_template = pn->template; + params->filter_template = pn->templat; break; } default: diff --git a/gs/base/gdevpsds.c b/gs/base/gdevpsds.c index 4a13c2955..70f0f9894 100644 --- a/gs/base/gdevpsds.c +++ b/gs/base/gdevpsds.c @@ -34,7 +34,7 @@ int s_1248_init(stream_1248_state *ss, int Columns, int samples_per_pixel) { ss->samples_per_row = Columns * samples_per_pixel; - return ss->template->init((stream_state *)ss); + return ss->templat->init((stream_state *)ss); } /* Initialize the state. */ @@ -523,7 +523,7 @@ const stream_template s_IE_template = { void test_IE(void) { - const stream_template *const template = &s_IE_template; + const stream_templat *const template = &s_IE_template; stream_IE_state state; stream_state *const ss = (stream_state *)&state; static const float decode[6] = {1, 0, 1, 0, 1, 0}; @@ -540,7 +540,7 @@ test_IE(void) byte table[3 * 5]; int n; - template->set_defaults(ss); + templat->set_defaults(ss); state.BitsPerComponent = 4; state.NumComponents = 3; state.Width = 3; @@ -561,7 +561,7 @@ test_IE(void) memset(table, 0xcc, sizeof(table)); memset(out, 0xff, sizeof(out)); dprintf1("processing %d bytes\n", n); - status = template->process(ss, &r, &w, true); + status = templat->process(ss, &r, &w, true); dprintf3("%d bytes read, %d bytes written, status = %d\n", (int)(r.ptr + 1 - in), (int)(w.ptr + 1 - out), status); debug_dump_bytes(table, table + sizeof(table), "table"); diff --git a/gs/base/gdevpsdu.c b/gs/base/gdevpsdu.c index f21601e6b..85a18bf16 100644 --- a/gs/base/gdevpsdu.c +++ b/gs/base/gdevpsdu.c @@ -323,7 +323,7 @@ psdf_begin_binary(gx_device_psdf * pdev, psdf_binary_writer * pbw) gs_free_object(mem, buf, "psdf_begin_binary(buf)"); return_error(gs_error_VMerror); } - ss->template = &s_A85E_template; + ss->templat = &s_A85E_template; s_init_filter(s, (stream_state *)ss, buf, BUF_SIZE, pdev->strm); #undef BUF_SIZE pbw->strm = s; @@ -336,10 +336,10 @@ psdf_begin_binary(gx_device_psdf * pdev, psdf_binary_writer * pbw) /* Add an encoding filter. The client must have allocated the stream state, */ /* if any, using pdev->v_memory. */ int -psdf_encode_binary(psdf_binary_writer * pbw, const stream_template * template, +psdf_encode_binary(psdf_binary_writer * pbw, const stream_template * templat, stream_state * ss) { - return (s_add_filter(&pbw->strm, template, ss, pbw->memory) == 0 ? + return (s_add_filter(&pbw->strm, templat, ss, pbw->memory) == 0 ? gs_note_error(gs_error_VMerror) : 0); } @@ -392,17 +392,17 @@ psdf_DCT_filter(gs_param_list *plist /* may be NULL */, if (code < 0) return code; /* Create the filter. */ - jcdp->template = s_DCTE_template; + jcdp->templat = s_DCTE_template; /* Make sure we get at least a full scan line of input. */ ss->scan_line_size = jcdp->cinfo.input_components * jcdp->cinfo.image_width; - jcdp->template.min_in_size = + jcdp->templat.min_in_size = max(s_DCTE_template.min_in_size, ss->scan_line_size); /* Make sure we can write the user markers in a single go. */ - jcdp->template.min_out_size = + jcdp->templat.min_out_size = max(s_DCTE_template.min_out_size, ss->Markers.size); if (pbw) - code = psdf_encode_binary(pbw, &jcdp->template, st); + code = psdf_encode_binary(pbw, &jcdp->templat, st); if (code >= 0) { gs_c_param_list_release(&rcc_list); return 0; @@ -421,21 +421,21 @@ int psdf_CFE_binary(psdf_binary_writer * pbw, int w, int h, bool invert) { gs_memory_t *mem = pbw->memory; - const stream_template *template = &s_CFE_template; + const stream_template *templat = &s_CFE_template; stream_CFE_state *st = - gs_alloc_struct(mem, stream_CFE_state, template->stype, + gs_alloc_struct(mem, stream_CFE_state, templat->stype, "psdf_CFE_binary"); int code; if (st == 0) return_error(gs_error_VMerror); - (*template->set_defaults) ((stream_state *) st); + (*templat->set_defaults) ((stream_state *) st); st->K = -1; st->Columns = w; st->Rows = 0; st->BlackIs1 = !invert; - st->EndOfBlock = pbw->strm->state->template != &s_A85E_template; - code = psdf_encode_binary(pbw, template, (stream_state *) st); + st->EndOfBlock = pbw->strm->state->templat != &s_A85E_template; + code = psdf_encode_binary(pbw, templat, (stream_state *) st); if (code < 0) gs_free_object(mem, st, "psdf_CFE_binary"); return code; diff --git a/gs/base/gdevpsim.c b/gs/base/gdevpsim.c index a9b8c1db9..dd1854871 100644 --- a/gs/base/gdevpsim.c +++ b/gs/base/gdevpsim.c @@ -369,7 +369,7 @@ psrgb_print_page(gx_device_printer * pdev, FILE * prn_stream) s_mode_write); a85s.memory = 0; a85state.memory = 0; - a85state.template = &s_A85E_template; + a85state.templat = &s_A85E_template; (*s_A85E_template.init) ((stream_state *) & a85state); a85s.state = (stream_state *) & a85state; a85s.procs.process = s_A85E_template.process; @@ -381,7 +381,7 @@ psrgb_print_page(gx_device_printer * pdev, FILE * prn_stream) s_mode_write); rls.memory = 0; rlstate.memory = 0; - rlstate.template = &s_RLE_template; + rlstate.templat = &s_RLE_template; (*s_RLE_template.init) ((stream_state *) & rlstate); rls.state = (stream_state *) & rlstate; rls.procs.process = s_RLE_template.process; diff --git a/gs/base/genconf.c b/gs/base/genconf.c index a5cf697d0..c2d138dca 100644 --- a/gs/base/genconf.c +++ b/gs/base/genconf.c @@ -472,12 +472,12 @@ main(int argc, char *argv[]) fputs("/* This file was generated automatically by genconf.c. */\n", out); fputs("/* For documentation, see gsconfig.c. */\n", out); { - char template[80]; + char templat[80]; - sprintf(template, + sprintf(templat, "font_(\"0.font_%%s\",%sf_%%s,zf_%%s)\n", conf.name_prefix); - write_list(out, &conf.lists.named.fonts, template); + write_list(out, &conf.lists.named.fonts, templat); } break; case 'h': @@ -747,7 +747,7 @@ add_entry(config_t * pconf, char *category, const char *item, int file_index) return 0; } else { /* add to current category */ char str[MAX_STR]; - char template[80]; + char templat[80]; const char *pat = 0; string_list_t *list = &pconf->lists.named.resources; @@ -770,8 +770,8 @@ add_entry(config_t * pconf, char *category, const char *item, int file_index) else goto err; list = &pconf->lists.named.devs; -pre: sprintf(template, pat, pconf->name_prefix); - pat = template; +pre: sprintf(templat, pat, pconf->name_prefix); + pat = templat; break; case 'e': if (IS_CAT("emulator")) { @@ -828,9 +828,9 @@ pre: sprintf(template, pat, pconf->name_prefix); case 'o': if (IS_CAT("obj")) { list = &pconf->lists.named.objs; - strcpy(template, pconf->file_prefix); - strcat(template, "%s"); - pat = template; + strcpy(templat, pconf->file_prefix); + strcat(templat, "%s"); + pat = templat; break; } if (IS_CAT("oper")) { diff --git a/gs/base/gsfunc4.c b/gs/base/gsfunc4.c index 04bba439d..50ff48170 100644 --- a/gs/base/gsfunc4.c +++ b/gs/base/gsfunc4.c @@ -680,15 +680,15 @@ calc_access(const gs_data_source_t *psrc, ulong start, uint length, stream_SFD_state st; stream ds, bs; byte dbuf[200]; /* arbitrary */ - const stream_template *const template = &s_SFD_template; + const stream_template *const templat = &s_SFD_template; /* Set up the stream that writes into the buffer. */ s_init(&bs, NULL); swrite_string(&bs, buf, length); /* Set up the SubFileDecode stream. */ s_init(&ds, NULL); - s_init_state((stream_state *)&st, template, NULL); - template->set_defaults((stream_state *)&st); + s_init_state((stream_state *)&st, templat, NULL); + templat->set_defaults((stream_state *)&st); st.skip_count = start; s_init_filter(&ds, (stream_state *)&st, dbuf, sizeof(dbuf), &bs); calc_put(&ds, pfn); diff --git a/gs/base/gsptype1.c b/gs/base/gsptype1.c index 6cebe5751..d3138a0ef 100644 --- a/gs/base/gsptype1.c +++ b/gs/base/gsptype1.c @@ -55,7 +55,7 @@ static ENUM_PTRS_BEGIN(pattern1_instance_enum_ptrs) { if (index < st_pattern1_template_max_ptrs) { gs_ptr_type_t ptype = ENUM_SUPER_ELT(gs_pattern1_instance_t, st_pattern1_template, - template, 0); + templat, 0); if (ptype) return ptype; @@ -65,7 +65,7 @@ static ENUM_PTRS_BEGIN(pattern1_instance_enum_ptrs) { } ENUM_PTRS_END static RELOC_PTRS_BEGIN(pattern1_instance_reloc_ptrs) { RELOC_PREFIX(st_pattern_instance); - RELOC_SUPER(gs_pattern1_instance_t, st_pattern1_template, template); + RELOC_SUPER(gs_pattern1_instance_t, st_pattern1_template, templat); } RELOC_PTRS_END /* Define a PatternType 1 pattern. */ @@ -162,7 +162,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc, code = gs_note_error(gs_error_rangecheck); goto fsaved; } - inst.template = *pcp; + inst.templat = *pcp; code = compute_inst_matrix(&inst, saved, &bbox, dev_width, dev_height); if (code < 0) goto fsaved; @@ -173,10 +173,10 @@ gs_pattern1_make_pattern(gs_client_color * pcc, if possible. Note that any skew or rotation matrix will make it neccessary to perform blending */ - { float width = inst.template.BBox.q.x - inst.template.BBox.p.x; - float height = inst.template.BBox.q.y - inst.template.BBox.p.y; + { float width = inst.templat.BBox.q.x - inst.templat.BBox.p.x; + float height = inst.templat.BBox.q.y - inst.templat.BBox.p.y; - if ( inst.template.XStep < width || inst.template.YStep < height || ctm_only(saved).xy != 0 || + if ( inst.templat.XStep < width || inst.templat.YStep < height || ctm_only(saved).xy != 0 || ctm_only(saved).yx != 0 ){ inst.has_overlap = true; @@ -194,7 +194,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc, inst.step_matrix.xx, inst.step_matrix.xy, inst.step_matrix.yx, inst.step_matrix.yy, inst.step_matrix.tx, inst.step_matrix.ty); if_debug5('t', "[t]bbox=(%g,%g),(%g,%g), uses_transparency=%d\n", - bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y, inst.template.uses_transparency); + bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y, inst.templat.uses_transparency); { float bbw = bbox.q.x - bbox.p.x; float bbh = bbox.q.y - bbox.p.y; @@ -245,7 +245,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc, inst.size.x, inst.size.y); if_debug4('t', "[t]bbox=(%g,%g),(%g,%g)\n", bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y); - } else if ((ADJUST_AS_ADOBE) && (inst.template.TilingType != 2)) { + } else if ((ADJUST_AS_ADOBE) && (inst.templat.TilingType != 2)) { if (inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 && fabs(fabs(inst.step_matrix.xx) - bbw) < 0.5 && fabs(fabs(inst.step_matrix.yy) - bbh) < 0.5 @@ -305,11 +305,11 @@ gs_pattern1_make_pattern(gs_client_color * pcc, gs_scale(saved, 1, (fabs(inst.size.y) - 1.0 / fixed_scale) / fabs(inst.size.y)); #endif } - code = gs_bbox_transform(&inst.template.BBox, &ctm_only(saved), &bbox); + code = gs_bbox_transform(&inst.templat.BBox, &ctm_only(saved), &bbox); if (code < 0) goto fsaved; } - } else if ((inst.template.TilingType == 2) && + } else if ((inst.templat.TilingType == 2) && ((pgs->fill_adjust.x | pgs->fill_adjust.y) == 0)) { if (inst.step_matrix.xy == 0 && inst.step_matrix.yx == 0 && fabs(fabs(inst.step_matrix.xx) - bbw) <= 0.5 && @@ -318,7 +318,7 @@ gs_pattern1_make_pattern(gs_client_color * pcc, gs_translate_untransformed(saved, (bbw - inst.size.x)/2, (bbh - inst.size.y)/2); - code = gs_bbox_transform(&inst.template.BBox, &ctm_only(saved), &bbox); + code = gs_bbox_transform(&inst.templat.BBox, &ctm_only(saved), &bbox); if (code < 0) goto fsaved; } @@ -354,13 +354,13 @@ gs_pattern1_make_pattern(gs_client_color * pcc, if (!inst.is_simple) { code = gs_newpath(saved); if (code >= 0) - code = gs_moveto(saved, inst.template.BBox.p.x, inst.template.BBox.p.y); + code = gs_moveto(saved, inst.templat.BBox.p.x, inst.templat.BBox.p.y); if (code >= 0) - code = gs_lineto(saved, inst.template.BBox.q.x, inst.template.BBox.p.y); + code = gs_lineto(saved, inst.templat.BBox.q.x, inst.templat.BBox.p.y); if (code >= 0) - code = gs_lineto(saved, inst.template.BBox.q.x, inst.template.BBox.q.y); + code = gs_lineto(saved, inst.templat.BBox.q.x, inst.templat.BBox.q.y); if (code >= 0) - code = gs_lineto(saved, inst.template.BBox.p.x, inst.template.BBox.q.y); + code = gs_lineto(saved, inst.templat.BBox.p.x, inst.templat.BBox.q.y); if (code >= 0) code = gs_clip(saved); if (code < 0) @@ -388,8 +388,8 @@ static int clamp_pattern_bbox(gs_pattern1_instance_t * pinst, gs_rect * pbbox, int width, int height, const gs_matrix * pmat) { - double xstep = pinst->template.XStep; - double ystep = pinst->template.YStep; + double xstep = pinst->templat.XStep; + double ystep = pinst->templat.YStep; double xmin = pbbox->q.x; double xmax = pbbox->p.x; double ymin = pbbox->q.y; @@ -426,8 +426,8 @@ clamp_pattern_bbox(gs_pattern1_instance_t * pinst, gs_rect * pbbox, * pattern below and to the left of the page (in pattern space) and scan * until the pattern is above and right of the page. */ - ixpat = (int) floor((pat_page.p.x - pinst->template.BBox.q.x) / xstep); - iystart = (int) floor((pat_page.p.y - pinst->template.BBox.q.y) / ystep); + ixpat = (int) floor((pat_page.p.x - pinst->templat.BBox.q.x) / xstep); + iystart = (int) floor((pat_page.p.y - pinst->templat.BBox.q.y) / ystep); /* Now do the scan */ for (; ; ixpat++) { @@ -461,10 +461,10 @@ clamp_pattern_bbox(gs_pattern1_instance_t * pinst, gs_rect * pbbox, if (yupper > ymax) ymax = yupper; } - if (ypat > pat_page.q.y - pinst->template.BBox.p.y) + if (ypat > pat_page.q.y - pinst->templat.BBox.p.y) break; } - if (xpat > pat_page.q.x - pinst->template.BBox.p.x) + if (xpat > pat_page.q.x - pinst->templat.BBox.p.x) break; } /* Update the bounding box. */ @@ -490,7 +490,7 @@ compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_state * saved, float xx, xy, yx, yy, dx, dy, temp; int code; - code = gs_bbox_transform(&pinst->template.BBox, &ctm_only(saved), pbbox); + code = gs_bbox_transform(&pinst->templat.BBox, &ctm_only(saved), pbbox); if (code < 0) return code; /* @@ -515,10 +515,10 @@ compute_inst_matrix(gs_pattern1_instance_t * pinst, gs_state * saved, return code; /* The stepping matrix : */ - xx = pinst->template.XStep * saved->ctm.xx; - xy = pinst->template.XStep * saved->ctm.xy; - yx = pinst->template.YStep * saved->ctm.yx; - yy = pinst->template.YStep * saved->ctm.yy; + xx = pinst->templat.XStep * saved->ctm.xx; + xy = pinst->templat.XStep * saved->ctm.xy; + yx = pinst->templat.YStep * saved->ctm.yx; + yy = pinst->templat.YStep * saved->ctm.yy; /* Adjust the stepping matrix so all coefficients are >= 0. */ if (xx == 0 || yy == 0) { /* We know that both xy and yx are non-zero. */ @@ -561,7 +561,7 @@ static const gs_pattern_template_t * gs_pattern1_get_pattern(const gs_pattern_instance_t *pinst) { return (const gs_pattern_template_t *) - &((const gs_pattern1_instance_t *)pinst)->template; + &((const gs_pattern1_instance_t *)pinst)->templat; } /* Get transparency object pointer */ @@ -645,7 +645,7 @@ static int gs_pattern1_set_color(const gs_client_color * pcc, gs_state * pgs) { gs_pattern1_instance_t * pinst = (gs_pattern1_instance_t *)pcc->pattern; - gs_pattern1_template_t * ptmplt = &pinst->template; + gs_pattern1_template_t * ptmplt = &pinst->templat; if (ptmplt->PaintType == 2) { const gs_color_space *pcs = gs_currentcolorspace_inline(pgs); @@ -667,7 +667,7 @@ gs_getpattern(const gs_client_color * pcc) const gs_pattern_instance_t *pinst = pcc->pattern; return (pinst == 0 || pinst->type != &gs_pattern1_type ? 0 : - &((const gs_pattern1_instance_t *)pinst)->template); + &((const gs_pattern1_instance_t *)pinst)->templat); } /* @@ -729,7 +729,7 @@ free_pixmap_pattern( ) { gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)pvpinst; - pixmap_info *ppmap = pinst->template.client_data; + pixmap_info *ppmap = pinst->templat.client_data; ppmap->free_proc(pmem, pvpinst, cname); gs_free_object(pmem, ppmap, cname); @@ -1893,7 +1893,7 @@ gx_dc_pattern_read( memset(&inst, 0, sizeof(inst)); /* NB: Currently PaintType 2 can't pass here. */ state.device = (gx_device *)dev; /* Break 'const'. */ - inst.template.PaintType = 1; + inst.templat.PaintType = 1; inst.size.x = buf.size.x; inst.size.y = buf.size.y; inst.saved = &state; diff --git a/gs/base/gsptype2.c b/gs/base/gsptype2.c index d74cc471a..0a0b38853 100644 --- a/gs/base/gsptype2.c +++ b/gs/base/gsptype2.c @@ -38,7 +38,7 @@ static ENUM_PTRS_BEGIN(pattern2_instance_enum_ptrs) { if (index < st_pattern2_template_max_ptrs) { gs_ptr_type_t ptype = ENUM_SUPER_ELT(gs_pattern2_instance_t, st_pattern2_template, - template, 0); + templat, 0); if (ptype) return ptype; @@ -49,7 +49,7 @@ static ENUM_PTRS_BEGIN(pattern2_instance_enum_ptrs) { ENUM_PTRS_END static RELOC_PTRS_BEGIN(pattern2_instance_reloc_ptrs) { RELOC_PREFIX(st_pattern_instance); - RELOC_SUPER(gs_pattern2_instance_t, st_pattern2_template, template); + RELOC_SUPER(gs_pattern2_instance_t, st_pattern2_template, templat); } RELOC_PTRS_END /* Define a PatternType 2 pattern. */ @@ -96,7 +96,7 @@ gs_pattern2_make_pattern(gs_client_color * pcc, if (code < 0) return code; pinst = (gs_pattern2_instance_t *)pcc->pattern; - pinst->template = *ptemp; + pinst->templat = *ptemp; pinst->shfill = false; return 0; } @@ -106,7 +106,7 @@ static const gs_pattern_template_t * gs_pattern2_get_pattern(const gs_pattern_instance_t *pinst) { return (const gs_pattern_template_t *) - &((const gs_pattern2_instance_t *)pinst)->template; + &((const gs_pattern2_instance_t *)pinst)->templat; } /* Set the 'shfill' flag to a PatternType 2 pattern instance. */ @@ -196,7 +196,7 @@ static int gs_pattern2_set_color(const gs_client_color * pcc, gs_state * pgs) { gs_pattern2_instance_t * pinst = (gs_pattern2_instance_t *)pcc->pattern; - gs_color_space * pcs = pinst->template.Shading->params.ColorSpace; + gs_color_space * pcs = pinst->templat.Shading->params.ColorSpace; int code, save_overprint_mode = pgs->overprint_mode; pgs->overprint_mode = 0; @@ -229,7 +229,7 @@ gx_dc_pattern2_fill_rectangle(const gx_device_color * pdevc, int x, int y, rect.p.y = int2fixed(y); rect.q.x = int2fixed(x + w); rect.q.y = int2fixed(y + h); - return gs_shading_do_fill_rectangle(pinst->template.Shading, &rect, dev, + return gs_shading_do_fill_rectangle(pinst->templat.Shading, &rect, dev, (gs_imager_state *)pinst->saved, !pinst->shfill); } } @@ -289,10 +289,10 @@ gx_dc_pattern2_get_bbox(const gx_device_color * pdevc, gs_fixed_rect *bbox) (gs_pattern2_instance_t *)pdevc->ccolor.pattern; int code; - if (!pinst->template.Shading->params.have_BBox) + if (!pinst->templat.Shading->params.have_BBox) return 0; code = gx_dc_pattern2_shade_bbox_transform2fixed( - &pinst->template.Shading->params.BBox, (gs_imager_state *)pinst->saved, bbox); + &pinst->templat.Shading->params.BBox, (gs_imager_state *)pinst->saved, bbox); if (code < 0) return code; return 1; @@ -302,7 +302,7 @@ int gx_dc_pattern2_color_has_bbox(const gx_device_color * pdevc) { gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - const gs_shading_t *psh = pinst->template.Shading; + const gs_shading_t *psh = pinst->templat.Shading; return psh->params.have_BBox; } @@ -312,7 +312,7 @@ static int gx_dc_shading_path_add_box(gx_path *ppath, const gx_device_color * pdevc) { gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - const gs_shading_t *psh = pinst->template.Shading; + const gs_shading_t *psh = pinst->templat.Shading; if (!psh->params.have_BBox) return_error(gs_error_unregistered); /* Do not call in this case. */ @@ -385,7 +385,7 @@ gx_dc_pattern2_is_rectangular_cell(const gx_device_color * pdevc, gx_device * pd if (gx_dc_is_pattern2_color(pdevc) && gx_dc_pattern2_color_has_bbox(pdevc) && (*dev_proc(pdev, dev_spec_op))(pdev, gxdso_pattern_shading_area, NULL, 0) == 0) { gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - const gs_shading_t *psh = pinst->template.Shading; + const gs_shading_t *psh = pinst->templat.Shading; gs_fixed_point p, q; if (is_xxyy(&ctm_only(pinst->saved))) @@ -418,7 +418,7 @@ gx_dc_pattern2_get_color_space(const gx_device_color * pdevc) { gs_pattern2_instance_t *pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - const gs_shading_t *psh = pinst->template.Shading; + const gs_shading_t *psh = pinst->templat.Shading; return psh->params.ColorSpace; } @@ -432,7 +432,7 @@ gx_dc_pattern2_can_overlap(const gx_device_color *pdevc) if (pdevc->type != &gx_dc_pattern2) return false; pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - switch (pinst->template.Shading->head.type) { + switch (pinst->templat.Shading->head.type) { case 3: case 6: case 7: return true; default: @@ -449,6 +449,6 @@ bool gx_dc_pattern2_has_background(const gx_device_color *pdevc) if (pdevc->type != &gx_dc_pattern2) return false; pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern; - Shading = pinst->template.Shading; + Shading = pinst->templat.Shading; return !pinst->shfill && Shading->params.Background != NULL; } diff --git a/gs/base/gsptype2.h b/gs/base/gsptype2.h index 2847cb0fb..4ab4af54f 100644 --- a/gs/base/gsptype2.h +++ b/gs/base/gsptype2.h @@ -51,7 +51,7 @@ typedef struct gx_device_color_s gx_device_color; typedef struct gs_pattern2_instance_s { gs_pattern_instance_common; - gs_pattern2_template_t template; + gs_pattern2_template_t templat; bool shfill; } gs_pattern2_instance_t; diff --git a/gs/base/gstrans.c b/gs/base/gstrans.c index 157728a89..6c96b06d1 100644 --- a/gs/base/gstrans.c +++ b/gs/base/gstrans.c @@ -168,7 +168,7 @@ check_for_nontrans_pattern(gs_state *pgs, unsigned char *comp_name) gx_device_clist_writer *clwdev = (gx_device_clist_writer*) dev; const gs_pattern1_instance_t *pinst = clwdev->pinst; - if (!(pinst->template.uses_transparency)) { + if (!(pinst->templat.uses_transparency)) { if_debug1('v', "[v]%s NOT sending in pattern\n",comp_name); return(1); @@ -178,7 +178,7 @@ check_for_nontrans_pattern(gs_state *pgs, unsigned char *comp_name) gx_device_pattern_accum *padev = (gx_device_pattern_accum*) dev; const gs_pattern1_instance_t *pinst = padev->instance; - if (!(pinst->template.uses_transparency)) { + if (!(pinst->templat.uses_transparency)) { if_debug1('v', "[v]%s NOT sending in pattern\n",comp_name); return(1); diff --git a/gs/base/gxclbits.c b/gs/base/gxclbits.c index 98a295607..9af0c306f 100644 --- a/gs/base/gxclbits.c +++ b/gs/base/gxclbits.c @@ -77,12 +77,12 @@ cmd_compress_bitmap(stream_state * st, const byte * data, uint width_bits, r.ptr = data - 1; if (raster == width_bytes) { r.limit = r.ptr + raster * height; - status = (*st->template->process) (st, &r, pw, true); + status = (*st->templat->process) (st, &r, pw, true); } else { /* Compress row-by-row. */ uint y; for (y = 1; (r.limit = r.ptr + width_bytes), y < height; ++y) { - status = (*st->template->process) (st, &r, pw, false); + status = (*st->templat->process) (st, &r, pw, false); if (status) break; if (r.ptr != r.limit) { /* We don't attempt to handle compressors that */ @@ -93,10 +93,10 @@ cmd_compress_bitmap(stream_state * st, const byte * data, uint width_bits, r.ptr += raster - width_bytes; } if (status == 0) - status = (*st->template->process) (st, &r, pw, true); + status = (*st->templat->process) (st, &r, pw, true); } - if (st->template->release) - (*st->template->release) (st); + if (st->templat->release) + (*st->templat->release) (st); return status; } diff --git a/gs/base/gxcllzw.c b/gs/base/gxcllzw.c index 3fffd0cf9..b555d5034 100644 --- a/gs/base/gxcllzw.c +++ b/gs/base/gxcllzw.c @@ -33,11 +33,11 @@ void clist_compressor_init(stream_state *state) { s_LZW_set_defaults(state); - state->template = &s_LZWE_template; + state->templat = &s_LZWE_template; } void clist_decompressor_init(stream_state *state) { s_LZW_set_defaults(state); - state->template = &s_LZWD_template; + state->templat = &s_LZWD_template; } diff --git a/gs/base/gxclmem.c b/gs/base/gxclmem.c index dbc1ba5bb..2b8facbe2 100644 --- a/gs/base/gxclmem.c +++ b/gs/base/gxclmem.c @@ -460,10 +460,10 @@ memfile_fclose(clist_file_ptr cf, const char *fname, bool delete) /* Free any internal compressor state. */ if (f->compressor_initialized) { - if (f->decompress_state->template->release != 0) - (*f->decompress_state->template->release) (f->decompress_state); - if (f->compress_state->template->release != 0) - (*f->compress_state->template->release) (f->compress_state); + if (f->decompress_state->templat->release != 0) + (*f->decompress_state->templat->release) (f->decompress_state); + if (f->compress_state->templat->release != 0) + (*f->compress_state->templat->release) (f->compress_state); f->compressor_initialized = false; } /* free the raw buffers */ @@ -617,13 +617,13 @@ compress_log_blk(MEMFILE * f, LOG_MEMFILE_BLK * bp) bp->phys_blk = f->phys_curr; bp->phys_pdata = (char *)(f->wt.ptr) + 1; - if (f->compress_state->template->reinit != 0) - (*f->compress_state->template->reinit)(f->compress_state); + if (f->compress_state->templat->reinit != 0) + (*f->compress_state->templat->reinit)(f->compress_state); compressed_size = 0; start_ptr = f->wt.ptr; - status = (*f->compress_state->template->process)(f->compress_state, - &(f->rd), &(f->wt), true); + status = (*f->compress_state->templat->process)(f->compress_state, + &(f->rd), &(f->wt), true); bp->phys_blk->data_limit = (char *)(f->wt.ptr); if (status == 1) { /* More output space needed (see strimpl.h) */ @@ -643,8 +643,8 @@ compress_log_blk(MEMFILE * f, LOG_MEMFILE_BLK * bp) start_ptr = f->wt.ptr; status = - (*f->compress_state->template->process)(f->compress_state, - &(f->rd), &(f->wt), true); + (*f->compress_state->templat->process)(f->compress_state, + &(f->rd), &(f->wt), true); if (status != 0) { /* * You'd think the above line is a bug, but in real life 1 src @@ -711,8 +711,8 @@ memfile_next_blk(MEMFILE * f) if (!f->compressor_initialized) { int code = 0; - if (f->compress_state->template->init != 0) - code = (*f->compress_state->template->init) (f->compress_state); + if (f->compress_state->templat->init != 0) + code = (*f->compress_state->templat->init) (f->compress_state); if (code < 0) return_error(gs_error_VMerror); /****** BOGUS ******/ f->compressor_initialized = true; @@ -890,8 +890,8 @@ memfile_get_pdata(MEMFILE * f) num_raw_buffers = i + 1; /* if MALLOC failed, then OK */ if_debug1(':', "[:]Number of raw buffers allocated=%d\n", num_raw_buffers); - if (f->decompress_state->template->init != 0) - code = (*f->decompress_state->template->init) + if (f->decompress_state->templat->init != 0) + code = (*f->decompress_state->templat->init) (f->decompress_state); if (code < 0) return_error(gs_error_VMerror); @@ -921,8 +921,8 @@ memfile_get_pdata(MEMFILE * f) /* Decompress the data into this raw block */ /* Initialize the decompressor */ - if (f->decompress_state->template->reinit != 0) - (*f->decompress_state->template->reinit) (f->decompress_state); + if (f->decompress_state->templat->reinit != 0) + (*f->decompress_state->templat->reinit) (f->decompress_state); /* Set pointers and call the decompress routine */ f->wt.ptr = (byte *) (f->raw_head->data) - 1; f->wt.limit = f->wt.ptr + MEMFILE_DATA_SIZE; @@ -934,7 +934,7 @@ memfile_get_pdata(MEMFILE * f) decomp_rd_ptr0 = f->rd.ptr; decomp_rd_limit0 = f->rd.limit; #endif - status = (*f->decompress_state->template->process) + status = (*f->decompress_state->templat->process) (f->decompress_state, &(f->rd), &(f->wt), true); if (status == 0) { /* More input data needed */ /* switch to next block and continue decompress */ @@ -954,7 +954,7 @@ memfile_get_pdata(MEMFILE * f) decomp_rd_ptr1 = f->rd.ptr; decomp_rd_limit1 = f->rd.limit; #endif - status = (*f->decompress_state->template->process) + status = (*f->decompress_state->templat->process) (f->decompress_state, &(f->rd), &(f->wt), true); if (status == 0) { emprintf(f->memory, @@ -1180,10 +1180,10 @@ memfile_free_mem(MEMFILE * f) /* Free any internal compressor state. */ if (f->compressor_initialized) { - if (f->decompress_state->template->release != 0) - (*f->decompress_state->template->release) (f->decompress_state); - if (f->compress_state->template->release != 0) - (*f->compress_state->template->release) (f->compress_state); + if (f->decompress_state->templat->release != 0) + (*f->decompress_state->templat->release) (f->decompress_state); + if (f->compress_state->templat->release != 0) + (*f->compress_state->templat->release) (f->compress_state); f->compressor_initialized = false; } /* free the raw buffers */ diff --git a/gs/base/gxclzlib.c b/gs/base/gxclzlib.c index 892ffb183..0e3ede494 100644 --- a/gs/base/gxclzlib.c +++ b/gs/base/gxclzlib.c @@ -36,12 +36,12 @@ clist_compressor_init(stream_state *state) { s_zlib_set_defaults(state); ((stream_zlib_state *)state)->no_wrapper = true; - state->template = &s_zlibE_template; + state->templat = &s_zlibE_template; } void clist_decompressor_init(stream_state *state) { s_zlib_set_defaults(state); ((stream_zlib_state *)state)->no_wrapper = true; - state->template = &s_zlibD_template; + state->templat = &s_zlibD_template; } diff --git a/gs/base/gxcolor2.h b/gs/base/gxcolor2.h index 64ff8546a..561a64411 100644 --- a/gs/base/gxcolor2.h +++ b/gs/base/gxcolor2.h @@ -70,7 +70,7 @@ typedef struct gs_pattern1_instance_s gs_pattern1_instance_t; struct gs_pattern1_instance_s { gs_pattern_instance_common; /* must be first */ - gs_pattern1_template_t template; + gs_pattern1_template_t templat; /* Following are created by makepattern */ gs_matrix step_matrix; /* tiling space -> device space */ gs_rect bbox; /* bbox of tile in tiling space */ diff --git a/gs/base/gxidata.c b/gs/base/gxidata.c index 81e7c7d0c..67b8cc2a1 100644 --- a/gs/base/gxidata.c +++ b/gs/base/gxidata.c @@ -460,7 +460,7 @@ gx_image1_end_image(gx_image_enum_common_t * info, bool draw_last) gs_free_object(mem, penum->clip_dev, "image clipper"); if (scaler != 0) { - (*scaler->template->release) ((stream_state *) scaler); + (*scaler->templat->release) ((stream_state *) scaler); gs_free_object(mem, scaler, "image scaler state"); } if (penum->icc_link != NULL) { diff --git a/gs/base/gxiscale.c b/gs/base/gxiscale.c index 304cdd817..8264600f9 100644 --- a/gs/base/gxiscale.c +++ b/gs/base/gxiscale.c @@ -70,7 +70,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum) gs_memory_t *mem = penum->memory; stream_image_scale_params_t iss; stream_image_scale_state *pss; - const stream_template *template; + const stream_template *templat; byte *line; const gs_color_space *pcs = penum->pcs; gs_point dst_xy; @@ -224,9 +224,9 @@ gs_image_class_0_interpolate(gx_image_enum * penum) /* Size to allocate space to store the input as frac type */ } #ifdef USE_MITCHELL_FILTER - template = &s_IScale_template; + templat = &s_IScale_template; #else - template = &s_IIEncode_template; + templat = &s_IIEncode_template; #endif if (((penum->dev->color_info.num_components == 1 && penum->dev->color_info.max_gray < 15) || @@ -243,7 +243,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum) to a dithered device. The point of this non-linear downsampling is to preserve dark pixels from the source image to avoid dropout. The color polarity is used for this */ - template = &s_ISpecialDownScale_template; + templat = &s_ISpecialDownScale_template; } else { penum->interpolate = false; return 0; /* no interpolation / downsampling */ @@ -268,10 +268,10 @@ gs_image_class_0_interpolate(gx_image_enum * penum) "image scale src+dst line"); } pss = (stream_image_scale_state *) - s_alloc_state(mem, template->stype, "image scale state"); + s_alloc_state(mem, templat->stype, "image scale state"); if (line == 0 || pss == 0 || - (pss->params = iss, pss->template = template, - (*pss->template->init) ((stream_state *) pss) < 0) + (pss->params = iss, pss->templat = templat, + (*pss->templat->init) ((stream_state *) pss) < 0) ) { gs_free_object(mem, pss, "image scale state"); gs_free_object(mem, line, "image scale src+dst line"); @@ -648,7 +648,7 @@ image_render_interpolate(gx_image_enum * penum, const byte * buffer, stream_w.ptr = stream_w.limit - width * spp_decode * sizeofPixelOut; psrc = (const frac *)(stream_w.ptr + 1); /* This is where the rescale takes place */ - status = (*pss->template->process) + status = (*pss->templat->process) ((stream_state *) pss, &stream_r, &stream_w, h == 0); if (status < 0 && status != EOFC) return_error(gs_error_ioerror); @@ -887,7 +887,7 @@ image_render_interpolate_icc(gx_image_enum * penum, const byte * buffer, stream_w.ptr = stream_w.limit - width * spp_interp * sizeofPixelOut; pinterp = (const unsigned short *)(stream_w.ptr + 1); /* This is where the rescale takes place */ - status = (*pss->template->process) + status = (*pss->templat->process) ((stream_state *) pss, &stream_r, &stream_w, h == 0); if (status < 0 && status != EOFC) return_error(gs_error_ioerror); diff --git a/gs/base/gxpcmap.c b/gs/base/gxpcmap.c index 3fe4936e0..5b73096cb 100644 --- a/gs/base/gxpcmap.c +++ b/gs/base/gxpcmap.c @@ -211,11 +211,11 @@ static int gx_pattern_size_estimate(gs_pattern1_instance_t *pinst, int has_tags) { gx_device *tdev = pinst->saved->device; - int depth = (pinst->template.PaintType == 2 ? 1 : tdev->color_info.depth); + int depth = (pinst->templat.PaintType == 2 ? 1 : tdev->color_info.depth); int64_t raster; int64_t size; - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { raster = (pinst->size.x * ((depth/8) + 1 + has_tags)); size = raster > max_int / pinst->size.y ? (max_int & ~0xFFFF) : raster * pinst->size.y; } else { @@ -274,7 +274,7 @@ gx_pattern_accum_alloc(gs_memory_t * mem, gs_memory_t * storage_memory, gxdso_pattern_can_accum, pinst, 0) == 1) force_no_clist = 1; /* Set only for first time through */ if (force_no_clist || (size < max_pattern_bitmap && !pinst->is_clist) - || pinst->template.PaintType != 1 ) { + || pinst->templat.PaintType != 1 ) { gx_device_pattern_accum *adev = gs_alloc_struct(mem, gx_device_pattern_accum, &st_device_pattern_accum, cname); if (adev == 0) @@ -364,7 +364,7 @@ gx_pattern_accum_alloc(gs_memory_t * mem, gs_memory_t * storage_memory, cwdev->data = data; cwdev->data_size = data_size; cwdev->buf_procs = buf_procs; - if ( pinst->template.uses_transparency) { + if ( pinst->templat.uses_transparency) { cwdev->band_params.page_uses_transparency = true; cwdev->page_uses_transparency = true; } else { @@ -431,7 +431,7 @@ pattern_accum_open(gx_device * dev) padev->color_info = target->color_info; /* Bug 689737: If PaintType == 2 (Uncolored tiling pattern), pattern is * 1bpp bitmap. No antialiasing in this case! */ - if (pinst->template.PaintType == 2) { + if (pinst->templat.PaintType == 2) { padev->color_info.anti_alias.text_bits = 1; padev->color_info.anti_alias.graphics_bits = 1; } @@ -439,7 +439,7 @@ pattern_accum_open(gx_device * dev) now so that the mem device allocates the proper buffer space for the pattern template. We can do this since the transparency code all */ - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { /* Allocate structure that we will use for the trans pattern */ padev->transbuff = gs_alloc_struct(mem,gx_pattern_trans_t,&st_pattern_trans,"pattern_accum_open(trans)"); padev->transbuff->transbytes = NULL; @@ -471,7 +471,7 @@ pattern_accum_open(gx_device * dev) } if (code >= 0) { - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { /* In this case, we will grab the buffer created by the graphic state's device (which is pdf14) and we will be tiling that into a transparency group buffer @@ -480,7 +480,7 @@ pattern_accum_open(gx_device * dev) best just to keep the data in that form */ gx_device_set_target((gx_device_forward *)padev, target); } else { - switch (pinst->template.PaintType) { + switch (pinst->templat.PaintType) { case 2: /* uncolored */ gx_device_set_target((gx_device_forward *)padev, target); break; @@ -678,7 +678,7 @@ pattern_accum_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, return (*dev_proc(padev->target, get_bits_rectangle)) (padev->target, prect, params, unread); - if (pinst->template.PaintType == 2) + if (pinst->templat.PaintType == 2) return 0; else return_error(gs_error_Fatal); /* shouldn't happen */ @@ -971,8 +971,8 @@ gx_pattern_cache_add_entry(gs_imager_state * pis, ctile->id = id; ctile->is_planar = pinst->is_planar; ctile->depth = fdev->color_info.depth; - ctile->uid = pinst->template.uid; - ctile->tiling_type = pinst->template.TilingType; + ctile->uid = pinst->templat.uid; + ctile->tiling_type = pinst->templat.TilingType; ctile->step_matrix = pinst->step_matrix; ctile->bbox = pinst->bbox; ctile->is_simple = pinst->is_simple; @@ -1070,8 +1070,8 @@ gx_pattern_cache_add_dummy_entry(gs_imager_state *pis, gx_pattern_cache_free_entry(pcache, ctile); ctile->id = id; ctile->depth = depth; - ctile->uid = pinst->template.uid; - ctile->tiling_type = pinst->template.TilingType; + ctile->uid = pinst->templat.uid; + ctile->tiling_type = pinst->templat.TilingType; ctile->step_matrix = pinst->step_matrix; ctile->bbox = pinst->bbox; ctile->is_simple = pinst->is_simple; @@ -1293,7 +1293,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis, if (saved->pattern_cache == 0) saved->pattern_cache = pis->pattern_cache; gs_setdevice_no_init(saved, (gx_device *)adev); - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { if_debug0('v', "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n"); if ((code = gs_push_pdf14trans_device(saved, true)) < 0) return code; @@ -1306,15 +1306,15 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis, make a similar change in zpcolor.c where much of this pattern code is duplicated to support high level stream patterns. */ - if (pinst->template.PaintType == 1) + if (pinst->templat.PaintType == 1) if ((code = gx_erase_colored_pattern(saved)) < 0) return code; } - code = (*pinst->template.PaintProc)(&pdc->ccolor, saved); + code = (*pinst->templat.PaintProc)(&pdc->ccolor, saved); if (code < 0) { gx_device_retain(saved->device, false); /* device no longer retained */ - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { dev_proc(saved->device, close_device)((gx_device *)saved->device); dev_proc(adev, close_device)((gx_device *)adev); if (pinst->is_clist == 0) @@ -1330,7 +1330,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_imager_state * pis, gs_state_free(saved); return code; } - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { /* if_debug0('v', "gx_pattern_load: popping the pdf14 compositor device from this graphics state\n"); if ((code = gs_pop_pdf14trans_device(saved, true)) < 0) return code; */ @@ -1409,7 +1409,7 @@ gs_pattern1_remap_color(const gs_client_color * pc, const gs_color_space * pcs, color_set_null_pattern(pdc); return 0; } - if (pinst->template.PaintType == 2) { /* uncolored */ + if (pinst->templat.PaintType == 2) { /* uncolored */ code = (pcs->base_space->type->remap_color) (pc, pcs->base_space, pdc, pis, dev, select); if (code < 0) diff --git a/gs/base/scommon.h b/gs/base/scommon.h index 4c2eafed7..e1280dbc1 100644 --- a/gs/base/scommon.h +++ b/gs/base/scommon.h @@ -157,7 +157,7 @@ stream_proc_report_error(s_no_report_error); */ #define STREAM_MAX_ERROR_STRING 79 #define stream_state_common\ - const stream_template *template;\ + const stream_template *templat;\ gs_memory_t *memory;\ stream_proc_report_error((*report_error));\ int min_left; /* required bytes for lookahead */ \ diff --git a/gs/base/sdct.h b/gs/base/sdct.h index 50141f166..bc20ccab2 100644 --- a/gs/base/sdct.h +++ b/gs/base/sdct.h @@ -45,7 +45,7 @@ struct jpeg_block_s { #define jpeg_stream_data_common\ /* We put a copy of the stream template here, because */\ /* the minimum buffer sizes depend on the image parameters. */\ - stream_template template;\ + stream_template templat;\ struct jpeg_error_mgr err;\ gsfix_jmp_buf exit_jmpbuf;\ gs_memory_t *memory; /* heap for library allocations */\ diff --git a/gs/base/sdctd.c b/gs/base/sdctd.c index 5feb49bfd..69aea78cc 100644 --- a/gs/base/sdctd.c +++ b/gs/base/sdctd.c @@ -220,8 +220,8 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr, if_debug4('w', "[wdd]width=%u, components=%d, scan_line_size=%u, min_out_size=%u\n", jddp->dinfo.output_width, jddp->dinfo.output_components, - ss->scan_line_size, jddp->template.min_out_size); - if (ss->scan_line_size > (uint) jddp->template.min_out_size) { + ss->scan_line_size, jddp->templat.min_out_size); + if (ss->scan_line_size > (uint) jddp->templat.min_out_size) { /* Create a spare buffer for oversize scanline */ jddp->scanline_buffer = gs_alloc_bytes_immovable(gs_memory_stable(jddp->memory), @@ -284,7 +284,7 @@ s_DCTD_process(stream_state * st, stream_cursor_read * pr, * a local buffer and copy the data into it. The local * buffer can be grown as required. */ if ((src->next_input_byte-1 == pr->ptr) && - (pr->limit - pr->ptr >= ss->template->min_in_size) && + (pr->limit - pr->ptr >= ss->templat->min_in_size) && (compact_jpeg_buffer(pr) == 0)) return ERRC; return 0; /* need more data */ @@ -327,7 +327,7 @@ s_DCTD_release(stream_state * st) gs_free_object(ss->data.common->memory, ss->data.decompress, "s_DCTD_release"); /* Switch the template pointer back in case we still need it. */ - st->template = &s_DCTD_template; + st->templat = &s_DCTD_template; } /* Stream template */ diff --git a/gs/base/sdcte.c b/gs/base/sdcte.c index eea872b7b..c3c509689 100644 --- a/gs/base/sdcte.c +++ b/gs/base/sdcte.c @@ -205,7 +205,7 @@ s_DCTE_release(stream_state * st) gs_free_object(ss->data.common->memory, ss->data.compress, "s_DCTE_release"); /* Switch the template pointer back in case we still need it. */ - st->template = &s_DCTE_template; + st->templat = &s_DCTE_template; } /* Stream template */ diff --git a/gs/base/smd5.c b/gs/base/smd5.c index 7786fdd27..87ee47c11 100644 --- a/gs/base/smd5.c +++ b/gs/base/smd5.c @@ -68,7 +68,7 @@ s_MD5E_make_stream(gs_memory_t *mem, byte *digest, int digest_size) if (ss == NULL || s == NULL) goto err; - ss->template = &s_MD5E_template; + ss->templat = &s_MD5E_template; if (s_init_filter(s, ss, digest, digest_size, NULL) < 0) goto err; s->strm = s; @@ -112,7 +112,7 @@ s_MD5C_make_stream(gs_memory_t *mem, stream *strm) if (ss == NULL || s == NULL || buffer == NULL) goto err; - ss->template = &s_MD5C_template; + ss->templat = &s_MD5C_template; if (s_init_filter(s, ss, buffer, buffer_size, NULL) < 0) goto err; s->strm = strm; diff --git a/gs/base/spsdf.c b/gs/base/spsdf.c index 0f22a4e0c..25f649185 100644 --- a/gs/base/spsdf.c +++ b/gs/base/spsdf.c @@ -36,7 +36,7 @@ s_write_ps_string(stream * s, const byte * str, uint size, int print_ok) { uint added = 0; uint i; - const stream_template *template; + const stream_template *templat; stream_AXE_state state; stream_state *st = NULL; @@ -76,11 +76,11 @@ s_write_ps_string(stream * s, const byte * str, uint size, int print_ok) if (added < size || (print_ok & PRINT_HEX_NOT_OK)) { /* More efficient, or mandatory, to represent as PostScript string. */ - template = &s_PSSE_template; + templat = &s_PSSE_template; stream_putc(s, '('); } else { /* More efficient, and permitted, to represent as hex string. */ - template = &s_AXE_template; + templat = &s_AXE_template; st = (stream_state *) & state; s_AXE_init_inline(&state); stream_putc(s, '<'); @@ -98,7 +98,7 @@ s_write_ps_string(stream * s, const byte * str, uint size, int print_ok) do { /* One picky compiler complains if we initialize to buf - 1. */ w.ptr = buf; w.ptr--; - status = (*template->process) (st, &r, &w, true); + status = (*templat->process) (st, &r, &w, true); stream_write(s, buf, (uint) (w.ptr + 1 - buf)); } while (status == 1); diff --git a/gs/base/ssha2.c b/gs/base/ssha2.c index 20613b731..156bac053 100644 --- a/gs/base/ssha2.c +++ b/gs/base/ssha2.c @@ -68,7 +68,7 @@ s_SHA256E_make_stream(gs_memory_t *mem, byte *digest, int digest_size) if (ss == NULL || s == NULL) goto err; - ss->template = &s_SHA256E_template; + ss->templat = &s_SHA256E_template; if (s_init_filter(s, ss, digest, digest_size, NULL) < 0) goto err; s->strm = s; diff --git a/gs/base/stream.c b/gs/base/stream.c index 8f5057a40..f4becd4bc 100644 --- a/gs/base/stream.c +++ b/gs/base/stream.c @@ -126,10 +126,10 @@ s_alloc(gs_memory_t * mem, client_name_t cname) /* Allocate a stream state and initialize it minimally. */ void -s_init_state(stream_state *st, const stream_template *template, +s_init_state(stream_state *st, const stream_template *templat, gs_memory_t *mem) { - st->template = template; + st->templat = templat; st->memory = mem; st->report_error = s_no_report_error; st->min_left = 0; @@ -155,7 +155,7 @@ void s_std_init(register stream * s, byte * ptr, uint len, const stream_procs * pp, int modes) { - s->template = &s_no_template; + s->templat = &s_no_template; s->cbuf = ptr; s->srptr = s->srlimit = s->swptr = ptr - 1; s->swlimit = ptr - 1 + len; @@ -300,7 +300,7 @@ s_disable(register stream * s) /* Clear pointers for GC */ s->strm = 0; s->state = (stream_state *) s; - s->template = &s_no_template; + s->templat = &s_no_template; /* Free the file name. */ if (s->file_name.data) { gs_free_const_string(s->memory, s->file_name.data, s->file_name.size, @@ -421,7 +421,7 @@ sclose(register stream * s) return status; st = s->state; if (st != 0) { - stream_proc_release((*release)) = st->template->release; + stream_proc_release((*release)) = st->templat->release; if (release != 0) (*release) (st); if (st != (stream_state *) s && st->memory != 0) @@ -518,7 +518,7 @@ sgets(stream * s, byte * buf, uint nmax, uint * pn) if (wanted >= s->bsize >> 2 && (st = s->state) != 0 && - wanted >= st->template->min_out_size && + wanted >= st->templat->min_out_size && s->end_status == 0 && left == 0 ) { @@ -886,7 +886,7 @@ swritebuf(stream * s, stream_cursor_read * pbuf, bool last) if_debug5('s', "[s]write process 0x%lx(%s), nr=%u, nw=%u, end=%d\n", (ulong)curr, - gs_struct_type_name(curr->state->template->stype), + gs_struct_type_name(curr->state->templat->stype), (uint)(pr->limit - pr->ptr), (uint)(pw->limit - pw->ptr), end); status = curr->end_status; @@ -1147,15 +1147,15 @@ int s_init_filter(stream *fs, stream_state *fss, byte *buf, uint bsize, stream *target) { - const stream_template *template = fss->template; + const stream_template *templat = fss->templat; - if (bsize < template->min_in_size) + if (bsize < templat->min_in_size) return ERRC; s_std_init(fs, buf, bsize, &s_filter_write_procs, s_mode_write); - fs->procs.process = template->process; + fs->procs.process = templat->process; fs->state = fss; - if (template->init) { - fs->end_status = (template->init)(fss); + if (templat->init) { + fs->end_status = (templat->init)(fss); if (fs->end_status < 0) return fs->end_status; } @@ -1163,19 +1163,19 @@ s_init_filter(stream *fs, stream_state *fss, byte *buf, uint bsize, return 0; } stream * -s_add_filter(stream **ps, const stream_template *template, +s_add_filter(stream **ps, const stream_template *templat, stream_state *ss, gs_memory_t *mem) { stream *es; stream_state *ess; - uint bsize = max(template->min_in_size, 256); /* arbitrary */ + uint bsize = max(templat->min_in_size, 256); /* arbitrary */ byte *buf; /* * Ensure enough buffering. This may require adding an additional * stream. */ - if (bsize > (*ps)->bsize && template->process != s_NullE_template.process) { + if (bsize > (*ps)->bsize && templat->process != s_NullE_template.process) { stream_template null_template; null_template = s_NullE_template; @@ -1191,7 +1191,7 @@ s_add_filter(stream **ps, const stream_template *template, return 0; } ess = (ss == 0 ? (stream_state *)es : ss); - ess->template = template; + ess->templat = templat; ess->memory = mem; es->memory = mem; if (s_init_filter(es, ess, buf, bsize, *ps) < 0) diff --git a/gs/psi/fapi_ft.c b/gs/psi/fapi_ft.c index 3ef2c45b8..ac3c1b911 100644 --- a/gs/psi/fapi_ft.c +++ b/gs/psi/fapi_ft.c @@ -731,9 +731,9 @@ transform_decompose(FT_Matrix *a_transform, FT_UInt *xresp, FT_UInt *yresp, use_x = false; } - ftscale_mat.xx = (((double)(*xresp) / ((double)(use_x ? (*xresp) : (*yresp)))) * 65536); + ftscale_mat.xx = (int)(((double)(*xresp) / ((double)(use_x ? (*xresp) : (*yresp)))) * 65536); ftscale_mat.xy = ftscale_mat.yx = 0; - ftscale_mat.yy = (((double)(*yresp) / ((double)(use_x ? (*xresp) : (*yresp)))) * 65536); + ftscale_mat.yy = (int)(((double)(*yresp) / ((double)(use_x ? (*xresp) : (*yresp)))) * 65536); FT_Matrix_Multiply (&ftscale_mat, a_transform); @@ -910,10 +910,10 @@ transform_decompose(FT_Matrix *a_transform, FT_UInt *xresp, FT_UInt *yresp, } factx = facty = fact; } - ftscale_mat.xx = (FT_Fixed)(65536.0 / scalex) * factx; + ftscale_mat.xx = (FT_Fixed)((65536.0 / scalex) * factx); ftscale_mat.xy = 0; ftscale_mat.yx = 0; - ftscale_mat.yy = (FT_Fixed)(65536.0 / scaley) * facty; + ftscale_mat.yy = (FT_Fixed)((65536.0 / scaley) * facty); FT_Matrix_Multiply (a_transform, &ftscale_mat); memcpy(a_transform, &ftscale_mat, sizeof(FT_Matrix)); diff --git a/gs/psi/ifilter.h b/gs/psi/ifilter.h index b41c19423..b17b98ab4 100644 --- a/gs/psi/ifilter.h +++ b/gs/psi/ifilter.h @@ -34,7 +34,7 @@ int filter_read( /* top dictionary operand (both of which will always be popped) */ int npop, /* Template for stream */ - const stream_template * template, + const stream_template * templat, /* Initialized s_xxx_state, 0 if no separate state */ stream_state * st, /* Max of space attributes of all parameters referenced by */ @@ -42,7 +42,7 @@ int filter_read( uint space ); int filter_write(i_ctx_t *i_ctx_p, int npop, - const stream_template * template, + const stream_template * templat, stream_state * st, uint space); /* @@ -50,9 +50,9 @@ int filter_write(i_ctx_t *i_ctx_p, int npop, * an optional dictionary) or state. */ int filter_read_simple(i_ctx_t *i_ctx_p, - const stream_template * template); + const stream_template * templat); int filter_write_simple(i_ctx_t *i_ctx_p, - const stream_template * template); + const stream_template * templat); /* Mark a filter stream as temporary. */ /* See stream.h for the meaning of is_temp. */ diff --git a/gs/psi/ifrpred.h b/gs/psi/ifrpred.h index 05012e167..b37de12c4 100644 --- a/gs/psi/ifrpred.h +++ b/gs/psi/ifrpred.h @@ -19,7 +19,7 @@ /* Exported by zfdecode.c for zfzlib.c */ int filter_read_predictor(i_ctx_t *i_ctx_p, int npop, - const stream_template * template, + const stream_template * templat, stream_state * st); #endif /* ifrpred_INCLUDED */ diff --git a/gs/psi/ifwpred.h b/gs/psi/ifwpred.h index 4060e67dd..fab734960 100644 --- a/gs/psi/ifwpred.h +++ b/gs/psi/ifwpred.h @@ -19,7 +19,7 @@ /* Exported by zfilter2.c for zfzlib.c */ int filter_write_predictor(i_ctx_t *i_ctx_p, int npop, - const stream_template * template, + const stream_template * templat, stream_state * st); #endif /* ifwpred_INCLUDED */ diff --git a/gs/psi/iscan.c b/gs/psi/iscan.c index 040bf5fd8..ad6116d20 100644 --- a/gs/psi/iscan.c +++ b/gs/psi/iscan.c @@ -592,13 +592,13 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate) goto try_funny_name; case '~': s_A85D_init_inline(&sstate.s_ss.a85d); - sstate.s_ss.st.template = &s_A85D_template; + sstate.s_ss.st.templat = &s_A85D_template; goto str; } scan_putback(); } s_AXD_init_inline(&sstate.s_ss.axd); - sstate.s_ss.st.template = &s_AXD_template; + sstate.s_ss.st.templat = &s_AXD_template; str:scan_end_inline(); dynamic_init(&da, imemory); cont_string:for (;;) { @@ -606,7 +606,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate) w.ptr = da.next - 1; w.limit = da.limit - 1; - status = (*sstate.s_ss.st.template->process) + status = (*sstate.s_ss.st.templat->process) (&sstate.s_ss.st, &s->cursor.r, &w, s->end_status == EOFC); if (!check_only) @@ -664,7 +664,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate) ((pstate->s_options & SCAN_FROM_STRING) != 0) && !scan_enable_level2; s_PSSD_partially_init_inline(&sstate.s_ss.pssd); - sstate.s_ss.st.template = &s_PSSD_template; + sstate.s_ss.st.templat = &s_PSSD_template; goto str; case '{': if (pstack == 0) { /* outermost procedure */ diff --git a/gs/psi/zfapi.c b/gs/psi/zfapi.c index cd3feb071..c918548eb 100644 --- a/gs/psi/zfapi.c +++ b/gs/psi/zfapi.c @@ -1792,8 +1792,8 @@ static int fapi_image_uncached_glyph (i_ctx_t *i_ctx_p, gs_show_enum *penum, FAP return_error(e_VMerror); } - x = (floatp) (pgs->ctm.tx + (double)rast_orig_x / (1 << frac_pixel_shift) + 0.5); - y = (floatp) (pgs->ctm.ty + (double)rast_orig_y / (1 << frac_pixel_shift) + 0.5); + x = (int) (pgs->ctm.tx + (double)rast_orig_x / (1 << frac_pixel_shift) + 0.5); + y = (int) (pgs->ctm.ty + (double)rast_orig_y / (1 << frac_pixel_shift) + 0.5); w = rast->width; h = rast->height; diff --git a/gs/psi/zfdctd.c b/gs/psi/zfdctd.c index 36711b5df..9bb5870f4 100644 --- a/gs/psi/zfdctd.c +++ b/gs/psi/zfdctd.c @@ -84,8 +84,8 @@ zDCTD(i_ctx_t *i_ctx_p) if ((code = s_DCTD_put_params((gs_param_list *) & list, &state)) < 0) goto rel; /* Create the filter. */ - jddp->template = s_DCTD_template; - code = filter_read(i_ctx_p, 0, &jddp->template, + jddp->templat = s_DCTD_template; + code = filter_read(i_ctx_p, 0, &jddp->templat, (stream_state *) & state, dspace); if (code >= 0) /* Success! */ return code; diff --git a/gs/psi/zfdcte.c b/gs/psi/zfdcte.c index f74f4c86a..a20ceeb97 100644 --- a/gs/psi/zfdcte.c +++ b/gs/psi/zfdcte.c @@ -71,16 +71,16 @@ zDCTE(i_ctx_t *i_ctx_p) if ((code = s_DCTE_put_params((gs_param_list *) & list, &state)) < 0) goto rel; /* Create the filter. */ - jcdp->template = s_DCTE_template; + jcdp->templat = s_DCTE_template; /* Make sure we get at least a full scan line of input. */ state.scan_line_size = jcdp->cinfo.input_components * jcdp->cinfo.image_width; - jcdp->template.min_in_size = + jcdp->templat.min_in_size = max(s_DCTE_template.min_in_size, state.scan_line_size); /* Make sure we can write the user markers in a single go. */ - jcdp->template.min_out_size = + jcdp->templat.min_out_size = max(s_DCTE_template.min_out_size, state.Markers.size); - code = filter_write(i_ctx_p, 0, &jcdp->template, + code = filter_write(i_ctx_p, 0, &jcdp->templat, (stream_state *) & state, dspace); if (code >= 0) /* Success! */ return code; @@ -112,7 +112,7 @@ zdcteparams(i_ctx_t *i_ctx_p) check_write_file(s, op - 1); check_type(op[-2], t_dictionary); /* The DCT filters copy the template.... */ - if (s->state->template->process != s_DCTE_template.process) + if (s->state->templat->process != s_DCTE_template.process) return_error(e_rangecheck); code = dict_param_list_write(&list, op - 2, NULL, iimemory); if (code < 0) diff --git a/gs/psi/zfdecode.c b/gs/psi/zfdecode.c index 832ea8ba3..1fdf72361 100644 --- a/gs/psi/zfdecode.c +++ b/gs/psi/zfdecode.c @@ -112,7 +112,7 @@ zCFD(i_ctx_t *i_ctx_p) int filter_read_predictor(i_ctx_t *i_ctx_p, int npop, - const stream_template * template, stream_state * st) + const stream_template * templat, stream_state * st) { os_ptr op = osp; int predictor, code; @@ -147,7 +147,7 @@ filter_read_predictor(i_ctx_t *i_ctx_p, int npop, } else predictor = 1; if (predictor == 1) - return filter_read(i_ctx_p, npop, template, st, 0); + return filter_read(i_ctx_p, npop, templat, st, 0); { /* We need to cascade filters. */ ref rsource, rdict; @@ -156,7 +156,7 @@ filter_read_predictor(i_ctx_t *i_ctx_p, int npop, /* Save the operands, just in case. */ ref_assign(&rsource, op - 1); ref_assign(&rdict, op); - code = filter_read(i_ctx_p, 1, template, st, 0); + code = filter_read(i_ctx_p, 1, templat, st, 0); if (code < 0) return code; /* filter_read changed osp.... */ diff --git a/gs/psi/zfile.c b/gs/psi/zfile.c index 8d237ef92..c245eec48 100644 --- a/gs/psi/zfile.c +++ b/gs/psi/zfile.c @@ -1096,16 +1096,16 @@ filter_report_error(stream_state * st, const char *str) /* Open a file stream for a filter. */ int filter_open(const char *file_access, uint buffer_size, ref * pfile, - const stream_procs * procs, const stream_template * template, + const stream_procs * procs, const stream_template * templat, const stream_state * st, gs_memory_t *mem) { stream *s; - uint ssize = gs_struct_type_size(template->stype); + uint ssize = gs_struct_type_size(templat->stype); stream_state *sst = 0; int code; - if (template->stype != &st_stream_state) { - sst = s_alloc_state(mem, template->stype, "filter_open(stream_state)"); + if (templat->stype != &st_stream_state) { + sst = s_alloc_state(mem, templat->stype, "filter_open(stream_state)"); if (sst == 0) return_error(e_VMerror); } @@ -1117,7 +1117,7 @@ filter_open(const char *file_access, uint buffer_size, ref * pfile, } s_std_init(s, s->cbuf, s->bsize, procs, (*file_access == 'r' ? s_mode_read : s_mode_write)); - s->procs.process = template->process; + s->procs.process = templat->process; s->save_close = s->procs.close; s->procs.close = file_close_file; if (sst == 0) { @@ -1127,11 +1127,11 @@ filter_open(const char *file_access, uint buffer_size, ref * pfile, } else if (st != 0) /* might not have client parameters */ memcpy(sst, st, ssize); s->state = sst; - s_init_state(sst, template, mem); + s_init_state(sst, templat, mem); sst->report_error = filter_report_error; - if (template->init != 0) { - code = (*template->init)(sst); + if (templat->init != 0) { + code = (*templat->init)(sst); if (code < 0) { gs_free_object(mem, sst, "filter_open(stream_state)"); gs_free_object(mem, s->cbuf, "filter_open(buffer)"); diff --git a/gs/psi/zfilter.c b/gs/psi/zfilter.c index 466471288..3afdfb1a5 100644 --- a/gs/psi/zfilter.c +++ b/gs/psi/zfilter.c @@ -175,11 +175,11 @@ static int filter_ensure_buf(stream **, uint, gs_ref_memory_t *, bool, int ); /* Set up an input filter. */ int -filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * template, +filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * templat, stream_state * st, uint space) { os_ptr op = osp; - uint min_size = template->min_out_size + max_min_left; + uint min_size = templat->min_out_size + max_min_left; uint save_space = ialloc_space(idmemory); /* PLRM3 requires the following, *not* max(space, save_space). */ uint use_space = max(space, avm_system); /* don't alloc in foreign space */ @@ -226,8 +226,8 @@ filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * template, sstrm->is_temp = 2; ens: code = filter_ensure_buf(&sstrm, - template->min_in_size + - sstrm->state->template->min_out_size, + templat->min_in_size + + sstrm->state->templat->min_out_size, iimemory, false, close); if (code < 0) goto out; @@ -236,7 +236,7 @@ filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * template, if (min_size < 128) min_size = file_default_buffer_size; code = filter_open("r", min_size, (ref *) sop, - &s_filter_read_procs, template, st, imemory); + &s_filter_read_procs, templat, st, imemory); if (code < 0) goto out; s = fptr(sop); @@ -248,18 +248,18 @@ out: return code; } int -filter_read_simple(i_ctx_t *i_ctx_p, const stream_template * template) +filter_read_simple(i_ctx_t *i_ctx_p, const stream_template * templat) { - return filter_read(i_ctx_p, 0, template, NULL, 0); + return filter_read(i_ctx_p, 0, templat, NULL, 0); } /* Set up an output filter. */ int -filter_write(i_ctx_t *i_ctx_p, int npop, const stream_template * template, +filter_write(i_ctx_t *i_ctx_p, int npop, const stream_template * templat, stream_state * st, uint space) { os_ptr op = osp; - uint min_size = template->min_in_size + max_min_left; + uint min_size = templat->min_in_size + max_min_left; uint save_space = ialloc_space(idmemory); /* PLRM3 requires the following, *not* max(space, save_space). */ uint use_space = max(space, avm_system); /* don't alloc in foreign space */ @@ -306,8 +306,8 @@ filter_write(i_ctx_t *i_ctx_p, int npop, const stream_template * template, sstrm->is_temp = 2; ens: code = filter_ensure_buf(&sstrm, - template->min_out_size + - sstrm->state->template->min_in_size, + templat->min_out_size + + sstrm->state->templat->min_in_size, iimemory, true, close); if (code < 0) goto out; @@ -316,7 +316,7 @@ filter_write(i_ctx_t *i_ctx_p, int npop, const stream_template * template, if (min_size < 128) min_size = file_default_buffer_size; code = filter_open("w", min_size, (ref *) sop, - &s_filter_write_procs, template, st, imemory); + &s_filter_write_procs, templat, st, imemory); if (code < 0) goto out; s = fptr(sop); @@ -328,9 +328,9 @@ out: return code; } int -filter_write_simple(i_ctx_t *i_ctx_p, const stream_template * template) +filter_write_simple(i_ctx_t *i_ctx_p, const stream_template * templat) { - return filter_write(i_ctx_p, 0, template, NULL, 0); + return filter_write(i_ctx_p, 0, templat, NULL, 0); } /* Define a byte-at-a-time NullDecode filter for intermediate buffers. */ diff --git a/gs/psi/zfilter2.c b/gs/psi/zfilter2.c index 8179cbbd5..fd5954554 100644 --- a/gs/psi/zfilter2.c +++ b/gs/psi/zfilter2.c @@ -53,7 +53,7 @@ zCFE(i_ctx_t *i_ctx_p) int filter_write_predictor(i_ctx_t *i_ctx_p, int npop, - const stream_template * template, stream_state * st) + const stream_template * templat, stream_state * st) { os_ptr op = osp; int predictor, code; @@ -88,7 +88,7 @@ filter_write_predictor(i_ctx_t *i_ctx_p, int npop, } else predictor = 1; if (predictor == 1) - return filter_write(i_ctx_p, npop, template, st, 0); + return filter_write(i_ctx_p, npop, templat, st, 0); { /* We need to cascade filters. */ ref rtarget, rdict; @@ -97,7 +97,7 @@ filter_write_predictor(i_ctx_t *i_ctx_p, int npop, /* Save the operands, just in case. */ ref_assign(&rtarget, op - 1); ref_assign(&rdict, op); - code = filter_write(i_ctx_p, npop, template, st, 0); + code = filter_write(i_ctx_p, npop, templat, st, 0); if (code < 0) return code; /* filter_write changed osp.... */ diff --git a/gs/psi/zfproc.c b/gs/psi/zfproc.c index 9b9124907..314659f63 100644 --- a/gs/psi/zfproc.c +++ b/gs/psi/zfproc.c @@ -74,7 +74,7 @@ s_proc_init(ref * sop, stream ** psstrm, uint mode, } s_std_init(sstrm, NULL, 0, procs, mode); sstrm->procs.process = temp->process; - state->template = temp; + state->templat = temp; state->memory = mem; state->eof = 0; state->proc = *sop; diff --git a/gs/psi/zfrsd.c b/gs/psi/zfrsd.c index 09890b4c2..d11873168 100644 --- a/gs/psi/zfrsd.c +++ b/gs/psi/zfrsd.c @@ -198,7 +198,7 @@ rs: if (~s->modes & (s_mode_read | s_mode_seek)) return_error(e_ioerror); code = make_rfs(i_ctx_p, source_op, s, offset + stell(s), length); - } else if (s->state->template == &s_SFD_template) { + } else if (s->state->templat == &s_SFD_template) { /* SubFileDecode filter */ const stream_SFD_state *const sfd_state = (const stream_SFD_state *)s->state; @@ -359,7 +359,7 @@ make_aos(i_ctx_t *i_ctx_p, os_ptr op, int blk_sz, int blk_sz_last, uint file_sz) return_error(e_VMerror); } ialloc_set_space(idmemory, save_space); - ss->template = &s_aos_template; + ss->templat = &s_aos_template; ss->blocks = *op; ss->s = s; ss->blk_sz = blk_sz; diff --git a/gs/psi/zmisc1.c b/gs/psi/zmisc1.c index 3ee8d301e..bdca0c99f 100644 --- a/gs/psi/zmisc1.c +++ b/gs/psi/zmisc1.c @@ -135,7 +135,7 @@ zexD(i_ctx_t *i_ctx_p) if (r_has_type(op - 1, t_file)) { stream *s = (op - 1)->value.pfile; - if (s->state != 0 && s->state->template == &s_PFBD_template) { + if (s->state != 0 && s->state->templat == &s_PFBD_template) { stream_PFBD_state *pss = (stream_PFBD_state *)s->state; state.pfb_state = pss; diff --git a/gs/psi/zpcolor.c b/gs/psi/zpcolor.c index 514a7d808..9e472cd46 100644 --- a/gs/psi/zpcolor.c +++ b/gs/psi/zpcolor.c @@ -86,7 +86,7 @@ zbuildpattern1(i_ctx_t *i_ctx_p) int code; gs_matrix mat; float BBox[4]; - gs_client_pattern template; + gs_client_pattern templat; int_pattern *pdata; gs_client_color cc_instance; ref *pPaintProc; @@ -96,23 +96,23 @@ zbuildpattern1(i_ctx_t *i_ctx_p) return code; check_type(*op1, t_dictionary); check_dict_read(*op1); - gs_pattern1_init(&template); + gs_pattern1_init(&templat); - code = dict_uid_param(op1, &template.uid, 1, imemory, i_ctx_p); + code = dict_uid_param(op1, &templat.uid, 1, imemory, i_ctx_p); if (code < 0) return code; if (code != 1) return_error(e_rangecheck); - code = dict_int_param(op1, "PaintType", 1, 2, 0, &template.PaintType); + code = dict_int_param(op1, "PaintType", 1, 2, 0, &templat.PaintType); if (code < 0) return code; - code = dict_int_param(op1, "TilingType", 1, 3, 0, &template.TilingType); + code = dict_int_param(op1, "TilingType", 1, 3, 0, &templat.TilingType); if (code < 0) return code; - code = dict_bool_param(op1, ".pattern_uses_transparency", 0, &template.uses_transparency); + code = dict_bool_param(op1, ".pattern_uses_transparency", 0, &templat.uses_transparency); if (code < 0) return code; @@ -122,13 +122,13 @@ zbuildpattern1(i_ctx_t *i_ctx_p) if (code == 0) return_error(e_undefined); - code = dict_float_param(op1, "XStep", 0.0, &template.XStep); + code = dict_float_param(op1, "XStep", 0.0, &templat.XStep); if (code < 0) return code; if (code == 1) return_error(e_undefined); - code = dict_float_param(op1, "YStep", 0.0, &template.YStep); + code = dict_float_param(op1, "YStep", 0.0, &templat.YStep); if (code < 0) return code; if (code == 1) @@ -147,16 +147,16 @@ zbuildpattern1(i_ctx_t *i_ctx_p) if (BBox[0] >= BBox[2] || BBox[1] >= BBox[3]) return_error(e_rangecheck); - template.BBox.p.x = BBox[0]; - template.BBox.p.y = BBox[1]; - template.BBox.q.x = BBox[2]; - template.BBox.q.y = BBox[3]; - template.PaintProc = zPaintProc; + templat.BBox.p.x = BBox[0]; + templat.BBox.p.y = BBox[1]; + templat.BBox.q.x = BBox[2]; + templat.BBox.q.y = BBox[3]; + templat.PaintProc = zPaintProc; code = int_pattern_alloc(&pdata, op1, imemory); if (code < 0) return code; - template.client_data = pdata; - code = gs_makepattern(&cc_instance, &template, &mat, igs, imemory); + templat.client_data = pdata; + code = gs_makepattern(&cc_instance, &templat, &mat, igs, imemory); if (code < 0) { ifree_object(pdata, "int_pattern"); return code; @@ -196,7 +196,7 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p) gs_state *pgs = igs; gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)gs_currentcolor(pgs)->pattern; - ref *pdict = &((int_pattern *) pinst->template.client_data)->dict; + ref *pdict = &((int_pattern *) pinst->templat.client_data)->dict; gx_device_forward *pdev = NULL; gx_device *cdev = gs_currentdevice_inline(igs); int code; @@ -239,12 +239,12 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p) /* gx_set_device_only(pgs, (gx_device *) pdev); */ if (internal_accum) { gs_setdevice_no_init(pgs, (gx_device *)pdev); - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { if_debug0('v', " pushing the pdf14 compositor device into this graphics state\n"); if ((code = gs_push_pdf14trans_device(pgs, true)) < 0) return code; } else { /* not transparent */ - if (pinst->template.PaintType == 1) + if (pinst->templat.PaintType == 1) if ((code = gx_erase_colored_pattern(pgs)) < 0) return code; } @@ -255,7 +255,7 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p) dev_proc(pgs->device, get_initial_matrix)(pgs->device, &m); gs_setmatrix(igs, &m); - code = gs_bbox_transform(&pinst->template.BBox, &ctm_only(pgs), &bbox); + code = gs_bbox_transform(&pinst->templat.BBox, &ctm_only(pgs), &bbox); if (code < 0) { gs_grestore(pgs); return code; @@ -301,7 +301,7 @@ pattern_paint_finish(i_ctx_t *i_ctx_p) if (pdev != NULL) { gx_color_tile *ctile; int code; - if (pinst->template.uses_transparency) { + if (pinst->templat.uses_transparency) { gs_state *pgs = igs; int code; diff --git a/gs/psi/zshade.c b/gs/psi/zshade.c index bd28f2818..1ee9e6696 100644 --- a/gs/psi/zshade.c +++ b/gs/psi/zshade.c @@ -90,23 +90,23 @@ zbuildshadingpattern(i_ctx_t *i_ctx_p) os_ptr op = osp; os_ptr op2 = op - 2; gs_matrix mat; - gs_pattern2_template_t template; + gs_pattern2_template_t templat; int_pattern *pdata; gs_client_color cc_instance; int code; check_type(*op2, t_dictionary); check_dict_read(*op2); - gs_pattern2_init(&template); + gs_pattern2_init(&templat); if ((code = read_matrix(imemory, op - 1, &mat)) < 0 || - (code = dict_uid_param(op2, &template.uid, 1, imemory, i_ctx_p)) != 1 || - (code = shading_param(op, &template.Shading)) < 0 || + (code = dict_uid_param(op2, &templat.uid, 1, imemory, i_ctx_p)) != 1 || + (code = shading_param(op, &templat.Shading)) < 0 || (code = int_pattern_alloc(&pdata, op2, imemory)) < 0 ) return_error((code < 0 ? code : e_rangecheck)); - template.client_data = pdata; + templat.client_data = pdata; code = gs_make_pattern(&cc_instance, - (const gs_pattern_template_t *)&template, + (const gs_pattern_template_t *)&templat, &mat, igs, imemory); if (code < 0) { ifree_object(pdata, "int_pattern"); diff --git a/pxl/pximage.c b/pxl/pximage.c index 1a1ce241c..40656454f 100644 --- a/pxl/pximage.c +++ b/pxl/pximage.c @@ -193,7 +193,7 @@ read_jpeg_bitmap_data(px_bitmap_enum_t *benum, byte **pdata, px_args_t *par) jpeg_decompress_data *jddp = &(benum->jdd); /* use the graphics library support for DCT streams */ ss->memory = benum->mem; - ss->template = &s_DCTD_template; + ss->templat = &s_DCTD_template; s_DCTD_template.set_defaults((stream_state *)ss); ss->report_error = stream_error; ss->data.decompress = jddp; @@ -204,7 +204,7 @@ read_jpeg_bitmap_data(px_bitmap_enum_t *benum, byte **pdata, px_args_t *par) if ( gs_jpeg_create_decompress(ss) < 0 ) return_error(errorInsufficientMemory); (*s_DCTD_template.init)((stream_state *)ss); - jddp->template = s_DCTD_template; + jddp->templat = s_DCTD_template; benum->initialized = true; } r.ptr = data - 1; @@ -304,7 +304,7 @@ read_rle_bitmap_data(px_bitmap_enum_t *benum, byte **pdata, px_args_t *par) if ( !benum->initialized ) { ss->EndOfData = false; - ss->template = &s_RLD_template; + ss->templat = &s_RLD_template; s_RLD_init_inline(ss); benum->initialized = true; } diff --git a/pxl/pxink.c b/pxl/pxink.c index 3aa923989..69eb136b5 100644 --- a/pxl/pxink.c +++ b/pxl/pxink.c @@ -277,7 +277,7 @@ render_pattern(gs_client_color *pcc, const px_pattern_t *pattern, uint rep_height = pattern->params.height; uint full_width, full_height; gs_state *pgs = pxs->pgs; - gs_client_pattern template; + gs_client_pattern templat; /* * If halftoning may occur, replicate the pattern so we don't get @@ -303,18 +303,18 @@ render_pattern(gs_client_color *pcc, const px_pattern_t *pattern, } } /* Construct a Pattern for the library, and render it. */ - gs_pattern1_init(&template); - uid_set_UniqueID(&template.uid, pattern->id); - template.PaintType = 1; - template.TilingType = 1; - template.BBox.p.x = 0; - template.BBox.p.y = 0; - template.BBox.q.x = full_width; - template.BBox.q.y = full_height; - template.XStep = full_width; - template.YStep = full_height; - template.PaintProc = px_paint_pattern; - template.client_data = (void *)pattern; + gs_pattern1_init(&templat); + uid_set_UniqueID(&templat.uid, pattern->id); + templat.PaintType = 1; + templat.TilingType = 1; + templat.BBox.p.x = 0; + templat.BBox.p.y = 0; + templat.BBox.q.x = full_width; + templat.BBox.q.y = full_height; + templat.XStep = full_width; + templat.YStep = full_height; + templat.PaintProc = px_paint_pattern; + templat.client_data = (void *)pattern; { gs_matrix mat; gs_point dsize; int code; @@ -381,7 +381,7 @@ render_pattern(gs_client_color *pcc, const px_pattern_t *pattern, } gs_setcolorspace(pgs, pcs); } - code = gs_makepattern(pcc, &template, &mat, pgs, NULL); + code = gs_makepattern(pcc, &templat, &mat, pgs, NULL); gs_grestore(pgs); return code; } diff --git a/xps/xpsjpeg.c b/xps/xpsjpeg.c index f5f7f0e29..3c7b8ff32 100644 --- a/xps/xpsjpeg.c +++ b/xps/xpsjpeg.c @@ -49,7 +49,7 @@ xps_decode_jpeg(xps_context_t *ctx, byte *rbuf, int rlen, xps_image_t *image) state.jpeg_memory = ctx->memory; state.data.decompress = &jddp; - jddp.template = s_DCTD_template; + jddp.templat = s_DCTD_template; jddp.memory = ctx->memory; jddp.scanline_buffer = NULL; diff --git a/xps/xpstiff.c b/xps/xpstiff.c index 7b6189548..bb0d73001 100644 --- a/xps/xpstiff.c +++ b/xps/xpstiff.c @@ -375,7 +375,7 @@ xps_decode_tiff_jpeg(xps_context_t *ctx, xps_tiff_t *tiff, byte *rp, byte *rl, b state.jpeg_memory = ctx->memory; state.data.decompress = &jddp; - jddp.template = s_DCTD_template; + jddp.templat = s_DCTD_template; jddp.memory = ctx->memory; jddp.scanline_buffer = NULL; |