diff options
author | Ralph Giles <ralph.giles@artifex.com> | 2006-09-07 00:37:18 +0000 |
---|---|---|
committer | Ralph Giles <ralph.giles@artifex.com> | 2006-09-07 00:37:18 +0000 |
commit | b71fa6e82d9df223f8aa9ef6ef7807b1a45fee76 (patch) | |
tree | 014ef529f92d95605913fb66b52483b6bf9ab8bd /pcl | |
parent | 71f00fabef54048d9bc0d6ef725e5884098eabac (diff) |
Merge the gs853merge branch down into the trunk. This ports ghostpcl and
ghostxps to build against a branch of ghostscript close it its current
mainline (around r7000) between Ghostscript 8.54 and 8.55.
This mostly consists of removing the memory pointers from many calls as
well as a few other api changes, as well as some makefile updates, which
were skewed between the branches.
Nevertheless this is a big merge and there are likely to be a few
mistakes. The previous trunk is tagged as /tags/ghostpcl-pre855merge
for comparision.
Both pcl6 and pspcl6 build and run with the Artifex font scaler (the
native gs one). pcl6 compiles but does not link with ufst. pspcl6 does
not compile with ufst, but that's not too different from what was
happening in the branch. Fixing this will of course come next.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2566 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl')
55 files changed, 436 insertions, 467 deletions
diff --git a/pcl/pccid.c b/pcl/pccid.c index 8b41a083e..5ee054bff 100644 --- a/pcl/pccid.c +++ b/pcl/pccid.c @@ -247,7 +247,7 @@ check_cid_hdr( if (pcid->bits_per_primary[i] == 0) pcid->bits_per_primary[i] = 8; if ( pcs->personality == pcl5e && pcid->bits_per_primary[i] != 1 ) - dprintf(pcs->memory, "pcl5e personality with color primaries\n" ); + dprintf("pcl5e personality with color primaries\n" ); } @@ -541,7 +541,7 @@ pcl_cid_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'v', 'W', PCL_COMMAND("Configure Image Data", pcl_configure_image_data, pca_bytes | pca_in_rtl | pca_raster_graphics) diff --git a/pcl/pccolor.c b/pcl/pccolor.c index ad7e21cca..97c3e5fdf 100644 --- a/pcl/pccolor.c +++ b/pcl/pccolor.c @@ -121,7 +121,7 @@ color_do_registration( ) { /* Register commands */ - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'v', 'A', PCL_COMMAND( "Color Component 1", diff --git a/pcl/pccprint.c b/pcl/pccprint.c index a2d02ef6d..8e5abbf0e 100644 --- a/pcl/pccprint.c +++ b/pcl/pccprint.c @@ -78,7 +78,7 @@ pccprint_do_registration( ) { /* Register commands */ - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'l', 'O', PCL_COMMAND( "Logical Operation", diff --git a/pcl/pccrd.c b/pcl/pccrd.c index a6ee3d76c..95d6cc6dc 100644 --- a/pcl/pccrd.c +++ b/pcl/pccrd.c @@ -66,7 +66,6 @@ private const gs_matrix3 dflt_MatrixLMN = { { 3.51, -1.07, 0.06 }, */ private int dflt_TransformPQR_proc( - const gs_memory_t *mem, int cmp_indx, floatp val, const gs_cie_wbsd * cs_wbsd, @@ -101,7 +100,7 @@ free_crd( pcl_crd_t * pcrd = (pcl_crd_t *)pvcrd; if (pcrd->pgscrd != 0) - rc_decrement(pmem, pcrd->pgscrd, cname); + rc_decrement(pcrd->pgscrd, cname); gs_free_object(pmem, pvcrd, cname); } @@ -314,7 +313,7 @@ pcl_crd_set_view_illuminant( ); if (pcrd != pold) - rc_decrement(pcs->memory, pold, "pcl set viewing illuminant"); + rc_decrement(pold, "pcl set viewing illuminant"); return code; } @@ -338,7 +337,7 @@ pcl_crd_set_crd( ((code = pcl_crd_build_default_crd(pcs)) < 0) ) return code; pcrd = pcs->pcl_default_crd; - pcl_crd_init_from(pcs->memory, *ppcrd, pcrd); + pcl_crd_init_from(*ppcrd, pcrd); } /* see if there is anything to do */ @@ -346,6 +345,6 @@ pcl_crd_set_crd( return 0; if ((code = gs_setcolorrendering(pcs->pgs, pcrd->pgscrd)) >= 0) - pcl_crd_copy_from(pcs->memory, pcs->pids->pcrd, pcrd); + pcl_crd_copy_from(pcs->pids->pcrd, pcrd); return code; } diff --git a/pcl/pccrd.h b/pcl/pccrd.h index 20fb03a6a..9c922d8d5 100644 --- a/pcl/pccrd.h +++ b/pcl/pccrd.h @@ -74,23 +74,23 @@ typedef struct pcl_crd_s pcl_crd_t; /* * The usual copy, init, and release macros. */ -#define pcl_crd_init_from(mem, pto, pfrom) \ +#define pcl_crd_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_crd_copy_from(mem, pto, pfrom) \ +#define pcl_crd_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_crd_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_crd_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_crd_release(mem, pindexed) \ - rc_decrement(mem, pindexed, "pcl_crd_release") +#define pcl_crd_release(pindexed) \ + rc_decrement(pindexed, "pcl_crd_release") /* * Unlike other elements of the PCL "palette", color rendering dictionaries diff --git a/pcl/pccsbase.c b/pcl/pccsbase.c index d466ca6d3..168eb8713 100644 --- a/pcl/pccsbase.c +++ b/pcl/pccsbase.c @@ -274,14 +274,13 @@ build_client_data( * Init a client data structure from an existing client data structure. */ private void -init_client_data_from( const gs_memory_t *mem, - pcl_cs_client_data_t * pnew, +init_client_data_from( pcl_cs_client_data_t * pnew, const pcl_cs_client_data_t * pfrom ) { *pnew = *pfrom; - pcl_lookup_tbl_init_from(mem, pnew->plktbl1, pfrom->plktbl1); - pcl_lookup_tbl_init_from(mem, pnew->plktbl2, pfrom->plktbl2); + pcl_lookup_tbl_init_from(pnew->plktbl1, pfrom->plktbl1); + pcl_lookup_tbl_init_from(pnew->plktbl2, pfrom->plktbl2); } /* @@ -291,20 +290,19 @@ init_client_data_from( const gs_memory_t *mem, update_lookup_tbls( pcl_cs_client_data_t * pdata, pcl_lookup_tbl_t * plktbl1, - pcl_lookup_tbl_t * plktbl2, - gs_memory_t * pmem + pcl_lookup_tbl_t * plktbl2 ) { - pcl_lookup_tbl_copy_from(pmem, pdata->plktbl1, plktbl1); - pcl_lookup_tbl_copy_from(pmem, pdata->plktbl2, plktbl2); + pcl_lookup_tbl_copy_from(pdata->plktbl1, plktbl1); + pcl_lookup_tbl_copy_from(pdata->plktbl2, plktbl2); } /* * Free a client data structure. This releases the lookup tables, if they * are present. */ -#define free_lookup_tbls(pdata, pmem) \ - update_lookup_tbls((pdata), NULL, NULL, (pmem)) +#define free_lookup_tbls(pdata) \ + update_lookup_tbls((pdata), NULL, NULL) /* @@ -930,10 +928,10 @@ free_base_cspace( pcl_cs_base_t * pbase = (pcl_cs_base_t *)pvbase; if (pbase->pcspace != 0) { - gs_cspace_release(pmem, pbase->pcspace); + gs_cspace_release(pbase->pcspace); gs_free_object(pmem, pbase->pcspace, cname); } - free_lookup_tbls(&(pbase->client_data), pmem); + free_lookup_tbls(&(pbase->client_data)); gs_free_object(pmem, pvbase, cname); } @@ -1018,7 +1016,7 @@ unshare_base_cspace(const gs_memory_t *mem, /* check if there is anything to do */ if (pbase->rc.ref_count == 1) return 0; - rc_decrement(mem, pbase, "unshare PCL base color space"); + rc_decrement(pbase, "unshare PCL base color space"); /* allocate a new gs_color_space */ if ((code = alloc_base_cspace(ppbase, pbase->type, pbase->rc.memory)) < 0) @@ -1026,7 +1024,7 @@ unshare_base_cspace(const gs_memory_t *mem, pnew = *ppbase; /* copy the client data */ - init_client_data_from(pbase->rc.memory, &(pnew->client_data), &(pbase->client_data)); + init_client_data_from(&(pnew->client_data), &(pbase->client_data)); /* copy the color space (primarily for CIE color spaces; UGLY!!!) */ if (pbase->type > pcl_cspace_CMY) { @@ -1065,7 +1063,7 @@ pcl_cs_base_build_cspace( /* release the existing color space, if present */ if (pbase != 0) - rc_decrement(pmem, pbase, "build base pcl color space"); + rc_decrement(pbase, "build base pcl color space"); /* build basic structure and client info. structure */ if ((code = alloc_base_cspace(ppbase, type, pmem)) < 0) @@ -1099,7 +1097,7 @@ pcl_cs_base_build_white_cspace( if (pcs->pwhite_cs == 0) code = alloc_base_cspace(&pcs->pwhite_cs, pcl_cspace_White, pmem); if (code >= 0) - pcl_cs_base_copy_from(pmem, *ppbase, pcs->pwhite_cs); + pcl_cs_base_copy_from(*ppbase, pcs->pwhite_cs); return code; } @@ -1163,8 +1161,7 @@ pcl_cs_base_update_lookup_tbl( /* update the lookup table information */ update_lookup_tbls( &(pbase->client_data), plktbl1, - plktbl2, - pbase->rc.memory + plktbl2 ); return 1; diff --git a/pcl/pccsbase.h b/pcl/pccsbase.h index 61c6f16a3..3f92e85b4 100644 --- a/pcl/pccsbase.h +++ b/pcl/pccsbase.h @@ -87,23 +87,23 @@ typedef struct pcl_cs_base_s { /* * Macros to init, copy, and release PCL base color spaces. */ -#define pcl_cs_base_init_from(mem, pto, pfrom) \ +#define pcl_cs_base_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_cs_base_copy_from(mem, pto, pfrom) \ +#define pcl_cs_base_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_cs_base_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_cs_base_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_cs_base_release(mem, pbase) \ - rc_decrement(mem, pbase, "pcl_cs_base_release") +#define pcl_cs_base_release(pbase) \ + rc_decrement(pbase, "pcl_cs_base_release") /* diff --git a/pcl/pcdither.c b/pcl/pcdither.c index 185ac91e6..a78d69f78 100644 --- a/pcl/pcdither.c +++ b/pcl/pcdither.c @@ -132,7 +132,7 @@ download_dither_matrix( /* update the dither matrix; release our reference */ code = pcl_palette_set_udither(pcs, pdither); - pcl_udither_release(pcs->memory, pdither); + pcl_udither_release(pdither); return code; } @@ -146,7 +146,7 @@ udither_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'm', 'W', PCL_COMMAND("Download Dither Matrix", download_dither_matrix, pca_bytes | pca_raster_graphics) diff --git a/pcl/pcdither.h b/pcl/pcdither.h index 86e09449a..00c011cc8 100644 --- a/pcl/pcdither.h +++ b/pcl/pcdither.h @@ -63,23 +63,23 @@ typedef struct pcl_udither_s { /* * Copy, init, and release macros. */ -#define pcl_udither_init_from(mem, pto, pfrom) \ +#define pcl_udither_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_udither_copy_from(mem, pto, pfrom) \ +#define pcl_udither_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_udither_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_udither_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_udither_release(mem, pdither) \ - rc_decrement(mem, pdither, "pcl_udither_release") +#define pcl_udither_release(pdither) \ + rc_decrement(pdither, "pcl_udither_release") /* * Macros for retrieving information from a pcl_udither_t structure. diff --git a/pcl/pcdraw.c b/pcl/pcdraw.c index 172daf7f0..072ec8f6a 100644 --- a/pcl/pcdraw.c +++ b/pcl/pcdraw.c @@ -124,9 +124,9 @@ pcl_gsave( if ((code = gs_gsave(pcs->pgs)) >= 0) { pids->prev = pcs->pids->prev; pcs->pids->prev = pids; - pcl_ccolor_init_from(pcs->memory, pids->pccolor, pcs->pids->pccolor); - pcl_ht_init_from(pcs->memory, pids->pht, pcs->pids->pht); - pcl_crd_init_from(pcs->memory, pids->pcrd, pcs->pids->pcrd); + pcl_ccolor_init_from(pids->pccolor, pcs->pids->pccolor); + pcl_ht_init_from(pids->pht, pcs->pids->pht); + pcl_crd_init_from(pids->pcrd, pcs->pids->pcrd); } else gs_free_object(pcs->memory, pids, "PCL gsave"); @@ -145,12 +145,12 @@ pcl_grestore( return e_Range; if ((code = gs_grestore(pcs->pgs)) >= 0) { pcs->pids->prev = pids->prev; - pcl_ccolor_copy_from(pcs->memory, pcs->pids->pccolor, pids->pccolor); - pcl_ccolor_release(pcs->memory, pids->pccolor); - pcl_ht_copy_from(pcs->memory, pcs->pids->pht, pids->pht); - pcl_ht_release(pcs->memory, pids->pht); - pcl_crd_copy_from(pcs->memory, pcs->pids->pcrd, pids->pcrd); - pcl_crd_release(pcs->memory, pids->pcrd); + pcl_ccolor_copy_from(pcs->pids->pccolor, pids->pccolor); + pcl_ccolor_release(pids->pccolor); + pcl_ht_copy_from(pcs->pids->pht, pids->pht); + pcl_ht_release(pids->pht); + pcl_crd_copy_from(pcs->pids->pcrd, pids->pcrd); + pcl_crd_release(pids->pcrd); gs_free_object(pcs->memory, pids, "PCL grestore"); } diff --git a/pcl/pcfont.c b/pcl/pcfont.c index 0cd1beefb..b5b057406 100644 --- a/pcl/pcfont.c +++ b/pcl/pcfont.c @@ -387,15 +387,15 @@ pcfont_do_registration( */ for ( chr = 'A'; chr <= '^'; ++chr ) if ( chr != 'X' ) - { DEFINE_CLASS_COMMAND_ARGS(mem, '(', 0, chr, "Primary Symbol Set", + { DEFINE_CLASS_COMMAND_ARGS('(', 0, chr, "Primary Symbol Set", pcl_primary_symbol_set, pca_neg_error|pca_big_error); - DEFINE_CLASS_COMMAND_ARGS(mem, ')', 0, chr, "Secondary Symbol Set", + DEFINE_CLASS_COMMAND_ARGS(')', 0, chr, "Secondary Symbol Set", pcl_secondary_symbol_set, pca_neg_error|pca_big_error); } } - DEFINE_CLASS(mem, '(') + DEFINE_CLASS('(') {'s', 'P', PCL_COMMAND("Primary Spacing", pcl_primary_spacing, pca_neg_ignore|pca_big_ignore)}, @@ -423,7 +423,7 @@ pcfont_do_registration( pcl_select_default_font_primary, pca_neg_error|pca_big_error)}, END_CLASS - DEFINE_CLASS(mem, ')') + DEFINE_CLASS(')') {'s', 'P', PCL_COMMAND("Secondary Spacing", pcl_secondary_spacing, pca_neg_ignore|pca_big_ignore)}, @@ -452,9 +452,9 @@ pcfont_do_registration( pcl_select_default_font_secondary, pca_neg_error|pca_big_error)}, END_CLASS - DEFINE_CONTROL(mem, SO, "SO", pcl_SO) - DEFINE_CONTROL(mem, SI, "SI", pcl_SI) - DEFINE_CLASS(mem, '&') + DEFINE_CONTROL(SO, "SO", pcl_SO) + DEFINE_CONTROL(SI, "SI", pcl_SI) + DEFINE_CLASS('&') {'k', 'S', PCL_COMMAND("Set Pitch Mode", pcl_set_pitch_mode, pca_neg_error|pca_big_error)}, @@ -513,7 +513,7 @@ pcl_set_current_font_environment(pcl_state_t *pcs) /* rtl doesn't use fonts */ return 0; else { - dprintf(pcs->memory, "No built-in fonts found during initialization\n"); + dprintf("No built-in fonts found during initialization\n"); return -1; } } @@ -546,7 +546,7 @@ pcl_set_current_font_environment(pcl_state_t *pcs) pcl_data_storage = pcds_all_simms; break; default: - dprintf(pcs->memory, "pcfont.c: unknown pjl resource\n"); + dprintf("pcfont.c: unknown pjl resource\n"); return -1; } { @@ -623,7 +623,7 @@ pcl_unload_resident_fonts(pcl_state_t *pcs) pl_font_t *plfont = (pl_font_t *)value; if ( plfont->font_file ) if ( pl_store_resident_font_data_in_file(plfont->font_file, pcs->memory, plfont) < 0 ) - dprintf1(pcs->memory, "%s", "could not store data" ); + dprintf1("%s", "could not store data" ); } } diff --git a/pcl/pcfont.h b/pcl/pcfont.h index 1e8479d7f..ae436354b 100644 --- a/pcl/pcfont.h +++ b/pcl/pcfont.h @@ -111,8 +111,8 @@ int pcl_set_current_font_environment(pcl_state_t *pcs); /* debugging to to print font parameters */ #ifdef DEBUG -void dprint_font_params_t(const gs_memory_t *mem, const pl_font_params_t *pfp); +void dprint_font_params_t(const pl_font_params_t *pfp); #else -#define dprint_font_params_t(mem, p) DO_NOTHING +#define dprint_font_params_t(p) DO_NOTHING #endif /* DEBUG */ #endif /* pcfont_INCLUDED */ diff --git a/pcl/pcfontpg.c b/pcl/pcfontpg.c index 926ab2cef..7f54872b8 100644 --- a/pcl/pcfontpg.c +++ b/pcl/pcfontpg.c @@ -75,7 +75,7 @@ pcl_print_font_page(pcl_args_t *pargs, pcl_state_t *pcs) pl_font_params_t *pfp = &pfs->params; char buff[150]; if ( pcl_text(alphabet, strlen(alphabet), pcs, false) < 0 ) { - dprintf(pcs->memory, "pcl_text failed\n" ); + dprintf("pcl_text failed\n" ); return 1; } /* go to approx center of the page */ @@ -88,7 +88,7 @@ pcl_print_font_page(pcl_args_t *pargs, pcl_state_t *pcs) pcl_decache_font(pcs, -1); /* reset to default font and print the select font string */ if ( pcl_set_current_font_environment(pcs) < 0 ) { - dprintf(pcs->memory, "pcl_set_current_font_environment failed\n"); + dprintf("pcl_set_current_font_environment failed\n"); return -1; } pcl_text(buff, strlen(buff), pcs, false); @@ -106,7 +106,7 @@ pcfontpg_do_registration( gs_memory_t *mem ) { - DEFINE_ESCAPE_ARGS(mem, 'A', "Print Font Page", pcl_print_font_page, pca_in_rtl); + DEFINE_ESCAPE_ARGS('A', "Print Font Page", pcl_print_font_page, pca_in_rtl); return 0; } diff --git a/pcl/pcfrgrnd.c b/pcl/pcfrgrnd.c index b7bbc9ba0..1c6d2ad3f 100644 --- a/pcl/pcfrgrnd.c +++ b/pcl/pcfrgrnd.c @@ -34,11 +34,11 @@ free_foreground( pcl_frgrnd_t * pfrgrnd = (pcl_frgrnd_t *)pvfrgrnd; if (pfrgrnd->pbase != 0) - pcl_cs_base_release(pmem, pfrgrnd->pbase); + pcl_cs_base_release(pfrgrnd->pbase); if (pfrgrnd->pht != 0) - pcl_ht_release(pmem, pfrgrnd->pht); + pcl_ht_release(pfrgrnd->pht); if (pfrgrnd->pcrd != 0) - pcl_crd_release(pmem, pfrgrnd->pcrd); + pcl_crd_release(pfrgrnd->pcrd); gs_free_object(pmem, pvfrgrnd, cname); } @@ -107,14 +107,14 @@ build_foreground( (pal_entry == 1) ) { is_default = true; if (pcs->pdflt_frgrnd != 0) { - pcl_frgrnd_copy_from(pmem, *ppfrgrnd, pcs->pdflt_frgrnd); + pcl_frgrnd_copy_from(*ppfrgrnd, pcs->pdflt_frgrnd); return 0; } } /* release the existing foreground */ if (pfrgrnd != 0) { - rc_decrement(pmem, pfrgrnd, "build pcl foreground"); + rc_decrement(pfrgrnd, "build pcl foreground"); *ppfrgrnd = 0; } @@ -133,12 +133,12 @@ build_foreground( pfrgrnd->color[0] = pindexed->palette.data[3 * pal_entry]; pfrgrnd->color[1] = pindexed->palette.data[3 * pal_entry + 1]; pfrgrnd->color[2] = pindexed->palette.data[3 * pal_entry + 2]; - pcl_cs_base_init_from(pmem, pfrgrnd->pbase, ppalet->pindexed->pbase); - pcl_ht_init_from(pmem, pfrgrnd->pht, ppalet->pht); - pcl_crd_init_from(pmem, pfrgrnd->pcrd, ppalet->pcrd); + pcl_cs_base_init_from(pfrgrnd->pbase, ppalet->pindexed->pbase); + pcl_ht_init_from(pfrgrnd->pht, ppalet->pht); + pcl_crd_init_from(pfrgrnd->pcrd, ppalet->pcrd); if (is_default) - pcl_frgrnd_init_from(pmem, pcs->pdflt_frgrnd, pfrgrnd); + pcl_frgrnd_init_from(pcs->pdflt_frgrnd, pfrgrnd); return 0; } @@ -208,7 +208,7 @@ frgrnd_do_registration( gs_memory_t *mem ) { - DEFINE_CLASS(mem, '*') + DEFINE_CLASS('*') { 'v', 'S', PCL_COMMAND("Set Foreground", set_foreground, pca_neg_ok | pca_raster_graphics) @@ -221,9 +221,9 @@ private void frgrnd_do_reset(pcl_state_t *pcs, pcl_reset_type_t type) { if ( type & (pcl_reset_permanent) ) { - rc_decrement(pcs->memory, pcs->pfrgrnd, "foreground reset pfrgrnd"); - rc_decrement(pcs->memory, pcs->pdflt_frgrnd, "foreground reset pdflt_frgrnd"); - rc_decrement(pcs->memory, pcs->pwhite_cs, "foreground reset p_white_cs"); + rc_decrement(pcs->pfrgrnd, "foreground reset pfrgrnd"); + rc_decrement(pcs->pdflt_frgrnd, "foreground reset pdflt_frgrnd"); + rc_decrement(pcs->pwhite_cs, "foreground reset p_white_cs"); } } @@ -235,9 +235,9 @@ frgrnd_do_copy( ) { if ((operation & (pcl_copy_before_call | pcl_copy_before_overlay)) != 0) - pcl_frgrnd_init_from(pcs->memory, psaved->pfrgrnd, pcs->pfrgrnd); + pcl_frgrnd_init_from(psaved->pfrgrnd, pcs->pfrgrnd); else if ((operation & pcl_copy_after) != 0) - pcl_frgrnd_release(pcs->memory, ((pcl_state_t *)pcs)->pfrgrnd); + pcl_frgrnd_release(((pcl_state_t *)pcs)->pfrgrnd); return 0; } diff --git a/pcl/pcfrgrnd.h b/pcl/pcfrgrnd.h index 70a3a604a..ec5ecc032 100644 --- a/pcl/pcfrgrnd.h +++ b/pcl/pcfrgrnd.h @@ -98,23 +98,23 @@ typedef struct pcl_frgrnd_s pcl_frgrnd_t; /* * The usual init, copy,and release macros. */ -#define pcl_frgrnd_init_from(mem, pto, pfrom) \ +#define pcl_frgrnd_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_frgrnd_copy_from(mem, pto, pfrom) \ +#define pcl_frgrnd_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_frgrnd_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_frgrnd_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_frgrnd_release(mem, pbase) \ - rc_decrement(mem, pbase, "pcl_frgrnd_release") +#define pcl_frgrnd_release(pbase) \ + rc_decrement(pbase, "pcl_frgrnd_release") /* * Get the base color space type from a foreground object diff --git a/pcl/pcfsel.c b/pcl/pcfsel.c index 7f8355ed9..def92dc71 100644 --- a/pcl/pcfsel.c +++ b/pcl/pcfsel.c @@ -62,13 +62,13 @@ static const char * const score_name[] = { }; private void -dprint_cc(const gs_memory_t *mem, const byte *pcc) -{ dprintf8(mem, "cc=%02x %02x %02x %02x %02x %02x %02x %02x", pcc[0], +dprint_cc(const byte *pcc) +{ dprintf8("cc=%02x %02x %02x %02x %02x %02x %02x %02x", pcc[0], pcc[1], pcc[2], pcc[3], pcc[4], pcc[5], pcc[6], pcc[7]); } void -dprint_font_params_t(const gs_memory_t *mem, const pl_font_params_t *pfp) -{ dprintf7(mem, "symset=%u %s pitch=%g ht=%u style=%u wt=%d face=%u\n", +dprint_font_params_t(const pl_font_params_t *pfp) +{ dprintf7("symset=%u %s pitch=%g ht=%u style=%u wt=%d face=%u\n", pfp->symbol_set, (pfp->proportional_spacing ? "prop." : "fixed"), pl_fp_pitch_cp(pfp) / 100.0, pfp->height_4ths / 4, pfp->style, @@ -78,7 +78,7 @@ dprint_font_params_t(const gs_memory_t *mem, const pl_font_params_t *pfp) #include "plftable.h" private void -dprint_font_name(const gs_memory_t *mem, const pl_font_t *pfont) +dprint_font_name(const pl_font_t *pfont) { int i; bool found = false; @@ -92,37 +92,37 @@ dprint_font_name(const gs_memory_t *mem, const pl_font_t *pfont) } } if (found) { - dprintf1(mem, "%s ", resident_table[i].full_font_name); + dprintf1("%s ", resident_table[i].full_font_name); } else { if (pfont->storage == pcds_internal) { - dprintf(mem, "internal font not found in resident table"); - dprintf1(mem, "%s\n", pfont->font_file); + dprintf("internal font not found in resident table"); + dprintf1("%s\n", pfont->font_file); } - dprintf(mem, "external font "); + dprintf("external font "); } } private void -dprint_font_t(const gs_memory_t *mem, const pl_font_t *pfont) +dprint_font_t(const pl_font_t *pfont) { - dprint_font_name(mem, pfont); - dprintf3(mem, "storage=%d scaling=%d type=%d ", + dprint_font_name(pfont); + dprintf3("storage=%d scaling=%d type=%d ", pfont->storage, pfont->scaling_technology, pfont->font_type); - dprint_cc(mem, pfont->character_complement); - dputs(mem, ";\n "); - dprint_font_params_t(mem, &pfont->params); + dprint_cc(pfont->character_complement); + dputs(";\n "); + dprint_font_params_t(&pfont->params); } private void -dprintf_font_scoring(const gs_memory_t *mem, const char *type, const pl_font_t *pfont, match_score_t score) +dprintf_font_scoring(const char *type, const pl_font_t *pfont, match_score_t score) { int i; - dprintf1(mem, "%s: ", type); - dprint_font_t(mem, pfont); - dputs(mem, " score:"); + dprintf1("%s: ", type); + dprint_font_t(pfont); + dputs(" score:"); for ( i = 0; i < score_limit; ++i ) - dprintf2(mem, " %s: %d", score_name[i], score[i]); - dputs(mem, "\n"); + dprintf2(" %s: %d", score_name[i], score[i]); + dputs("\n"); } #endif @@ -318,7 +318,7 @@ score_match(const pcl_state_t *pcs, const pcl_font_selection_t *pfs, score[score_fontnumber] = 0x1000000; #ifdef DEBUG if ( gs_debug_c('=') ) - dprintf_font_scoring(pcs->memory, "candidate", fp, score); + dprintf_font_scoring("candidate", fp, score); #endif } @@ -339,8 +339,8 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs) #ifdef DEBUG if ( gs_debug_c('=') ) - { dputs(pcs->memory, "[=]request: "); - dprint_font_params_t(pcs->memory, &pfs->params); + { dputs("[=]request: "); + dprint_font_params_t(&pfs->params); } #endif /* if the font table is set up to select character by id @@ -384,7 +384,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs) #ifdef DEBUG if ( gs_debug_c('=') ) { if (best_match[0] != -1) /* skip sentinel */ - dprintf_font_scoring(pcs->memory, "best", best_font, best_match); + dprintf_font_scoring("best", best_font, best_match); } #endif for (i=(score_index_t)0; i<score_limit; i++) @@ -398,8 +398,8 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs) sizeof(match)); #ifdef DEBUG if ( gs_debug_c('=') ) { - dprintf_font_scoring(pcs->memory, "usurper", fp, best_match); - dprintf1(pcs->memory, " better %s***)\n", score_name[i]); + dprintf_font_scoring("usurper", fp, best_match); + dprintf1(" better %s***)\n", score_name[i]); } #endif @@ -412,7 +412,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs) return e_Unimplemented; /* no fonts */ #ifdef DEBUG if ( gs_debug_c('=') ) { - dprintf_font_scoring(pcs->memory, "champion", best_font, best_match); + dprintf_font_scoring("champion", best_font, best_match); } #endif diff --git a/pcl/pcht.c b/pcl/pcht.c index 98097ba39..43ea03386 100644 --- a/pcl/pcht.c +++ b/pcl/pcht.c @@ -1542,9 +1542,9 @@ free_gs_hts( int i; if (pht->pfg_ht != 0) - gs_ht_release(pht->rc.memory, pht->pfg_ht); + gs_ht_release(pht->pfg_ht); if (pht->pim_ht != 0) - gs_ht_release(pht->rc.memory, pht->pim_ht); + gs_ht_release(pht->pim_ht); pht->pfg_ht = 0; pht->pim_ht = 0; @@ -1581,8 +1581,8 @@ free_pcl_ht( pcl_ht_t * pht = (pcl_ht_t *)pvht; if (pht->client_data[0].plktbl != 0) - rc_adjust(pmem, pht->client_data[0].plktbl, -3, cname); - pcl_udither_release(pmem, pht->pdither); + rc_adjust(pht->client_data[0].plktbl, -3, cname); + pcl_udither_release(pht->pdither); /* free_gs_hts frees the string pointers */ free_gs_hts(pht); @@ -1669,14 +1669,14 @@ unshare_pcl_ht( free_gs_hts(pht); return 0; } - rc_decrement(pht->rc.memory, pht, "unshare pcl halftone object"); + rc_decrement(pht, "unshare pcl halftone object"); if ((code = alloc_pcl_ht(ppht, pht->rc.memory)) < 0) return code; pnew = *ppht; if (pht->pdither != 0) - pcl_udither_init_from(pht->rc.memory, pnew->pdither, pht->pdither); + pcl_udither_init_from(pnew->pdither, pht->pdither); pnew->render_method = pht->render_method; pnew->orig_render_method = pht->orig_render_method; pnew->is_gray_render_method = pht->is_gray_render_method; @@ -1685,7 +1685,7 @@ unshare_pcl_ht( pnew->client_data[i].comp_indx = pht->client_data[i].comp_indx; pnew->client_data[i].inv_gamma = pht->client_data[i].inv_gamma; if (pht->client_data[i].plktbl != 0) - pcl_lookup_tbl_copy_from( pht->rc.memory, pnew->client_data[i].plktbl, + pcl_lookup_tbl_copy_from( pnew->client_data[i].plktbl, pht->client_data[i].plktbl ); } @@ -1841,7 +1841,7 @@ pcl_ht_set_gamma( /* discard the device specific color lookup table, if present */ for (i = 0; i < 3; i++) { pht->client_data[i].inv_gamma = inv_gamma; - pcl_lookup_tbl_release(pht->rc.memory, pht->client_data[i].plktbl); + pcl_lookup_tbl_release(pht->client_data[i].plktbl); pht->client_data[i].plktbl = 0; } @@ -1879,7 +1879,7 @@ pcl_ht_set_lookup_tbl( pht = *ppht; for (i = 0; i < 3; i++) - pcl_lookup_tbl_copy_from(pht->rc.memory, pht->client_data[i].plktbl, plktbl); + pcl_lookup_tbl_copy_from(pht->client_data[i].plktbl, plktbl); return 0; } @@ -1902,7 +1902,7 @@ pcl_ht_set_udither( return code; pht = *ppht; - pcl_udither_copy_from(pht->rc.memory, pht->pdither, pdither); + pcl_udither_copy_from(pht->pdither, pdither); return 0; } @@ -1951,7 +1951,7 @@ pcl_ht_build_default_ht( if ((pcs->pdflt_ht == 0) && ((code = alloc_pcl_ht(&pcs->pdflt_ht, pmem)) < 0)) return code; - pcl_ht_copy_from(pmem, *ppht, pcs->pdflt_ht); + pcl_ht_copy_from(*ppht, pcs->pdflt_ht); return 0; } @@ -2101,8 +2101,7 @@ set_threshold_ht( pht->thresholds[comp].data = pb; } - return gs_ht_set_threshold_comp( pht->rc.memory, - pgsht, + return gs_ht_set_threshold_comp( pgsht, comp, /* sepname, */ dt.u.thresh.width, @@ -2120,8 +2119,7 @@ set_threshold_ht( ? dt.u.thresh.pdata : dt.u.thresh.pdata + icomp * size ); - return gs_ht_set_mask_comp( pht->rc.memory, - pgsht, + return gs_ht_set_mask_comp( pgsht, comp, // NB sepname, dt.u.tdither.width, @@ -2217,7 +2215,7 @@ create_gs_halftones( if (pinfo != get_rendering_info(pcs, pht->render_method, cstype, true)) code = e_Unimplemented; else - gs_ht_init_ptr(pht->rc.memory, pht->pim_ht, pht->pfg_ht); + gs_ht_init_ptr(pht->pim_ht, pht->pfg_ht); } if (code < 0) @@ -2297,7 +2295,7 @@ pcl_ht_set_halftone( if ((code = gs_ht_install(pcs->pgs, pgsht)) < 0) return code; - pcl_ht_copy_from(pht->rc.memory, pcs->pids->pht, pht); + pcl_ht_copy_from(pcs->pids->pht, pht); return code; } diff --git a/pcl/pcht.h b/pcl/pcht.h index 98a5924c1..91b9452e8 100644 --- a/pcl/pcht.h +++ b/pcl/pcht.h @@ -222,23 +222,23 @@ typedef struct pcl_ht_s pcl_ht_t; /* * The usual init, copy,and release macros. */ -#define pcl_ht_init_from(mem, pto, pfrom) \ +#define pcl_ht_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_ht_copy_from(mem, pto, pfrom) \ +#define pcl_ht_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_ht_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_ht_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_ht_release(mem, pht) \ - rc_decrement(mem, pht, "pcl_ht_release") +#define pcl_ht_release(pht) \ + rc_decrement(pht, "pcl_ht_release") /* * The following routine is intended to initialize the forwarding devices used diff --git a/pcl/pcindxed.c b/pcl/pcindxed.c index cdc01135d..4314cd3bb 100644 --- a/pcl/pcindxed.c +++ b/pcl/pcindxed.c @@ -82,9 +82,9 @@ free_indexed_cspace( { pcl_cs_indexed_t * pindexed = (pcl_cs_indexed_t *)pvindexed; - pcl_cs_base_release(pmem, pindexed->pbase); + pcl_cs_base_release(pindexed->pbase); if (pindexed->pcspace != 0) { - gs_cspace_release(pmem, pindexed->pcspace); + gs_cspace_release(pindexed->pcspace); gs_free_object(pmem, pindexed->pcspace, cname); } if (pindexed->palette.data != 0) @@ -125,7 +125,7 @@ alloc_indexed_cspace( ); pindexed->rc.free = free_indexed_cspace; pindexed->pfixed = false; - pcl_cs_base_init_from(pmem, pindexed->pbase, pbase); + pcl_cs_base_init_from(pindexed->pbase, pbase); pindexed->pcspace = 0; pindexed->num_entries = 0; pindexed->palette.data = 0; @@ -180,7 +180,7 @@ unshare_indexed_cspace( /* check if there is anything to do */ if (pindexed->rc.ref_count == 1) return 0; - rc_decrement(pindexed->rc.memory, pindexed, "unshare PCL indexed color space"); + rc_decrement(pindexed, "unshare PCL indexed color space"); /* allocate a new indexed color space */ code = alloc_indexed_cspace( ppindexed, @@ -765,7 +765,7 @@ pcl_cs_indexed_update_lookup_tbl( /* the base space was updated, so re-build the indexed color space */ if (pindexed->pcspace != 0) { - gs_cspace_release(pindexed->rc.memory, pindexed->pcspace); + gs_cspace_release(pindexed->pcspace); gs_free_object( pindexed->rc.memory, pindexed->pcspace, "update_lookup_tbl" @@ -933,14 +933,14 @@ pcl_cs_indexed_build_cspace( if (pfixed && (pcid->u.hdr.bits_per_index == dflt_cid_hdr.bits_per_index)) { is_default = true; if (pcs->pdflt_cs_indexed != 0) { - pcl_cs_indexed_copy_from(pmem, *ppindexed, pcs->pdflt_cs_indexed); + pcl_cs_indexed_copy_from(*ppindexed, pcs->pdflt_cs_indexed); return 0; } } /* release the existing color space, if present */ if (pindexed != 0) - rc_decrement(pmem, pindexed, "build indexed color space"); + rc_decrement(pindexed, "build indexed color space"); /* build the base color space */ if ((code = pcl_cs_base_build_cspace(&pbase, pcid, pmem)) < 0) @@ -948,13 +948,13 @@ pcl_cs_indexed_build_cspace( /* build the indexed color space */ if ((code = alloc_indexed_cspace(ppindexed, pbase, pmem)) < 0) { - pcl_cs_base_release(pmem, pbase); + pcl_cs_base_release(pbase); return code; } pindexed = *ppindexed; /* release our extra reference of the base color space */ - pcl_cs_base_release(pmem, pbase); + pcl_cs_base_release(pbase); pbase = 0; /* copy the header of the configure image data structure */ @@ -1007,7 +1007,7 @@ pcl_cs_indexed_build_cspace( /* record if this is the default */ if (is_default) - pcl_cs_indexed_init_from(pcs->memory, pcs->pdflt_cs_indexed, pindexed); + pcl_cs_indexed_init_from(pcs->pdflt_cs_indexed, pindexed); return 0; } @@ -1037,7 +1037,7 @@ pcl_cs_indexed_build_default_cspace( pmem ); } else { - pcl_cs_indexed_copy_from(pcs->memory, *ppindexed, pcs->pdflt_cs_indexed); + pcl_cs_indexed_copy_from(*ppindexed, pcs->pdflt_cs_indexed); return 0; } } diff --git a/pcl/pcindxed.h b/pcl/pcindxed.h index bd2007ccb..5a6c9c7f0 100644 --- a/pcl/pcindxed.h +++ b/pcl/pcindxed.h @@ -157,23 +157,23 @@ typedef pcl_cs_indexed_s pcl_cs_indexed_t; /* * The usual copy, init, and release macros. */ -#define pcl_cs_indexed_init_from(mem, pto, pfrom)\ +#define pcl_cs_indexed_init_from(pto, pfrom)\ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_cs_indexed_copy_from(mem, pto, pfrom) \ +#define pcl_cs_indexed_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_cs_indexed_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_cs_indexed_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_cs_indexed_release(mem, pindexed) \ - rc_decrement(mem, pindexed, "pcl_cs_indexed_release") +#define pcl_cs_indexed_release(pindexed) \ + rc_decrement(pindexed, "pcl_cs_indexed_release") /* * Get the color space type for the base color space of an indexed color space. diff --git a/pcl/pcjob.c b/pcl/pcjob.c index f0c562bb2..fe944238f 100644 --- a/pcl/pcjob.c +++ b/pcl/pcjob.c @@ -199,16 +199,13 @@ pcl_set_unit_of_measure(pcl_args_t *pargs, pcl_state_t *pcs) /* Initialization */ private int -pcjob_do_registration( - pcl_parser_state_t *pcl_parser_state, - gs_memory_t *mem -) +pcjob_do_registration(pcl_parser_state_t *pcl_parser_state) { /* Register commands */ - DEFINE_ESCAPE_ARGS(mem, 'E', "Printer Reset", pcl_printer_reset, pca_in_rtl) - DEFINE_CLASS(mem, '%') + DEFINE_ESCAPE_ARGS('E', "Printer Reset", pcl_printer_reset, pca_in_rtl) + DEFINE_CLASS('%') {0, 'X', {pcl_exit_language, pca_neg_ok|pca_big_error|pca_in_rtl}}, END_CLASS - DEFINE_CLASS(mem, '&') + DEFINE_CLASS('&') {'l', 'X', PCL_COMMAND("Number of Copies", pcl_number_of_copies, pca_neg_ignore|pca_big_clamp)}, diff --git a/pcl/pclookup.c b/pcl/pclookup.c index ed6b114a9..fbbb3eedd 100644 --- a/pcl/pclookup.c +++ b/pcl/pclookup.c @@ -104,7 +104,7 @@ set_lookup_tbl( /* update the current palette; release our reference to the lookup table */ code = pcl_palette_set_lookup_tbl(pcs, plktbl); - pcl_lookup_tbl_release(pcs->memory, plktbl); + pcl_lookup_tbl_release(plktbl); return code; } @@ -139,7 +139,7 @@ lookup_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'l', 'W', PCL_COMMAND("Color Lookup Tables", set_lookup_tbl, pca_bytes | pca_raster_graphics) diff --git a/pcl/pclookup.h b/pcl/pclookup.h index b967e3c3a..8ba5c2434 100644 --- a/pcl/pclookup.h +++ b/pcl/pclookup.h @@ -174,23 +174,23 @@ typedef struct pcl_lookup_tbl_s { /* * Copy, init, and release macros. */ -#define pcl_lookup_tbl_init_from(mem, pto, pfrom) \ +#define pcl_lookup_tbl_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_lookup_tbl_copy_from(mem, pto, pfrom) \ +#define pcl_lookup_tbl_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_lookup_tbl_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_lookup_tbl_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_lookup_tbl_release(mem, plktbl) \ - rc_decrement(mem, plktbl, "pcl_lookup_tbl_release") +#define pcl_lookup_tbl_release(plktbl) \ + rc_decrement(plktbl, "pcl_lookup_tbl_release") /* * Get the color space type of a lookup table. diff --git a/pcl/pcmacros.c b/pcl/pcmacros.c index eff223895..f9daacddc 100644 --- a/pcl/pcmacros.c +++ b/pcl/pcmacros.c @@ -120,7 +120,7 @@ pcl_macro_control(pcl_args_t *pargs, pcl_state_t *pcs) gs_alloc_bytes(pcs->memory, sizeof(pcl_macro_t), "begin macro definition"); if ( pmac == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); pmac->storage = pcds_temporary; pcs->macro_definition = (byte *)pmac; pcs->defining_macro = true; @@ -211,7 +211,7 @@ pcmacros_do_registration( pcl_parser_state_t *pcl_parser_state, gs_memory_t *mem) { /* Register commands */ - DEFINE_CLASS(mem, '&') + DEFINE_CLASS('&') {'f', 'X', PCL_COMMAND("Macro Control", pcl_macro_control, pca_neg_error|pca_big_error|pca_in_macro)}, diff --git a/pcl/pcmisc.c b/pcl/pcmisc.c index c71886dbe..aa751e1da 100644 --- a/pcl/pcmisc.c +++ b/pcl/pcmisc.c @@ -46,12 +46,12 @@ pcmisc_do_registration( pcl_parser_state_t *pcl_parser_state, gs_memory_t *mem) { /* Register commands */ - DEFINE_CLASS_COMMAND_ARGS(mem, '&', 's', 'C', "End of Line Wrap", + DEFINE_CLASS_COMMAND_ARGS('&', 's', 'C', "End of Line Wrap", pcl_end_of_line_wrap, pca_neg_error|pca_big_error) - DEFINE_ESCAPE_ARGS(mem, 'Y', "Enable Display Functions", + DEFINE_ESCAPE_ARGS('Y', "Enable Display Functions", pcl_enable_display_functions, pca_in_macro) - DEFINE_ESCAPE_ARGS(mem, 'Z', "Disable Display Functions", + DEFINE_ESCAPE_ARGS('Z', "Disable Display Functions", pcl_disable_display_functions, pca_in_macro) return 0; } diff --git a/pcl/pcommand.c b/pcl/pcommand.c index c3430ac52..77ea6c3b4 100644 --- a/pcl/pcommand.c +++ b/pcl/pcommand.c @@ -180,7 +180,7 @@ pcl_do_registrations( if ( (*init)->do_registration ) { code = (*(*init)->do_registration)(pst, pcs->memory); if (code < 0) { - lprintf1(pcs->memory, "Error %d during initialization!\n", code); + lprintf1("Error %d during initialization!\n", code); return code; } } diff --git a/pcl/pcommand.h b/pcl/pcommand.h index 6d00a0a1d..fe2d3e7e3 100644 --- a/pcl/pcommand.h +++ b/pcl/pcommand.h @@ -167,40 +167,38 @@ typedef struct { } pcl_grouped_command_definition_t; /* Register (a) command definition(s). */ -void pcl_define_control_command(const gs_memory_t *mem, int/*char*/, - const pcl_command_definition_t *, pcl_parser_state_t *); -#define DEFINE_CONTROL(mem, chr, cname, proc)\ +void pcl_define_control_command(int/*char*/, + const pcl_command_definition_t *, pcl_parser_state_t *); +#define DEFINE_CONTROL(chr, cname, proc)\ { static const pcl_command_definition_t defn_ = PCL_COMMAND(cname, proc, 0);\ - pcl_define_control_command(mem, chr, &defn_, pcl_parser_state);\ + pcl_define_control_command(chr, &defn_, pcl_parser_state);\ } -void pcl_define_escape_command(const gs_memory_t *mem, int/*char*/, +void pcl_define_escape_command(int/*char*/, const pcl_command_definition_t *, pcl_parser_state_t *); -#define DEFINE_ESCAPE_ARGS(mem, chr, cname, proc, acts)\ +#define DEFINE_ESCAPE_ARGS(chr, cname, proc, acts)\ { static const pcl_command_definition_t defn_ = PCL_COMMAND(cname, proc, acts);\ - pcl_define_escape_command(mem, chr, &defn_, pcl_parser_state);\ + pcl_define_escape_command(chr, &defn_, pcl_parser_state);\ } -#define DEFINE_ESCAPE(mem, chr, cname, proc)\ - DEFINE_ESCAPE_ARGS(mem, chr, cname, proc, 0) -void pcl_define_class_command(const gs_memory_t *mem, - int/*char*/, int/*char*/, int/*char*/, +#define DEFINE_ESCAPE(chr, cname, proc)\ + DEFINE_ESCAPE_ARGS(chr, cname, proc, 0) +void pcl_define_class_command(int/*char*/, int/*char*/, int/*char*/, const pcl_command_definition_t *, pcl_parser_state_t *); -#define DEFINE_CLASS_COMMAND_ARGS(mem, cls, group, chr, cname, proc, acts)\ +#define DEFINE_CLASS_COMMAND_ARGS(cls, group, chr, cname, proc, acts)\ { static const pcl_command_definition_t defn_ = PCL_COMMAND(cname, proc, acts);\ - pcl_define_class_command(mem, cls, group, chr, &defn_, pcl_parser_state);\ + pcl_define_class_command(cls, group, chr, &defn_, pcl_parser_state);\ } #define DEFINE_CLASS_COMMAND(cls, group, chr, cname, proc)\ DEFINE_CLASS_COMMAND_ARGS(cls, group, chr, cname, proc, 0) -void pcl_define_class_commands(const gs_memory_t *mem, int/*char*/, +void pcl_define_class_commands(int/*char*/, const pcl_grouped_command_definition_t *, pcl_parser_state_t *); -#define DEFINE_CLASS(mem, cls)\ +#define DEFINE_CLASS(cls)\ { const byte class_ = cls;\ - const gs_memory_t *mem_ = mem;\ static const pcl_grouped_command_definition_t defs_[] = { #define END_CLASS\ {0, 0}\ };\ - pcl_define_class_commands(mem_, class_, defs_, pcl_parser_state);\ + pcl_define_class_commands(class_, defs_, pcl_parser_state);\ } /* diff --git a/pcl/pcpage.c b/pcl/pcpage.c index d06fe4df9..55496303e 100644 --- a/pcl/pcpage.c +++ b/pcl/pcpage.c @@ -62,8 +62,7 @@ preserve_cap_and_margins( { pcur_pt->x = (double)pcs->cap.x; pcur_pt->y = (double)pcs->cap.y; - gs_point_transform( pcs->memory, - pcur_pt->x, + gs_point_transform( pcur_pt->x, pcur_pt->y, &(pcs->xfm_state.pd2lp_mtx), pcur_pt @@ -91,7 +90,7 @@ restore_cap_and_margins( gs_rect tmp_rect; pcl_invert_mtx(&(pcs->xfm_state.pd2lp_mtx), &lp2pd); - gs_point_transform(pcs->memory, pcur_pt->x, pcur_pt->y, &lp2pd, &tmp_pt); + gs_point_transform(pcur_pt->x, pcur_pt->y, &lp2pd, &tmp_pt); pcs->cap.x = (coord)tmp_pt.x; pcs->cap.y = (coord)tmp_pt.y; pcl_transform_rect(pcs->memory, ptext_rect, &tmp_rect, &lp2pd); @@ -171,8 +170,7 @@ update_xfm_state( (psize->height == 84168) ) offset -= inch2coord(1.0/10.0); - gs_matrix_translate( pcs->memory, - &(pxfmst->lp2pg_mtx), + gs_matrix_translate( &(pxfmst->lp2pg_mtx), (floatp)offset, 0.0, &(pxfmst->lp2pg_mtx) @@ -340,7 +338,7 @@ new_page_size( gs_setdefaultmatrix(pgs, NULL); gs_initmatrix(pgs); gs_currentmatrix(pgs, &mat); - gs_matrix_translate(pcs->memory, &mat, 0.0, height_pts, &mat); + gs_matrix_translate(&mat, 0.0, height_pts, &mat); gs_matrix_scale(&mat, 0.01, -0.01, &mat); gs_setdefaultmatrix(pgs, &mat); @@ -479,12 +477,12 @@ pcl_mark_page_for_current_pos(pcl_state_t *pcs) page_bbox_float.q.y = fixed2float(page_bbox_fixed.q.y); if ( gs_currentpoint(pcs->pgs, ¤t_pt) < 0 ) { - dprintf(pcs->memory, "Not expected to fail\n" ); + dprintf("Not expected to fail\n" ); return; } if ( gs_transform(pcs->pgs, current_pt.x, current_pt.y, &dev_pt) ) { - dprintf(pcs->memory, "Not expected to fail\n" ); + dprintf("Not expected to fail\n" ); return; } @@ -954,7 +952,7 @@ pcpage_do_registration( ) { /* Register commands */ - DEFINE_CLASS(pmem, '&') + DEFINE_CLASS('&') { 'l', 'A', PCL_COMMAND( "Page Size", @@ -1041,12 +1039,12 @@ pcpage_do_registration( }, END_CLASS - DEFINE_ESCAPE( pmem, '9', + DEFINE_ESCAPE( '9', "Clear Horizontal Margins", clear_horizontal_margins ) - DEFINE_CLASS_COMMAND_ARGS( pmem, '*', + DEFINE_CLASS_COMMAND_ARGS( '*', 'o', 'Q', "Print Quality", @@ -1071,7 +1069,7 @@ get_default_paper( pcs->wide_a4 = true; return &(paper_sizes[i].psize); } - dprintf(pcs->memory, "system does not support requested paper setting\n"); + dprintf("system does not support requested paper setting\n"); return &(paper_sizes[1].psize); } diff --git a/pcl/pcpalet.c b/pcl/pcpalet.c index cf9a5d048..e50e9a93b 100644 --- a/pcl/pcpalet.c +++ b/pcl/pcpalet.c @@ -41,11 +41,11 @@ free_palette( pcl_palette_t * ppalet = (pcl_palette_t *)pvpalet; if (ppalet->pindexed != 0) - pcl_cs_indexed_release(pmem, ppalet->pindexed); + pcl_cs_indexed_release(ppalet->pindexed); if (ppalet->pcrd != 0) - pcl_crd_release(pmem, ppalet->pcrd); + pcl_crd_release(ppalet->pcrd); if (ppalet->pht != 0) - pcl_ht_release(pmem, ppalet->pht); + pcl_ht_release(ppalet->pht); gs_free_object(pmem, pvpalet, cname); } @@ -57,22 +57,22 @@ pcl_free_default_objects( { pcl_palette_t * ppalette = (pcl_palette_t *)pcs->pdflt_palette; - rc_decrement(mem, pcs->pdflt_cs_indexed, "free_default_palette(pdflt_cs_indexed)"); + rc_decrement(pcs->pdflt_cs_indexed, "free_default_palette(pdflt_cs_indexed)"); if (ppalette != 0) { - rc_decrement(mem, ppalette->pindexed, "free_default_palette cs indexed released"); + rc_decrement(ppalette->pindexed, "free_default_palette cs indexed released"); if (ppalette->pht) - rc_decrement(mem, ppalette->pht, "free_default_palette ht released"); + rc_decrement(ppalette->pht, "free_default_palette ht released"); if (ppalette->pcrd) - rc_decrement(mem, ppalette->pcrd, "free_default_palette pcl_crd_release"); + rc_decrement(ppalette->pcrd, "free_default_palette pcl_crd_release"); gs_free_object(mem, ppalette, "free_default_palette ppalette free"); pcs->pdflt_palette = 0; } - rc_decrement(mem, pcs->pdflt_ht, "free_default_palette pdflt_ht release"); - rc_decrement(mem, pcs->pdflt_ht, "free_default_palette pdflt_ht release"); - rc_decrement(mem, pcs->pdflt_ht, "free_default_palette pdflt_ht release"); - rc_decrement(mem, pcs->pdflt_ht, "free_default_palette pdflt_ht release"); + rc_decrement(pcs->pdflt_ht, "free_default_palette pdflt_ht release"); + rc_decrement(pcs->pdflt_ht, "free_default_palette pdflt_ht release"); + rc_decrement(pcs->pdflt_ht, "free_default_palette pdflt_ht release"); + rc_decrement(pcs->pdflt_ht, "free_default_palette pdflt_ht release"); if(pcs->pcl_default_crd) free_crd(mem, pcs->pcl_default_crd, "free_default_palette pcl_default_crd free"); @@ -90,7 +90,7 @@ dict_free_palette( { pcl_palette_t * ppalet = (pcl_palette_t *)pvpalet; - rc_decrement(pmem, ppalet, cname); + rc_decrement(ppalet, cname); } /* @@ -171,9 +171,9 @@ unshare_palette( if ((code = alloc_palette(pcs, &pnew, pcs->memory)) < 0) return code; if (ppalet != 0) { - pcl_cs_indexed_init_from(pcs->memory, pnew->pindexed, ppalet->pindexed); - pcl_crd_init_from(pcs->memory, pnew->pcrd, ppalet->pcrd); - pcl_ht_init_from(pcs->memory, pnew->pht, ppalet->pht); + pcl_cs_indexed_init_from(pnew->pindexed, ppalet->pindexed); + pcl_crd_init_from(pnew->pcrd, ppalet->pcrd); + pcl_ht_init_from(pnew->pht, ppalet->pht); } /* redefine the current palette id. */ @@ -207,7 +207,7 @@ build_default_palette( if ((code == 0) && (pcs->pcl_default_crd == 0)) code = pcl_crd_build_default_crd(pcs); if (code == 0) - pcl_crd_init_from(pmem, ppalet->pcrd, pcs->pcl_default_crd); + pcl_crd_init_from(ppalet->pcrd, pcs->pcl_default_crd); if (code == 0) code = pcl_ht_build_default_ht(pcs, &(ppalet->pht), pmem); if (code < 0) { @@ -215,9 +215,9 @@ build_default_palette( free_palette(pmem, ppalet, "build default palette"); return code; } - pcl_palette_init_from(pmem, pcs->pdflt_palette, ppalet); + pcl_palette_init_from(pcs->pdflt_palette, ppalet); } else - pcl_palette_init_from(pmem, ppalet, pcs->pdflt_palette); + pcl_palette_init_from(ppalet, pcs->pdflt_palette); /* NB: definitions do NOT record a referece */ @@ -225,7 +225,7 @@ build_default_palette( code = pl_dict_put(&pcs->palette_store, id_key(key), 2, ppalet); if (code < 0) return e_Memory; - rc_increment(pmem, ppalet); + rc_increment(ppalet); /* the graphic state pointer does not (yet) amount to a reference */ pcs->ppalet = ppalet; return 0; @@ -245,7 +245,7 @@ clear_palette_stack( while (pentry != 0) { pstack_entry_t * pnext = pentry->pnext; - pcl_palette_release(pmem, pentry->ppalet); + pcl_palette_release(pentry->ppalet); gs_free_object(pmem, pentry, "clear palette stack"); pentry = pnext; } @@ -286,7 +286,7 @@ push_pop_palette( if (pentry == 0) return e_Memory; - pcl_palette_init_from(pcs->memory, pentry->ppalet, pcs->ppalet); + pcl_palette_init_from(pentry->ppalet, pcs->ppalet); pentry->pnext = pcs->palette_stack; pcs->palette_stack = pentry; @@ -676,7 +676,7 @@ pcl_palette_set_view_illuminant( if ((code == 0) && (pcs->ppalet->pcrd == 0)) { if ((code = pcl_crd_build_default_crd(pcs)) == 0) - pcl_crd_init_from(pcs->memory, pcs->ppalet->pcrd, pcs->pcl_default_crd); + pcl_crd_init_from(pcs->ppalet->pcrd, pcs->pcl_default_crd); } if (code == 0) code = pcl_crd_set_view_illuminant(pcs, &(pcs->ppalet->pcrd), pwht_pt); @@ -716,7 +716,7 @@ pcl_palette_check_complete( ); if ((code == 0) && (ppalet->pcrd == 0)) { if ((code = pcl_crd_build_default_crd(pcs)) == 0) - pcl_crd_init_from(pcs->memory, pcs->ppalet->pcrd, pcs->pcl_default_crd); + pcl_crd_init_from(pcs->ppalet->pcrd, pcs->pcl_default_crd); } if ((code == 0) && (ppalet->pht == 0)) code = pcl_ht_build_default_ht(pcs, &(ppalet->pht), pcs->memory); @@ -851,7 +851,7 @@ palette_control( code = pl_dict_put(&pcs->palette_store, id_key(key), 2, pcs->ppalet); if (code < 0) return code; - rc_increment(pcs->memory, pcs->ppalet); + rc_increment(pcs->ppalet); } break; @@ -942,7 +942,7 @@ palette_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'p', 'P', PCL_COMMAND( "Push/Pop Palette", @@ -959,7 +959,7 @@ palette_do_registration( }, END_CLASS - DEFINE_CLASS(pmem, '&') + DEFINE_CLASS('&') { 'b', 'M', PCL_COMMAND( "Monochrome Printing", @@ -1079,7 +1079,7 @@ palette_do_copy( ) { if ((operation & (pcl_copy_before_call | pcl_copy_before_overlay)) != 0) - pcl_palette_init_from(pcs->memory, psaved->ppalet, pcs->ppalet); + pcl_palette_init_from(psaved->ppalet, pcs->ppalet); else if ((operation & pcl_copy_after) != 0) { pcl_id_t key; /* fix the compiler warning resulting from overuse of const */ diff --git a/pcl/pcpalet.h b/pcl/pcpalet.h index 64ef83ef2..4df5b4924 100644 --- a/pcl/pcpalet.h +++ b/pcl/pcpalet.h @@ -79,23 +79,23 @@ typedef struct pcl_palette_s pcl_palette_t; /* * The usual init, copy,and release macros. */ -#define pcl_palette_init_from(mem, pto, pfrom) \ +#define pcl_palette_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_palette_copy_from(mem, pto, pfrom) \ +#define pcl_palette_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_palette_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_palette_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_palette_release(mem, pbase) \ - rc_decrement(mem, pbase, "pcl_frgrnd_release") +#define pcl_palette_release(pbase) \ + rc_decrement(pbase, "pcl_frgrnd_release") /* diff --git a/pcl/pcparse.c b/pcl/pcparse.c index 7ddb06128..e876867d2 100644 --- a/pcl/pcparse.c +++ b/pcl/pcparse.c @@ -49,30 +49,29 @@ pcl_register_command(byte *pindex, const pcl_command_definition_t *pcmd, /* Define a command or list of commands. */ void -pcl_define_control_command(const gs_memory_t *mem, - int/*char*/ chr, const pcl_command_definition_t *pcmd, +pcl_define_control_command(int/*char*/ chr, const pcl_command_definition_t *pcmd, pcl_parser_state_t *pcl_parser_state) { #ifdef DEBUG if ( chr < 0 || chr >= countof(pcl_parser_state->definitions->pcl_control_command_indices) ) - if_debug1(mem, 'I', "Invalid control character %d\n", chr); + if_debug1('I', "Invalid control character %d\n", chr); else if ( #endif pcl_register_command(&pcl_parser_state->definitions->pcl_control_command_indices[chr], pcmd, pcl_parser_state) #ifdef DEBUG ) - if_debug1(mem, 'I', "Redefining control character %d\n", chr); + if_debug1('I', "Redefining control character %d\n", chr); #endif ; } void -pcl_define_escape_command(const gs_memory_t *mem, int/*char*/ chr, +pcl_define_escape_command(int/*char*/ chr, const pcl_command_definition_t *pcmd, pcl_parser_state_t *pcl_parser_state) { #ifdef DEBUG if ( chr < min_escape_2char || chr > max_escape_2char ) - if_debug1(mem, 'I', "Invalid escape character %c\n", chr); + if_debug1('I', "Invalid escape character %c\n", chr); else if ( #endif pcl_register_command(&pcl_parser_state->definitions->pcl_escape_command_indices @@ -80,7 +79,7 @@ pcl_define_escape_command(const gs_memory_t *mem, int/*char*/ chr, pcl_parser_state) #ifdef DEBUG ) - if_debug1(mem, 'I', "Redefining ESC %c\n", chr) + if_debug1('I', "Redefining ESC %c\n", chr) #endif ; } @@ -93,8 +92,7 @@ private const byte pcl_escape_class_indices[max_escape_class - min_escape_class }; void -pcl_define_class_command(const gs_memory_t *mem, - int/*char*/ class, int/*char*/ group, +pcl_define_class_command(int/*char*/ class, int/*char*/ group, int/*char*/ command, const pcl_command_definition_t *pcmd, pcl_parser_state_t *pcl_parser_state) @@ -105,7 +103,7 @@ pcl_define_class_command(const gs_memory_t *mem, (group != 0 && (group < min_escape_group || group > max_escape_group)) || command < min_escape_command || command > max_escape_command ) - if_debug3(mem, 'I', "Invalid command %c %c %c\n", class, group, command); + if_debug3('I', "Invalid command %c %c %c\n", class, group, command); else if ( #endif pcl_register_command(&pcl_parser_state->definitions->pcl_grouped_command_indices @@ -115,20 +113,19 @@ pcl_define_class_command(const gs_memory_t *mem, pcl_parser_state) #ifdef DEBUG ) - if_debug3(mem, 'I', "Redefining ESC %c %c %c\n", class, + if_debug3('I', "Redefining ESC %c %c %c\n", class, (group == 0 ? ' ' : group), command) #endif ; } void -pcl_define_class_commands(const gs_memory_t *mem, - int/*char*/ class, +pcl_define_class_commands(int/*char*/ class, const pcl_grouped_command_definition_t *pgroup, pcl_parser_state_t *pcl_parser_state) { const pcl_grouped_command_definition_t *pgc = pgroup; for ( ; pgc->command != 0; ++pgc ) - pcl_define_class_command(mem, class, pgc->group, pgc->command, + pcl_define_class_command(class, pgc->group, pgc->command, &pgc->defn, pcl_parser_state); } @@ -140,8 +137,7 @@ pcl_define_class_commands(const gs_memory_t *mem, * The caller is responsible for providing valid arguments. */ private const pcl_command_definition_t * -pcl_get_command_definition(const gs_memory_t *mem, - pcl_parser_state_t *pcl_parser_state, +pcl_get_command_definition(pcl_parser_state_t *pcl_parser_state, int/*char*/ class, int/*char*/ group, int/*char*/ command) @@ -164,11 +160,11 @@ pcl_get_command_definition(const gs_memory_t *mem, #ifdef DEBUG if ( cdefn == 0 ) { if ( class == 0 ) - if_debug1(mem, 'I', "ESC %c undefined\n", command); + if_debug1('I', "ESC %c undefined\n", command); else if ( group == 0 ) - if_debug2(mem, 'I', "ESC %c %c undefined\n", class, command); + if_debug2('I', "ESC %c %c undefined\n", class, command); else - if_debug3(mem, 'I', "ESC %c %c %c undefined\n", class, group, command); + if_debug3('I', "ESC %c %c %c undefined\n", class, group, command); } #endif return cdefn; @@ -226,7 +222,7 @@ append_macro(const byte *from, const byte *to, pcl_state_t *pcs) "append_macro"); if ( new_defn == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); memcpy(new_defn + size, from + 1, count); pcs->macro_definition = new_defn; return 0; @@ -275,8 +271,7 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) continue; } /* Invoke the command. */ - cdefn = pcl_get_command_definition(pcs->memory, - pst, + cdefn = pcl_get_command_definition(pst, pst->param_class, pst->param_group, pst->args.command); @@ -355,18 +350,18 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) } #ifdef DEBUG if ( gs_debug_c('i') ) - { dprintf2(pcs->memory, "(ESC %c %c)", + { dprintf2("(ESC %c %c)", pst->param_class, pst->param_group); if ( value_is_present(&avalue) ) - { dputc(pcs->memory, ' '); + { dputc(' '); if ( value_is_signed(&avalue) ) - dputc(pcs->memory, (value_is_neg(&avalue) ? '-' : '+')); + dputc((value_is_neg(&avalue) ? '-' : '+')); if ( value_is_float(&avalue) ) - dprintf1(pcs->memory, "%g", avalue.i + avalue.fraction); + dprintf1("%g", avalue.i + avalue.fraction); else - dprintf1(pcs->memory, "%u", avalue.i); + dprintf1("%u", avalue.i); } - dprintf1(pcs->memory, " %c\n", chr); + dprintf1(" %c\n", chr); } #endif if ( chr >= min_escape_command + 32 && @@ -384,13 +379,12 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) continue; } /* Dispatch on param_class, param_group, and chr. */ - cdefn = pcl_get_command_definition(pcs->memory, - pst, + cdefn = pcl_get_command_definition(pst, pst->param_class, pst->param_group, chr); if ( cdefn ) - { if_debug1(pcs->memory, 'i', " [%s]\n", cdefn->cname); + { if_debug1('i', " [%s]\n", cdefn->cname); code = pcl_adjust_arg(&pst->args, cdefn); if ( code < 0 ) goto x; @@ -402,7 +396,7 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) "command data"); if ( pst->args.data == 0 ) { --p; - code = gs_note_error(pcs->memory, e_Memory); + code = gs_note_error(e_Memory); goto x; } pst->args.data_on_heap = true; @@ -440,14 +434,14 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) --p; goto x; } - if_debug2(pcs->memory, 'i', "%x%x\n", p[0], p[1]); + if_debug2('i', "%x%x\n", p[0], p[1]); code = pcl_text(p, 2, pcs, false); if ( code < 0 ) goto x; /* now pass over the second byte */ p++; cdefn = NULL; } else if ( chr != ESC ) - { if_debug1(pcs->memory, 'i', + { if_debug1('i', (chr == '\\' ? "\\%c\n" : chr >= 33 && chr <= 126 ? "%c\n" : "\\%03o\n"), @@ -472,11 +466,11 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) while ( p < rlimit && p[1] >= 32 && p[1] <= 127 ) - { if_debug1(pcs->memory, 'i', "%c", p[1]); + { if_debug1('i', "%c", p[1]); ++p; } - if_debug0(pcs->memory, 'i', "\n"); + if_debug0('i', "\n"); code = pcl_text(str, (uint)(p + 1 - str), pcs, false); if ( code < 0 ) @@ -490,14 +484,13 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) if ( chr < min_escape_class || chr > max_escape_class ) - { if_debug1(pcs->memory, 'i', + { if_debug1('i', (chr >= 33 && chr <= 126 ? "ESC %c\n" : "ESC \\%03o\n"), chr); cdefn = - pcl_get_command_definition(pcs->memory, - pst, 0, 0, chr); + pcl_get_command_definition(pst, 0, 0, chr); if ( !cdefn ) { /* Skip the ESC, back up @@ -506,7 +499,7 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) --p; continue; } - if_debug1(pcs->memory, 'i', " [%s]\n", + if_debug1('i', " [%s]\n", cdefn->cname); } else @@ -521,7 +514,7 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) chr = 0; } pst->param_group = chr; - if_debug2(pcs->memory, 'i', "ESC %c %c\n", + if_debug2('i', "ESC %c %c\n", pst->param_class, chr); pst->scan_type = scanning_parameter; param_init(); @@ -565,7 +558,7 @@ pcl_process(pcl_parser_state_t *pst, pcl_state_t *pcs, stream_cursor_read *pr) if ( code == e_Unimplemented ) { #if e_Unimplemented != 0 - if_debug0(pcs->memory, 'i', "Unimplemented\n"); + if_debug0('i', "Unimplemented\n"); #endif } else if ( code < 0 ) diff --git a/pcl/pcpatrn.c b/pcl/pcpatrn.c index bc2de8e6d..a354f04ad 100644 --- a/pcl/pcpatrn.c +++ b/pcl/pcpatrn.c @@ -136,12 +136,12 @@ free_ccolor( { pcl_ccolor_t * pccolor = (pcl_ccolor_t *)pvccolor; - pcl_pattern_data_release(pmem, pccolor->ppat_data); - pcl_cs_indexed_release(pmem, pccolor->pindexed); - pcl_cs_base_release(pmem, pccolor->pbase); + pcl_pattern_data_release(pccolor->ppat_data); + pcl_cs_indexed_release(pccolor->pindexed); + pcl_cs_base_release(pccolor->pbase); if (pccolor->prast != 0) gs_free_object(pmem, (void *)pccolor->prast, cname); - gs_pattern_reference(pmem, &(pccolor->ccolor), -1); + gs_pattern_reference(&(pccolor->ccolor), -1); gs_free_object(pmem, pvccolor, cname); } @@ -181,7 +181,7 @@ unshare_ccolor( pold->prast = 0; return 0; } - rc_decrement(pmem, pold, "unshare PCL client color object"); + rc_decrement(pold, "unshare PCL client color object"); rc_alloc_struct_1( pnew, pcl_ccolor_t, @@ -195,11 +195,11 @@ unshare_ccolor( if (pold != 0) { pnew->type = pold->type; - pcl_pattern_data_init_from(pmem, pnew->ppat_data, pold->ppat_data); - pcl_cs_indexed_init_from(pmem, pnew->pindexed, pold->pindexed); - pcl_cs_base_init_from(pmem, pnew->pbase, pold->pbase); + pcl_pattern_data_init_from(pnew->ppat_data, pold->ppat_data); + pcl_cs_indexed_init_from(pnew->pindexed, pold->pindexed); + pcl_cs_base_init_from(pnew->pbase, pold->pbase); pnew->ccolor = pold->ccolor; - gs_pattern_reference(pmem, &(pnew->ccolor), 1); + gs_pattern_reference(&(pnew->ccolor), 1); } else { pnew->type = pcl_ccolor_unpatterned; pnew->ppat_data = 0; @@ -255,7 +255,7 @@ set_unpatterned_color( pcur->type = pcl_ccolor_unpatterned; if (pcur->ppat_data != 0) { - pcl_pattern_data_release(pcs->memory, pcur->ppat_data); + pcl_pattern_data_release(pcur->ppat_data); pcur->ppat_data = 0; } @@ -268,10 +268,10 @@ set_unpatterned_color( } if (code < 0) return code; - pcl_cs_indexed_copy_from(pcs->memory, pcur->pindexed, pindexed); - pcl_cs_base_copy_from(pcs->memory, pcur->pbase, pbase); + pcl_cs_indexed_copy_from(pcur->pindexed, pindexed); + pcl_cs_base_copy_from(pcur->pbase, pbase); - gs_pattern_reference(pcs->memory, &(pcur->ccolor), -1); + gs_pattern_reference(&(pcur->ccolor), -1); pcur->ccolor.pattern = 0; pcur->ccolor.paint = *ppaint; return gs_setcolor(pcs->pgs, &(pcur->ccolor)); @@ -310,7 +310,7 @@ set_patterned_color( /* set the pattern instance */ if ((code = gs_setpattern(pcs->pgs, &(pnew->ccolor))) >= 0) - pcl_ccolor_copy_from(pcs->memory, pcs->pids->pccolor, pnew); + pcl_ccolor_copy_from(pcs->pids->pccolor, pnew); return code; } @@ -384,8 +384,8 @@ check_pattern_rendering( return false; pccolor = pptrn->pmask_ccolor; - pcl_cs_indexed_copy_from(pcs->memory, pccolor->pindexed, pindexed); - pcl_cs_base_copy_from(pcs->memory, pccolor->pbase, pbase); + pcl_cs_indexed_copy_from(pccolor->pindexed, pindexed); + pcl_cs_base_copy_from(pccolor->pbase, pbase); pccolor->ccolor.paint = *ppaint; } } @@ -433,10 +433,10 @@ render_pattern( (pptrn->ref_pt.x != pcs->pat_ref_pt.x) || (pptrn->ref_pt.y != pcs->pat_ref_pt.y) ) { if (type == pcl_ccolor_mask_pattern) { - pcl_ccolor_release(pcs->memory, pptrn->pcol_ccolor); + pcl_ccolor_release(pptrn->pcol_ccolor); pptrn->pcol_ccolor = 0; } else { /* type == pcl_ccolor_colored_pattern */ - pcl_ccolor_release(pcs->memory, pptrn->pmask_ccolor); + pcl_ccolor_release(pptrn->pmask_ccolor); pptrn->pmask_ccolor = 0; } } @@ -456,12 +456,12 @@ render_pattern( return code; /* discard the existing pattern instance */ - gs_pattern_reference(pcs->memory, &(pccolor->ccolor), -1); + gs_pattern_reference(&(pccolor->ccolor), -1); pccolor->ccolor.pattern = 0; /* initialize the pattern data, if the client color is newly allocated */ pccolor->type = type; - pcl_pattern_data_copy_from(pcs->memory, pccolor->ppat_data, pptrn->ppat_data); + pcl_pattern_data_copy_from(pccolor->ppat_data, pptrn->ppat_data); /* set up the transformation and transparency information */ pcl_xfm_get_pat_xfm(pcs, pptrn, &mat); @@ -501,8 +501,8 @@ render_pattern( /* if all is OK, install the pattern; otherwise clear the pattern */ if (code >= 0) { - pcl_cs_indexed_copy_from(pcs->memory, pccolor->pindexed, pindexed); - pcl_cs_base_copy_from(pcs->memory, pccolor->pbase, pbase); + pcl_cs_indexed_copy_from(pccolor->pindexed, pindexed); + pcl_cs_base_copy_from(pccolor->pbase, pbase); if (type == pcl_ccolor_mask_pattern) pccolor->ccolor.paint = *ppaint; code = set_patterned_color(pcs, pccolor); @@ -575,7 +575,7 @@ set_frgrnd_pattern( /* release the extra reference to the indexed color space */ if (colored) { - pcl_cs_indexed_release(pcs->memory, pindexed); + pcl_cs_indexed_release(pindexed); if (code >= 0) { pptrn->pen = 0; pptrn->cache_id = pfrgrnd->id; @@ -627,7 +627,7 @@ set_uncolored_palette_pattern( /* release the extra reference to the indexed color space */ if (colored) { - pcl_cs_indexed_release(pcs->memory, pindexed); + pcl_cs_indexed_release(pindexed); if (code >= 0) { pptrn->pen = pen; pptrn->cache_id = pcs->ppalet->id; @@ -873,12 +873,12 @@ pattern_set_white( /* set the halftone and color space */ if (code >= 0) { code = pcl_ht_set_halftone(pcs, &pdflt_ht, pcl_cspace_RGB, false); - pcl_ht_release(pcs->memory, pdflt_ht); /* decrement reference to local ptr */ + pcl_ht_release(pdflt_ht); /* decrement reference to local ptr */ } if (code >= 0) code = set_unpatterned_color(pcs, NULL, pwhite_cs, &white_paint); - pcl_cs_base_release(pcs->memory, pwhite_cs); + pcl_cs_base_release(pwhite_cs); return code; } @@ -1312,7 +1312,7 @@ set_driver_configuration( if ( ( driver->device_id < 6 ) /* 6 == hp color laserjet */ || /* 7 == hp clj 5 */ ( driver->device_id > 8 ) ) /* 8 == hp 4500 - 4550 */ { - dprintf1(pcs->memory, "unknown device id %d\n", driver->device_id ); + dprintf1("unknown device id %d\n", driver->device_id ); return e_Range; } @@ -1364,7 +1364,7 @@ pattern_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'c', 'G', PCL_COMMAND( "Pattern ID", diff --git a/pcl/pcpatrn.h b/pcl/pcpatrn.h index 1d12febf6..64c799f79 100644 --- a/pcl/pcpatrn.h +++ b/pcl/pcpatrn.h @@ -77,23 +77,23 @@ typedef struct pcl_pattern_data_s { /* * The usual copy, init, and release macros. */ -#define pcl_pattern_data_init_from(mem, pto, pfrom) \ +#define pcl_pattern_data_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_pattern_data_copy_from(mem, pto, pfrom) \ +#define pcl_pattern_data_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_pattern_data_copy_from");\ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_pattern_data_copy_from");\ (pto) = (pfrom); \ } \ END -#define pcl_pattern_data_release(mem, ppat_data) \ - rc_decrement(mem, ppat_data, "pcl_pattern_data_release") +#define pcl_pattern_data_release(ppat_data) \ + rc_decrement(ppat_data, "pcl_pattern_data_release") @@ -265,23 +265,23 @@ struct pcl_ccolor_s { /* * The usual copy, init, and release macros. */ -#define pcl_ccolor_init_from(mem, pto, pfrom) \ +#define pcl_ccolor_init_from(pto, pfrom) \ BEGIN \ - rc_increment(mem, pfrom); \ + rc_increment(pfrom); \ (pto) = (pfrom); \ END -#define pcl_ccolor_copy_from(mem, pto, pfrom) \ +#define pcl_ccolor_copy_from(pto, pfrom) \ BEGIN \ if ((pto) != (pfrom)) { \ - rc_increment(mem, pfrom); \ - rc_decrement(mem, pto, "pcl_ccolor_copy_from"); \ + rc_increment(pfrom); \ + rc_decrement(pto, "pcl_ccolor_copy_from"); \ (pto) = (pfrom); \ } \ END -#define pcl_ccolor_release(mem, pccolor) \ - rc_decrement(mem, pccolor, "pcl_ccolor_release") +#define pcl_ccolor_release(pccolor) \ + rc_decrement(pccolor, "pcl_ccolor_release") /* diff --git a/pcl/pcpatxfm.c b/pcl/pcpatxfm.c index 1087ab86b..1252689b7 100644 --- a/pcl/pcpatxfm.c +++ b/pcl/pcpatxfm.c @@ -93,8 +93,8 @@ pcl_transform_rect(const gs_memory_t *mem, const gs_matrix * pmtx ) { - gs_point_transform(mem, prect1->p.x, prect1->p.y, pmtx, &(prect2->p)); - gs_point_transform(mem, prect1->q.x, prect1->q.y, pmtx, &(prect2->q)); + gs_point_transform(prect1->p.x, prect1->p.y, pmtx, &(prect2->p)); + gs_point_transform(prect1->q.x, prect1->q.y, pmtx, &(prect2->q)); if (prect2->p.x > prect2->q.x) { double ftmp = prect2->p.x; @@ -268,8 +268,7 @@ pcl_xfm_pcl_set_pat_ref_pt( { pcl_xfm_state_t * pxfmst = &(pcs->xfm_state); - gs_point_transform( pcs->memory, - pcs->pcl_pat_ref_pt.x, + gs_point_transform( pcs->pcl_pat_ref_pt.x, pcs->pcl_pat_ref_pt.y, &(pxfmst->lp2dev_mtx), &(pcs->pat_ref_pt) @@ -317,8 +316,7 @@ set_pat_ref_pt( if (rotate <= 1) { pcl_break_underline(pcs); - gs_point_transform( pcs->memory, - (floatp)pcs->cap.x, + gs_point_transform( (floatp)pcs->cap.x, (floatp)pcs->cap.y, &(pcs->xfm_state.pd2lp_mtx), &(pcs->pcl_pat_ref_pt) @@ -341,7 +339,7 @@ xfm_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'p', 'R', PCL_COMMAND( "Pattern Reference Point", diff --git a/pcl/pcrect.c b/pcl/pcrect.c index e2edfc4f1..be32f6d5e 100644 --- a/pcl/pcrect.c +++ b/pcl/pcrect.c @@ -100,7 +100,7 @@ adjust_render_rectangle( gs_point disp; gs_defaultmatrix(pgs, &dflt_mtx); - gs_distance_transform(pcs->memory, 1.0, 1.0, &dflt_mtx, &disp); + gs_distance_transform(1.0, 1.0, &dflt_mtx, &disp); if (disp.x < 0.0) rect.p.x += 1.0; else @@ -228,7 +228,7 @@ pcrect_do_registration( ) { /* Register commands */ - DEFINE_CLASS(mem, '*') + DEFINE_CLASS('*') { 'c', 'H', PCL_COMMAND( "Horizontal Rectangle Size Decipoints", diff --git a/pcl/pcsfont.c b/pcl/pcsfont.c index 903f55c1f..7cfc6a9f7 100644 --- a/pcl/pcsfont.c +++ b/pcl/pcsfont.c @@ -190,7 +190,7 @@ pcl_font_control(pcl_args_t *pargs, pcl_state_t *pcs) pcs->memory, "pcl_font_control()"); if ( plfont == 0 ) { - dprintf(pcs->memory, "pcsfont.c clone font FIXME\n"); + dprintf("pcsfont.c clone font FIXME\n"); return 0; } code = gs_definefont(pcs->font_dir, plfont->pfont); @@ -249,7 +249,7 @@ pcl_font_header(pcl_args_t *pargs, pcl_state_t *pcs) has_checksum = true; break; default: - return_error(mem, gs_error_invalidfont); + return_error(gs_error_invalidfont); } /* Fonts should include a final byte that makes the sum of the @@ -266,7 +266,7 @@ pcl_font_header(pcl_args_t *pargs, pcl_state_t *pcs) } if (sum != 0) { - dprintf(mem, "corrupt font\n"); + dprintf("corrupt font\n"); return e_Range; } } @@ -276,7 +276,7 @@ pcl_font_header(pcl_args_t *pargs, pcl_state_t *pcs) plfont = pl_alloc_font(mem, "pcl_font_header(pl_font_t)"); header = gs_alloc_bytes(mem, count, "pcl_font_header(header)"); if ( plfont == 0 || header == 0 ) - return_error(mem, e_Memory); + return_error(e_Memory); memcpy(header, data, count); plfont->storage = pcds_temporary; plfont->data_are_permanent = false; @@ -313,7 +313,7 @@ bitmap: pfont = gs_alloc_struct(mem, gs_font_base, &st_gs_font_base, "pcl_font_header(bitmap font)"); if ( pfont == 0 ) - return_error(mem, e_Memory); + return_error(e_Memory); code = pl_fill_in_font((gs_font *)pfont, plfont, pcs->font_dir, mem, "nameless_font"); if ( code < 0 ) @@ -373,7 +373,7 @@ bitmap: pfont = gs_alloc_struct(mem, gs_font_base, &st_gs_font_base, pfont = gs_alloc_struct(mem, gs_font_type42, &st_gs_font_type42, "pcl_font_header(truetype font)"); if ( pfont == 0 ) - return_error(mem, e_Memory); + return_error(e_Memory); { uint num_chars = pl_get_uint16(pfh->LastCode); @@ -404,7 +404,7 @@ bitmap: pfont = gs_alloc_struct(mem, gs_font_base, &st_gs_font_base, "pcl_font_header(bitmap font)"); if ( pfont == 0 ) - return_error(mem, e_Memory); + return_error(e_Memory); code = pl_fill_in_font((gs_font *)pfont, plfont, pcs->font_dir, mem, "nameless_font"); if ( code < 0 ) @@ -417,7 +417,7 @@ bitmap: pfont = gs_alloc_struct(mem, gs_font_base, &st_gs_font_base, break; } default: - return_error(mem, gs_error_invalidfont); /* can't happen */ + return_error(gs_error_invalidfont); /* can't happen */ } /* Extract common parameters from the font header. */ plfont->params.symbol_set = pl_get_uint16(pfh->SymbolSet); @@ -467,7 +467,7 @@ pcl_character_data(pcl_args_t *pargs, pcl_state_t *pcs) characters for now, since we don't have real world examples for the other font file formats. */ if ( data[0] != pccd_bitmap && data[3] != 1 ) { - dprintf(pcs->memory, "continuation not implemented for this font type\n"); + dprintf("continuation not implemented for this font type\n"); return e_Unimplemented; } /* append the new data to the new object */ @@ -507,7 +507,7 @@ pcl_character_data(pcl_args_t *pargs, pcl_state_t *pcs) char_data = gs_alloc_bytes(pcs->memory, 16 + width_bytes * height, "pcl_character_data(compressed bitmap)"); if ( char_data == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); memcpy(char_data, data, 16); memset(char_data + 16, 0, width_bytes * height); row = char_data + 16; @@ -609,7 +609,7 @@ pcl_character_data(pcl_args_t *pargs, pcl_state_t *pcs) "pcl_character_data"); memset(char_data, 0, font_data_size); if ( char_data == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); /* if count > font_data_size extra data is ignored */ memcpy(char_data, data, min(count, font_data_size) ); /* NB we only handle continuation for uncompressed bitmap characters */ @@ -715,7 +715,7 @@ pcl_alphanumeric_id_data(pcl_args_t *pargs, pcl_state_t *pcs) char *new_id = (char *)gs_alloc_bytes(pcs->memory, string_id_size, "pcl_alphanumeric_id_data"); if ( new_id == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); /* release the previous id, if necessary */ if ( pcs->alpha_font_id.id ) gs_free_object( pcs->memory, @@ -784,7 +784,7 @@ pcl_alphanumeric_id_data(pcl_args_t *pargs, pcl_state_t *pcs) char *new_id = (char *)gs_alloc_bytes(pcs->memory, string_id_size, "pcl_alphanumeric_id_data"); if ( new_id == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); /* release the previous id, if necessary */ if ( pcs->alpha_macro_id.id ) gs_free_object( pcs->memory, @@ -843,7 +843,7 @@ pcsfont_do_registration( gs_memory_t *mem ) { /* Register commands */ - DEFINE_CLASS(mem, '*') + DEFINE_CLASS('*') {'c', 'D', PCL_COMMAND("Assign Font ID", pcl_assign_font_id, pca_neg_error|pca_big_error)}, @@ -851,13 +851,13 @@ pcsfont_do_registration( PCL_COMMAND("Font Control", pcl_font_control, pca_neg_error|pca_big_error)}, END_CLASS - DEFINE_CLASS_COMMAND_ARGS(mem, ')', 's', 'W', "Font Header", + DEFINE_CLASS_COMMAND_ARGS(')', 's', 'W', "Font Header", pcl_font_header, pca_bytes) - DEFINE_CLASS_COMMAND_ARGS(mem, '*', 'c', 'E', "Character Code", + DEFINE_CLASS_COMMAND_ARGS('*', 'c', 'E', "Character Code", pcl_character_code, pca_neg_error|pca_big_ok) - DEFINE_CLASS_COMMAND_ARGS(mem, '(', 's', 'W', "Character Data", + DEFINE_CLASS_COMMAND_ARGS( '(', 's', 'W', "Character Data", pcl_character_data, pca_bytes) - DEFINE_CLASS_COMMAND_ARGS(mem, '&', 'n', 'W', "Alphanumeric ID Data", + DEFINE_CLASS_COMMAND_ARGS('&', 'n', 'W', "Alphanumeric ID Data", pcl_alphanumeric_id_data, pca_bytes) return 0; } diff --git a/pcl/pcstatus.c b/pcl/pcstatus.c index f3d68ec3e..28f125487 100644 --- a/pcl/pcstatus.c +++ b/pcl/pcstatus.c @@ -693,7 +693,7 @@ pcstatus_do_registration( gs_memory_t *mem ) { /* Register commands */ - DEFINE_CLASS(mem, '*') + DEFINE_CLASS('*') {'s', 'T', PCL_COMMAND("Set Readback Location Type", pcl_set_readback_loc_type, @@ -710,10 +710,10 @@ pcstatus_do_registration( PCL_COMMAND("Free Space", pcl_free_space, pca_neg_ok|pca_big_ok)}, END_CLASS - DEFINE_CLASS_COMMAND_ARGS(mem, '&', 'r', 'F', "Flush All Pages", + DEFINE_CLASS_COMMAND_ARGS('&', 'r', 'F', "Flush All Pages", pcl_flush_all_pages, pca_neg_error|pca_big_error) - DEFINE_CLASS_COMMAND_ARGS(mem, '*', 's', 'X', "Echo", + DEFINE_CLASS_COMMAND_ARGS('*', 's', 'X', "Echo", pcl_echo, pca_neg_ok|pca_big_error) return 0; } diff --git a/pcl/pcsymbol.c b/pcl/pcsymbol.c index 6af5f0f39..993ff6082 100644 --- a/pcl/pcsymbol.c +++ b/pcl/pcsymbol.c @@ -70,7 +70,7 @@ pcl_define_symbol_set(pcl_args_t *pargs, pcl_state_t *pcs) sizeof(pl_symbol_map_t), "pcl_font_header(header)"); if ( header == 0 ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); memcpy((void *)header, (void *)psm, psm_header_size); /* specify that we do not allow these sets to map to and fro msl and unicode */ @@ -98,7 +98,7 @@ pcl_define_symbol_set(pcl_args_t *pargs, pcl_state_t *pcs) symsetp = (pcl_symbol_set_t *)gs_alloc_bytes(mem, sizeof(pcl_symbol_set_t), "symset dict value"); if ( !symsetp ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); for ( gx = plgv_MSL; gx < plgv_next; gx++ ) symsetp->maps[gx] = NULL; symsetp->storage = pcds_temporary; @@ -197,7 +197,7 @@ pcl_load_built_in_symbol_sets(pcl_state_t *pcs) symsetp = (pcl_symbol_set_t *)gs_alloc_bytes(pcs->memory, sizeof(pcl_symbol_set_t), "symset init dict value"); if ( !symsetp ) - return_error(pcs->memory, e_Memory); + return_error(e_Memory); for ( gx = plgv_MSL; gx < plgv_next; gx++ ) symsetp->maps[gx] = NULL; symsetp->storage = pcds_internal; @@ -272,12 +272,12 @@ pcsymbol_do_registration( gs_memory_t *mem ) { /* Register commands */ - DEFINE_CLASS_COMMAND_ARGS(mem, '*', 'c', 'R', "Symbol Set ID Code", + DEFINE_CLASS_COMMAND_ARGS('*', 'c', 'R', "Symbol Set ID Code", pcl_symbol_set_id_code, pca_neg_error|pca_big_error) - DEFINE_CLASS_COMMAND_ARGS(mem, '(', 'f', 'W', "Define Symbol Set", + DEFINE_CLASS_COMMAND_ARGS('(', 'f', 'W', "Define Symbol Set", pcl_define_symbol_set, pca_bytes) - DEFINE_CLASS_COMMAND_ARGS(mem, '*', 'c', 'S', "Symbol Set Control", + DEFINE_CLASS_COMMAND_ARGS('*', 'c', 'S', "Symbol Set Control", pcl_symbol_set_control, pca_neg_ignore|pca_big_ignore) return 0; @@ -300,7 +300,7 @@ pcsymbol_do_reset(pcl_state_t *pcs, pcl_reset_type_t type) /* NB. Symbol sets are require for RTL/HPGL/2 mode for * stickfonts but we shouldn't load all of them. */ if ( pcl_load_built_in_symbol_sets(pcs) < 0 ) - dprintf(pcs->memory, "Internal error, no symbol sets found"); + dprintf("Internal error, no symbol sets found"); } else if ( type & pcl_reset_printer ) { pcl_args_t args; diff --git a/pcl/pctext.c b/pcl/pctext.c index 3af1c2139..94002f115 100644 --- a/pcl/pctext.c +++ b/pcl/pctext.c @@ -176,7 +176,7 @@ get_next_char( /* map the symbol. If it fails to map, quit now. Unless we have a galley character */ - chr = pl_map_symbol(pcs->memory, pcs->map, chr, + chr = pl_map_symbol(pcs->map, chr, plfont->storage == pcds_internal, pl_complement_to_vocab(plfont->character_complement) == plgv_MSL); *pchr = chr; @@ -713,7 +713,7 @@ pcl_text( code = pcl_show_chars_slow(pcs, &scale, str, size, literal); gs_setmatrix(pgs, &user_ctm); if (code > 0) /* shouldn't happen */ - code = gs_note_error(pcs->memory, gs_error_invalidfont); + code = gs_note_error(gs_error_invalidfont); return code; } @@ -923,9 +923,9 @@ pctext_do_registration( ) { /* Register commands */ - DEFINE_CONTROL(mem, 0, "(plain char)", pcl_plain_char); + DEFINE_CONTROL(0, "(plain char)", pcl_plain_char); - DEFINE_CLASS(mem, '&') + DEFINE_CLASS('&') { 'p', 'X', PCL_COMMAND("Transparent Mode", pcl_transparent_mode, pca_bytes) @@ -946,7 +946,7 @@ pctext_do_registration( }, END_CLASS - DEFINE_CLASS(mem, '&') + DEFINE_CLASS('&') { 't', 'P', PCL_COMMAND( "Text Parsing Method", @@ -963,7 +963,7 @@ pctext_do_registration( }, END_CLASS - DEFINE_CONTROL(mem, 1, "(plain char)", pcl_plain_char); /* default "command" */ + DEFINE_CONTROL(1, "(plain char)", pcl_plain_char); /* default "command" */ return 0; } diff --git a/pcl/pctop.c b/pcl/pctop.c index c6d26663a..17a188d04 100644 --- a/pcl/pctop.c +++ b/pcl/pctop.c @@ -498,7 +498,7 @@ pcl_impl_report_errors( uint count; while ( (count = pcl_status_read(buf, sizeof(buf), &pcli->pcs)) != 0 ) - errwrite(pcli->memory, buf, count); + errwrite(buf, count); return 0; } @@ -525,19 +525,17 @@ pcl_impl_remove_device( /* return to the original graphic state w/color mapper, bbox, target */ code = pcl_grestore(&pcli->pcs); if (code < 0 ) - dprintf1(pcli->memory, - "error code %d restoring gstate, continuing\n", code ); + dprintf1("error code %d restoring gstate, continuing\n", code ); /* return to original gstate w/bbox, target */ code = gs_grestore_only(pcli->pcs.pgs); /* destroys gs_save stack */ if (code < 0 ) - dprintf1(pcli->memory, - "error code %d destroying gstate, continuing\n", code ); + dprintf1("error code %d destroying gstate, continuing\n", code ); /* Deselect bbox. Bbox has been prevented from auto-closing/deleting */ code = gs_nulldevice(pcli->pcs.pgs); if ( code < 0 ) - dprintf1(pcli->memory, - "error code %d installing nulldevice, continuing\n", code ); + dprintf1("error code %d installing nulldevice, continuing\n", code ); + //return pcl_do_resets(&pcli->pcs, pcl_reset_printer); return pcl_do_resets(&pcli->pcs, pcl_reset_permanent); } @@ -551,7 +549,7 @@ pcl_impl_deallocate_interp_instance( gs_memory_t *mem = pcli->memory; /* free memory used by the parsers */ if ( pcl_parser_shutdown(&pcli->pst, mem ) < 0 ) { - dprintf(mem, "Undefined error shutting down parser, continuing\n" ); + dprintf("Undefined error shutting down parser, continuing\n" ); } /* this should have a shutdown procedure like pcl above */ gs_free_object(mem, @@ -563,7 +561,7 @@ pcl_impl_deallocate_interp_instance( /* free halftone cache in gs state */ // NB gs_free_ht_cache(mem, pcli->pcs.pgs); - gs_state_free_view_clip(pcli->pcs.pgs); + // NB might not be needed in 8.53 // gs_state_free_view_clip(pcli->pcs.pgs); gs_state_free(pcli->pcs.pgs); /* remove pcl's gsave grestore stack */ pcl_free_gstate_stk(&pcli->pcs); diff --git a/pcl/pcuptrn.c b/pcl/pcuptrn.c index a0ee8fb17..8fd1cf880 100644 --- a/pcl/pcuptrn.c +++ b/pcl/pcuptrn.c @@ -103,11 +103,11 @@ free_pattern_rendering(const gs_memory_t *mem, ) { if (pptrn->pcol_ccolor != 0) { - pcl_ccolor_release(mem, pptrn->pcol_ccolor); + pcl_ccolor_release(pptrn->pcol_ccolor); pptrn->pcol_ccolor = 0; } if (pptrn->pmask_ccolor != 0) { - pcl_ccolor_release(mem, pptrn->pmask_ccolor); + pcl_ccolor_release(pptrn->pmask_ccolor); pptrn->pmask_ccolor = 0; } } @@ -127,7 +127,7 @@ pcl_pattern_free_pattern( free_pattern_rendering(pmem, pptrn); if (pptrn->ppat_data != 0) - pcl_pattern_data_release(pmem, pptrn->ppat_data); + pcl_pattern_data_release(pptrn->ppat_data); gs_free_object(pmem, pvptrn, cname); } @@ -557,7 +557,7 @@ upattern_do_registration( gs_memory_t * pmem ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'c', 'W', PCL_COMMAND("Download Pattern", download_pcl_pattern, pca_bytes) diff --git a/pcl/pcursor.c b/pcl/pcursor.c index 5344bc919..8c573e4d9 100644 --- a/pcl/pcursor.c +++ b/pcl/pcursor.c @@ -544,7 +544,7 @@ horiz_cursor_pos_units( ) { if ( pcs->personality == rtl ) - dprintf(pcs->memory, "Warning: device/resolution dependent units used\n" ); + dprintf("Warning: device/resolution dependent units used\n" ); do_horiz_motion(pargs, pcs, pcs->uom_cp, true); return 0; } @@ -635,7 +635,7 @@ vert_cursor_pos_units( ) { if ( pcs->personality == rtl ) - dprintf(pcs->memory, "Warning: device/resolution dependent units used\n" ); + dprintf("Warning: device/resolution dependent units used\n" ); return do_vertical_move(pcs, pargs, pcs->uom_cp, false, false, false, true); } @@ -706,14 +706,14 @@ push_pop_cursor( ppt->x = (double)pcs->cap.x; ppt->y = (double)pcs->cap.y; - gs_point_transform( pcs->memory, ppt->x, ppt->y, &(pcs->xfm_state.pd2lp_mtx), ppt); + gs_point_transform( ppt->x, ppt->y, &(pcs->xfm_state.pd2lp_mtx), ppt); } else if ((type == 1) && (pcs->cursor_stk_size > 0)) { gs_point * ppt = &(pcs->cursor_stk[--pcs->cursor_stk_size]); gs_matrix lp2pd; pcl_invert_mtx(&(pcs->xfm_state.pd2lp_mtx), &lp2pd); - gs_point_transform(pcs->memory, ppt->x, ppt->y, &lp2pd, ppt); + gs_point_transform(ppt->x, ppt->y, &lp2pd, ppt); pcl_set_cap_x(pcs, (coord)ppt->x, false, false); pcl_set_cap_y( pcs, (coord)ppt->y - pcs->margins.top, @@ -760,7 +760,7 @@ pcursor_do_registration( ) { - DEFINE_CLASS(pmem, '&') + DEFINE_CLASS('&') { 'k', 'H', PCL_COMMAND( "Horizontal Motion Index", @@ -826,7 +826,7 @@ pcursor_do_registration( }, END_CLASS - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'p', 'X', PCL_COMMAND( "Horizontal Cursor Position Units", @@ -843,12 +843,12 @@ pcursor_do_registration( }, END_CLASS - DEFINE_CONTROL(pmem, CR, "CR", cmd_CR) - DEFINE_CONTROL(pmem, BS, "BS", cmd_BS) - DEFINE_CONTROL(pmem, HT, "HT", cmd_HT) - DEFINE_ESCAPE(pmem, '=', "Half Line Feed", half_line_feed) - DEFINE_CONTROL(pmem, LF, "LF", cmd_LF) - DEFINE_CONTROL(pmem, FF, "FF", cmd_FF) + DEFINE_CONTROL(CR, "CR", cmd_CR) + DEFINE_CONTROL(BS, "BS", cmd_BS) + DEFINE_CONTROL(HT, "HT", cmd_HT) + DEFINE_ESCAPE('=', "Half Line Feed", half_line_feed) + DEFINE_CONTROL(LF, "LF", cmd_LF) + DEFINE_CONTROL(FF, "FF", cmd_FF) return 0; } diff --git a/pcl/pcxfmst.h b/pcl/pcxfmst.h index 2bc76a630..624a71aa7 100644 --- a/pcl/pcxfmst.h +++ b/pcl/pcxfmst.h @@ -135,8 +135,7 @@ typedef struct pcl_xfm_state_s { * Convert a point from "semi print direction" space to logical page space. */ #define pcl_xfm_to_logical_page_space(pcs, ppt) \ - gs_point_transform( pcs->memory, \ - (ppt)->x, \ + gs_point_transform( (ppt)->x, \ (ppt)->y, \ &((pcs)->xfm_state.pd2lp_mtx), \ ppt \ diff --git a/pcl/pgconfig.c b/pcl/pgconfig.c index da0c4845b..a8b572d78 100644 --- a/pcl/pgconfig.c +++ b/pcl/pgconfig.c @@ -72,7 +72,7 @@ hpgl_CO(hpgl_args_t *pargs, hpgl_state_t *pgls) } break; default: - dprintf(pgls->memory, "HPGL CO automata is in an unknown state\n" ); + dprintf("HPGL CO automata is in an unknown state\n" ); pargs->source.ptr = p; return 0; } @@ -306,7 +306,7 @@ hpgl_picture_frame_coords(hpgl_state_t *pgls, gs_int_rect *gl2_win) gs_rect pcl_win; /* pcl window */ gs_currentmatrix(pgls->pgs, &mat); - hpgl_call(gs_bbox_transform_inverse(pgls->memory, &dev_win, &mat, &pcl_win)); + hpgl_call(gs_bbox_transform_inverse(&dev_win, &mat, &pcl_win)); /* Round all coordinates to the nearest integer. */ #define set_round(e) gl2_win->e = (int)floor(pcl_win.e + 0.5) set_round(p.x); @@ -565,8 +565,7 @@ hpgl_SC(hpgl_args_t *pargs, hpgl_state_t *pgls) type = hpgl_scaling_none; hpgl_compute_user_units_to_plu_ctm(pgls, &umat); /* in-place */ - hpgl_call(gs_bbox_transform(pgls->memory, - &pgls->g.soft_clip_window.rect, + hpgl_call(gs_bbox_transform(&pgls->g.soft_clip_window.rect, &umat, &pgls->g.soft_clip_window.rect)); pgls->g.soft_clip_window.isbound = true; diff --git a/pcl/pgdraw.c b/pcl/pgdraw.c index dae55613a..530afad76 100644 --- a/pcl/pgdraw.c +++ b/pcl/pgdraw.c @@ -52,7 +52,7 @@ hpgl_set_picture_frame_scaling(hpgl_state_t *pgls) (pgls->g.picture_frame_width == 0) || (pgls->g.plot_width == 0) || (pgls->g.plot_height == 0) ) { - dprintf(pgls->memory, "bad picture frame coordinates\n"); + dprintf("bad picture frame coordinates\n"); return 0; } else if ( pgls->g.scaling_type != hpgl_scaling_point_factor ) { hpgl_real_t vert_scale = (pgls->g.plot_size_vertical_specified) ? @@ -165,7 +165,7 @@ hpgl_compute_user_units_to_plu_ctm(const hpgl_state_t *pgls, gs_matrix *pmat) hpgl_call(gs_make_translation(origin_x, origin_y, pmat)); hpgl_call(gs_matrix_scale(pmat, pgls->g.scaling_params.factor.x, pgls->g.scaling_params.factor.y, pmat)); - hpgl_call(gs_matrix_translate(pgls->memory, pmat, + hpgl_call(gs_matrix_translate(pmat, -pgls->g.scaling_params.pmin.x, -pgls->g.scaling_params.pmin.y, pmat)); break; @@ -197,7 +197,7 @@ hpgl_compute_user_units_to_plu_ctm(const hpgl_state_t *pgls, gs_matrix *pmat) hpgl_call(gs_make_translation(origin_x, origin_y, pmat)); hpgl_call(gs_matrix_scale(pmat, scale_x, scale_y, pmat)); - hpgl_call(gs_matrix_translate(pgls->memory, pmat, + hpgl_call(gs_matrix_translate(pmat, -pgls->g.scaling_params.pmin.x, -pgls->g.scaling_params.pmin.y, pmat)); break; @@ -248,7 +248,7 @@ hpgl_get_line_pattern_length(hpgl_state_t *pgls) isotropic_user_box.p = pgls->g.scaling_params.pmin; isotropic_user_box.q = pgls->g.scaling_params.pmax; - hpgl_call(gs_bbox_transform(pgls->memory, &isotropic_user_box, + hpgl_call(gs_bbox_transform(&isotropic_user_box, &user_to_plu_mat, &isotropic_plu_box)); @@ -423,8 +423,7 @@ vector: default: /* shouldn't happen; we must have a mode to properly parse hpgl file. */ - dprintf(pgls->memory, - "warning no hpgl rendering mode set using vector mode\n"); + dprintf("warning no hpgl rendering mode set using vector mode\n"); goto vector; } @@ -484,8 +483,7 @@ hpgl_set_clipping_region(hpgl_state_t *pgls, hpgl_rendering_mode_t render_mode) pcl_clip_box.q.x = pcl_clip_box.p.x + pgls->g.picture_frame_width; pcl_clip_box.q.y = pcl_clip_box.p.y + pgls->g.picture_frame_height; - hpgl_call(gs_bbox_transform(pgls->memory, - &pcl_clip_box, + hpgl_call(gs_bbox_transform(&pcl_clip_box, &pcl_ctm, &dev_clip_box)); /* the clip box defined by the picture frame appears to be @@ -509,8 +507,7 @@ hpgl_set_clipping_region(hpgl_state_t *pgls, hpgl_rendering_mode_t render_mode) } else { hpgl_call(gs_currentmatrix(pgls->pgs, &ctm)); } - hpgl_call(gs_bbox_transform(pgls->memory, - &pgls->g.soft_clip_window.rect, + hpgl_call(gs_bbox_transform(&pgls->g.soft_clip_window.rect, &ctm, &dev_soft_window_box)); /* Enlarge IW by 1 device dot to compensate for it's @@ -889,7 +886,7 @@ hpgl_set_drawing_color( goto fill; default: - dprintf(pgls->memory, "hpgl_set_drawing_color: internal error illegal fill\n"); + dprintf("hpgl_set_drawing_color: internal error illegal fill\n"); return 0; } break; @@ -956,7 +953,7 @@ fill: break; default: - dprintf(pgls->memory, "hpgl_set_drawing_color: internal error illegal fill\n"); + dprintf("hpgl_set_drawing_color: internal error illegal fill\n"); break; } break; @@ -1001,13 +998,13 @@ fill: break; default: - dprintf(pgls->memory, "hpgl_set_drawing_color: internal error illegal fill\n"); + dprintf("hpgl_set_drawing_color: internal error illegal fill\n"); break; } break; default: - dprintf(pgls->memory, "hpgl_set_drawing_color: internal error illegal mode\n"); + dprintf("hpgl_set_drawing_color: internal error illegal mode\n"); break; } @@ -1383,8 +1380,7 @@ hpgl_set_special_pixel_placement(hpgl_state_t *pgls, hpgl_rendering_mode_t rende adjust.y = -1; /* determine the adjustment in device space */ hpgl_call(gs_defaultmatrix(pgls->pgs, &default_matrix)); - hpgl_call(gs_distance_transform(pgls->memory, - adjust.x, adjust.y, &default_matrix, &distance)); + hpgl_call(gs_distance_transform(adjust.x, adjust.y, &default_matrix, &distance)); /* translate all points in the path by the adjustment. */ hpgl_call(gx_path_translate(ppath, float2fixed(distance.x / fabs(distance.x)), @@ -1548,7 +1544,7 @@ hpgl_draw_current_path( break; } default : - dprintf(pgls->memory, "unknown render mode\n"); + dprintf("unknown render mode\n"); } return 0; diff --git a/pcl/pgfdata.c b/pcl/pgfdata.c index 9283d8235..8a1114422 100644 --- a/pcl/pgfdata.c +++ b/pcl/pgfdata.c @@ -5072,12 +5072,12 @@ hpgl_stick_segments(const gs_memory_t *mem, void *data, uint char_index) i += 3; } else - return_error(mem, gs_error_invalidfont); + return_error(gs_error_invalidfont); } /* table must be corrupt if the loop didn't stop at stop */ if ( i != stop ) - return_error(mem, gs_error_invalidfont); + return_error(gs_error_invalidfont); return 0; } @@ -5120,12 +5120,12 @@ hpgl_arc_segments(const gs_memory_t *mem, void *data, uint char_index) i += 7; } else - return_error(mem, gs_error_invalidfont); + return_error(gs_error_invalidfont); } /* table must be corrupt if the loop didn't stop at stop */ if ( i != stop ) - return_error(mem, gs_error_invalidfont); + return_error(gs_error_invalidfont); return 0; } diff --git a/pcl/pgframe.c b/pcl/pgframe.c index 540ea7a4d..044256694 100644 --- a/pcl/pgframe.c +++ b/pcl/pgframe.c @@ -187,7 +187,7 @@ pgframe_do_registration( gs_memory_t *mem ) { /* Register commands */ - DEFINE_CLASS(mem, '*') + DEFINE_CLASS('*') {'c', 'X', PCL_COMMAND("Horizontal Picture Frame Size Decipoints", pcl_horiz_pic_frame_size_decipoints, @@ -209,7 +209,7 @@ pgframe_do_registration( pcl_hpgl_plot_vert_size, pca_neg_error|pca_big_error)}, END_CLASS - DEFINE_CLASS(mem, '%') + DEFINE_CLASS('%') {0, 'A', PCL_COMMAND("Enter PCL Mode", pcl_enter_pcl_mode, diff --git a/pcl/pginit.c b/pcl/pginit.c index 8fe3a3ea2..7fabaa0d0 100644 --- a/pcl/pginit.c +++ b/pcl/pginit.c @@ -164,7 +164,7 @@ hpgl_do_reset( if ((type & pcl_reset_picture_frame) != 0) { /* this shouldn't happen. Picture frame side effects are handled directly by the command picture frame command. */ - dprintf(pcs->memory, "PCL reset picture frame received\n"); + dprintf("PCL reset picture frame received\n"); } if ((type & pcl_reset_overlay) != 0) @@ -174,7 +174,7 @@ hpgl_do_reset( if ((type & (pcl_reset_plot_size)) != 0) { /* this shouldn't happen. Plot size side effects are handled directly by the command picture frame command. */ - dprintf(pcs->memory, "PCL reset plot received\n"); + dprintf("PCL reset plot received\n"); } if ((type & (pcl_reset_permanent)) != 0 ) { diff --git a/pcl/pglabel.c b/pcl/pglabel.c index 4fe3555d7..39820fd75 100644 --- a/pcl/pglabel.c +++ b/pcl/pglabel.c @@ -83,7 +83,7 @@ hpgl_map_symbol(uint chr, const hpgl_state_t *pgls) &pgls->g.font_selection[pgls->g.font_selected]; const pl_symbol_map_t *psm = pfs->map; - return pl_map_symbol(pgls->memory, psm, chr, + return pl_map_symbol(psm, chr, pfs->font->storage == pcds_internal, false); } @@ -141,7 +141,7 @@ hpgl_select_stick_font(hpgl_state_t *pgls) if ( pfont == 0 ) - return_error(pgls->memory, e_Memory); + return_error(e_Memory); code = pl_fill_in_font((gs_font *)pfont, font, pgls->font_dir, pgls->memory, "stick/arc font"); if ( code < 0 ) @@ -339,7 +339,7 @@ hpgl_slant_transform_distance(hpgl_state_t *pgls, gs_point *dxy, gs_point *s_dxy gs_point tmp_dxy = *dxy; gs_make_identity(&smat); smat.yx = pgls->g.character.slant; - hpgl_call(gs_distance_transform(pgls->memory, tmp_dxy.x, tmp_dxy.y, &smat, s_dxy)); + hpgl_call(gs_distance_transform(tmp_dxy.x, tmp_dxy.y, &smat, s_dxy)); } return 0; } @@ -359,7 +359,7 @@ hpgl_rotation_transform_distance(hpgl_state_t *pgls, gs_point *dxy, gs_point *r_ rmat.xy = rise / denom; rmat.yx = -rmat.xy; rmat.yy = rmat.xx; - hpgl_call(gs_distance_transform(pgls->memory, tmp_dxy.x, tmp_dxy.y, &rmat, r_dxy)); + hpgl_call(gs_distance_transform(tmp_dxy.x, tmp_dxy.y, &rmat, r_dxy)); } return 0; } @@ -420,7 +420,7 @@ hpgl_move_cursor_by_characters(hpgl_state_t *pgls, hpgl_real_t spaces, gs_matrix mat; gs_point user_dxy; hpgl_call(hpgl_compute_user_units_to_plu_ctm(pgls, &mat)); - hpgl_call(gs_distance_transform_inverse(pgls->memory, dx, dy, &mat, &user_dxy)); + hpgl_call(gs_distance_transform_inverse(dx, dy, &mat, &user_dxy)); dx = user_dxy.x; dy = user_dxy.y; } @@ -523,7 +523,7 @@ hpgl_buffer_char(hpgl_state_t *pgls, byte ch) "hpgl_resize_label_buffer"); if ( new_mem == 0 ) - return_error(pgls->memory, e_Memory); + return_error(e_Memory); pgls->g.label.buffer = new_mem; pgls->g.label.buffer_size = new_size; } @@ -1046,7 +1046,7 @@ hpgl_get_character_origin_offset(hpgl_state_t *pgls, int origin, } break; default: - dprintf(pgls->memory, "unknown label parameter"); + dprintf("unknown label parameter"); } /* a relative move to the new position */ @@ -1324,7 +1324,7 @@ hpgl_LB(hpgl_args_t *pargs, hpgl_state_t *pgls) have_16bits = !have_16bits; prev_ch = ch; ch = *++p; - if_debug1(pgls->memory, 'I', + if_debug1('I', (ch == '\\' ? " \\%c" : ch >= 33 && ch <= 126 ? " %c" : " \\%03o"), ch); diff --git a/pcl/pgmisc.c b/pcl/pgmisc.c index e86c7f374..9c9fefacc 100644 --- a/pcl/pgmisc.c +++ b/pcl/pgmisc.c @@ -33,7 +33,7 @@ hpgl_set_lost_mode(hpgl_state_t *pgls, hpgl_lost_mode_t lost_mode) hpgl_PU(&args, pgls); #endif #ifdef DEBUG - dprintf(pgls->memory, "entering lost mode\n"); + dprintf("entering lost mode\n"); #endif } pgls->g.lost_mode = lost_mode; @@ -48,8 +48,7 @@ int hpgl_print_error(const gs_memory_t *mem, const char *function, const char *file, int line, int code) { - dprintf4(mem, - "hpgl call failed\n\tcalled from: %s\n\tfile: %s\n\tline: %d\n\terror code: %d\n", + dprintf4("hpgl call failed\n\tcalled from: %s\n\tfile: %s\n\tline: %d\n\terror code: %d\n", (function == 0 ? "" : function), file, line, code); hpgl_error(); return code; diff --git a/pcl/pgparse.c b/pcl/pgparse.c index 17fcdfc7f..8ae4cf1e4 100644 --- a/pcl/pgparse.c +++ b/pcl/pgparse.c @@ -59,7 +59,7 @@ hpgl_define_commands(const gs_memory_t *mem, const hpgl_named_command_t *pcmds, &pcmd->defn) #ifdef DEBUG ) - dprintf2(mem, "Redefining command %c%c\n", pcmd->char1, pcmd->char2); + dprintf2("Redefining command %c%c\n", pcmd->char1, pcmd->char2); #endif ; } @@ -92,7 +92,7 @@ hpgl_process(hpgl_parser_state_t *pst, hpgl_state_t *pgls, pr->ptr = pst->source.ptr; if ( code < 0 && code != e_NeedData ) { pst->command = 0; /* cancel command */ - if_debug0(pgls->memory, 'i', "\n"); + if_debug0('i', "\n"); return code; } return 0; @@ -106,7 +106,7 @@ call: if ( pst->command ) if ( code < 0 ) goto x; pst->command = 0; - if_debug0(pgls->memory, 'i', "\n"); + if_debug0('i', "\n"); } while ( p < rlimit ) { byte next = *++p; @@ -136,7 +136,7 @@ call: if ( pst->command ) #ifdef DEBUG if ( gs_debug_c('i') ) { char c = (index ? '-' : '?'); - dprintf4(pgls->memory, "--%c%c%c%c", pst->first_letter + 'A', + dprintf4("--%c%c%c%c", pst->first_letter + 'A', next + 'A', c, c); } #endif @@ -308,11 +308,11 @@ out: pst->source.ptr = p; case 0: /* no argument */ return false; case 1: /* integer */ - if_debug1(mem, 'I', " %ld", (long)pvalue->v_n.i); + if_debug1('I', " %ld", (long)pvalue->v_n.i); pvalue->is_real = false; break; default /* case 2 */: /* real */ - if_debug1(mem, 'I', " %g", pvalue->v_n.r); + if_debug1('I', " %g", pvalue->v_n.r); pvalue->is_real = true; } hpgl_arg_init(pst); diff --git a/pcl/pgvector.c b/pcl/pgvector.c index 2caaf0212..4c36caaba 100644 --- a/pcl/pgvector.c +++ b/pcl/pgvector.c @@ -406,7 +406,7 @@ hpgl_PE(hpgl_args_t *pargs, hpgl_state_t *pgls) hpgl_call(hpgl_draw_current_path(pgls, hpgl_rm_vector)); return 0; case ':': - if_debug0(pgls->memory, 'I', "\n PE SP"); + if_debug0('I', "\n PE SP"); { int32 pen; if ( !pe_args(pgls->memory, pargs, &pen, 1) ) @@ -424,11 +424,11 @@ hpgl_PE(hpgl_args_t *pargs, hpgl_state_t *pgls) p = pargs->source.ptr; continue; case '<': - if_debug0(pgls->memory, 'I', "\n PE PU"); + if_debug0('I', "\n PE PU"); pargs->phase |= pe_pen_up; continue; case '>': - if_debug0(pgls->memory, 'I', "\n PE PD"); + if_debug0('I', "\n PE PD"); { int32 fbits; if ( !pe_args(pgls->memory, pargs, &fbits, 1) ) @@ -443,11 +443,11 @@ hpgl_PE(hpgl_args_t *pargs, hpgl_state_t *pgls) p = pargs->source.ptr; continue; case '=': - if_debug0(pgls->memory, 'I', " PE ABS"); + if_debug0('I', " PE ABS"); pargs->phase |= pe_absolute; continue; case '7': - if_debug0(pgls->memory, 'I', "\n PE 7bit"); + if_debug0('I', "\n PE 7bit"); pargs->phase |= pe_7bit; continue; case ESC: @@ -543,7 +543,7 @@ pe_args(const gs_memory_t *mem, hpgl_args_t *pargs, int32 *pvalues, int count) } } pvalues[i] = (value & 1 ? -(value >> 1) : value >> 1); - if_debug1(mem, 'I', " [%ld]", (long)pvalues[i] ); + if_debug1('I', " [%ld]", (long)pvalues[i] ); } pargs->source.ptr = p; return true; diff --git a/pcl/rtgmode.c b/pcl/rtgmode.c index 40a477aec..4a2e3cdca 100644 --- a/pcl/rtgmode.c +++ b/pcl/rtgmode.c @@ -201,12 +201,12 @@ pcl_enter_graphics_mode( cur_pt.x = (double)pcs->cap.x; cur_pt.y = (double)pcs->cap.y; pcl_xfm_to_logical_page_space(pcs, &cur_pt); - gs_point_transform(pcs->memory, cur_pt.x, cur_pt.y, &lp2rst, &cur_pt); + gs_point_transform(cur_pt.x, cur_pt.y, &lp2rst, &cur_pt); /* translate the origin of the forward transformation */ if (((int)mode & 0x1) != 0) gmargin_cp = cur_pt.x; - gs_matrix_translate(pcs->memory, &rst2lp, gmargin_cp, cur_pt.y, &rst2lp); + gs_matrix_translate(&rst2lp, gmargin_cp, cur_pt.y, &rst2lp); prstate->gmargin_cp = gmargin_cp; /* set the matrix scale */ @@ -337,7 +337,7 @@ pcl_end_graphics_mode( /* transform the new point back to "pseudo print direction" space */ pcl_invert_mtx(&(pcs->xfm_state.pd2dev_mtx), &dev2pd); - gs_point_transform(pcs->memory, cur_pt.x, cur_pt.y, &dev2pd, &cur_pt); + gs_point_transform(cur_pt.x, cur_pt.y, &dev2pd, &cur_pt); pcl_set_cap_x(pcs, (coord)(cur_pt.x + 0.5), false, false); return pcl_set_cap_y( pcs, (coord)(cur_pt.y + 0.5) - pcs->margins.top, @@ -606,7 +606,7 @@ gmode_do_registration( gs_memory_t * pmem /* ignored */ ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 't', 'R', PCL_COMMAND( "Raster Graphics Resolution", diff --git a/pcl/rtmisc.c b/pcl/rtmisc.c index b21e0dcf3..bc169cd86 100644 --- a/pcl/rtmisc.c +++ b/pcl/rtmisc.c @@ -168,7 +168,7 @@ rtmisc_do_registration( { /* Register commands */ /* Chapter 4 */ - DEFINE_CLASS(mem, '%') + DEFINE_CLASS('%') /* Chapter 18 */ { 0, 'B', @@ -187,7 +187,7 @@ rtmisc_do_registration( END_CLASS /* Comparison Guide */ - DEFINE_CLASS(mem, '&') + DEFINE_CLASS('&') { 'b', 'W', PCL_COMMAND( "Appletalk Configuration", diff --git a/pcl/rtraster.c b/pcl/rtraster.c index ef963a371..cde2f8551 100644 --- a/pcl/rtraster.c +++ b/pcl/rtraster.c @@ -1090,7 +1090,7 @@ pcl_start_raster( prast->transparent = false; prast->src_height_set = pcs->raster_state.src_height_set; prast->pcs = pcs; - pcl_cs_indexed_init_from(pcs->memory, prast->pindexed, pindexed); + pcl_cs_indexed_init_from(prast->pindexed, pindexed); prast->pen = 0; prast->plane_index = 0; @@ -1258,11 +1258,11 @@ pcl_complete_raster(pcl_state_t *pcs) } if (prast->pindexed != 0) { - pcl_cs_indexed_release(pcs->memory, prast->pindexed); + pcl_cs_indexed_release(prast->pindexed); prast->pindexed = 0; } if (prast->mask_pindexed != 0) { - pcl_cs_indexed_release(pcs->memory, prast->mask_pindexed); + pcl_cs_indexed_release(prast->mask_pindexed); prast->mask_pindexed = 0; } @@ -1382,7 +1382,7 @@ raster_do_registration( gs_memory_t * pmem /* ignored */ ) { - DEFINE_CLASS(pmem, '*') + DEFINE_CLASS('*') { 'b', 'V', PCL_COMMAND( "Transfer Raster Plane", |