summaryrefslogtreecommitdiff
path: root/print/ghostscript-gpl/files
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2007-03-27 19:59:21 +0000
committerRong-En Fan <rafan@FreeBSD.org>2007-03-27 19:59:21 +0000
commit20352fa29823ad73e4f06d086dc9598d1a274ab8 (patch)
tree8dca0c9c79381ab1af57f988e6007e2e7b2e40fa /print/ghostscript-gpl/files
parentClean up CXXFLAGS. Fix compilation with gcc-4.1.x. (diff)
- Update to 8.56
- Switch to GTK 2.x - SWitch to ship-in jasper which contains some fixes for gs PR: ports/110818 Submitted by: KATO Tsuguru <tkato432 at yahoo.com>
Notes
Notes: svn path=/head/; revision=188581
Diffstat (limited to 'print/ghostscript-gpl/files')
-rw-r--r--print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c63
-rw-r--r--print/ghostscript-gpl/files/patch-alps__gdevalps.c22
-rw-r--r--print/ghostscript-gpl/files/patch-epag__gdevepag.c37
-rw-r--r--print/ghostscript-gpl/files/patch-gdev10v__gdev10v.c23
-rw-r--r--print/ghostscript-gpl/files/patch-jbig2dec__os_types.h11
-rw-r--r--print/ghostscript-gpl/files/patch-lex7000__src__gdevlx7.c31
-rw-r--r--print/ghostscript-gpl/files/patch-lib-gs_setpd.ps98
-rw-r--r--print/ghostscript-gpl/files/patch-lib::gs_ttf.ps23
-rw-r--r--print/ghostscript-gpl/files/patch-lib:gs_init.ps16
-rw-r--r--print/ghostscript-gpl/files/patch-lib__ps2epsi.CAN-2004-096719
-rw-r--r--print/ghostscript-gpl/files/patch-lib__pv.sh.CAN-2004-096716
-rw-r--r--print/ghostscript-gpl/files/patch-lips:gdevl4r.c81
-rw-r--r--print/ghostscript-gpl/files/patch-lips__gdevespg.c20
-rw-r--r--print/ghostscript-gpl/files/patch-lips__gdevlprn.c35
-rw-r--r--print/ghostscript-gpl/files/patch-lips__gdevnpdl.c20
-rw-r--r--print/ghostscript-gpl/files/patch-lips__gdevrpdl.c20
-rw-r--r--print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c32
-rw-r--r--print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c20
-rw-r--r--print/ghostscript-gpl/files/patch-mjc:gdevmjc.c40
-rw-r--r--print/ghostscript-gpl/files/patch-pcl3__eprn__gdeveprn.c180
-rw-r--r--print/ghostscript-gpl/files/patch-src-gdevdmpr.c78
-rw-r--r--print/ghostscript-gpl/files/patch-src-gdevijs.c48
-rw-r--r--print/ghostscript-gpl/files/patch-src:fapi_ft.c12
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevccr.c15
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevcd8.c20
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevcp50.c18
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevdj9.c22
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevgdi.c32
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevifno.c15
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevlx50.c49
-rw-r--r--print/ghostscript-gpl/files/patch-src:gdevmgr.c17
-rw-r--r--print/ghostscript-gpl/files/patch-src:genarch.c34
-rw-r--r--print/ghostscript-gpl/files/patch-src:gxobj.h8
-rw-r--r--print/ghostscript-gpl/files/patch-src:unix-dll.mak60
-rw-r--r--print/ghostscript-gpl/files/patch-src:unix-gcc.mak49
-rw-r--r--print/ghostscript-gpl/files/patch-src:zmedia2.c25
-rw-r--r--print/ghostscript-gpl/files/patch-src__gdevperm.c11
37 files changed, 887 insertions, 433 deletions
diff --git a/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c b/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c
deleted file mode 100644
index 4afb11ef9e51..000000000000
--- a/print/ghostscript-gpl/files/e-patch-src-gdevdmpr.c
+++ /dev/null
@@ -1,63 +0,0 @@
---- src/gdevdmpr.c.orig Tue May 13 20:43:37 1997
-+++ src/gdevdmpr.c Tue May 24 21:41:23 2005
-@@ -41,7 +41,7 @@
- /* include library header. */
- #include "dviprlib.h"
-
--extern FILE *lib_fopen(P1(const char *));
-+extern FILE *lib_fopen(const char *);
-
- #define LOCAL_DEBUG 0
-
-@@ -87,12 +87,12 @@
- private dev_proc_close_device(gdev_dmprt_close);
-
- /* declarations of sub functions to get printer properties. */
--private void gdev_dmprt_init_printer_props(P1(gx_device_dmprt *));
--private int gdev_dmprt_get_printer_props(P2(gx_device_dmprt *,char *));
--private int gdev_dmprt_check_code_props(P2(byte * ,int ));
--private FILE *gdev_dmprt_dviprt_lib_fopen(P2(const char *,char *));
-+private void gdev_dmprt_init_printer_props(gx_device_dmprt *);
-+private int gdev_dmprt_get_printer_props(gx_device_dmprt *,char *);
-+private int gdev_dmprt_check_code_props(byte * ,int );
-+private FILE *gdev_dmprt_dviprt_lib_fopen(const char *,char *);
-
--private int gdev_dmprt_error_no_dviprt_to_gs(P1(int ));
-+private int gdev_dmprt_error_no_dviprt_to_gs(int );
-
- /* The device descriptor */
- gx_device_procs prn_dmprt_procs = {
-@@ -833,6 +833,7 @@
- return code;
- }
-
-+private const char * gp_file_name_concat_string(const char *, unsigned);
- private FILE *
- gdev_dmprt_dviprt_lib_fopen(const char *fnamebase,char *fname)
- {
-@@ -845,8 +846,7 @@
- env = getenv("TEXCFG");
- if (env) {
- strcpy(fname,env);
-- strcat(fname,
-- gp_file_name_concat_string(env,strlen(env),fname,strlen(fnamebase)));
-+ strcat(fname, gp_file_name_concat_string(env,strlen(env)));
- strcat(fname,fnamebase);
- fp = fopen(fname,gp_fmode_rb);
- }
-@@ -867,4 +867,15 @@
- default:
- return -1;
- }
-+}
-+
-+/* Answer the string to be used for combining a directory/device prefix */
-+/* with a base file name. The prefix directory/device is examined to */
-+/* determine if a separator is needed and may return an empty string */
-+private const char *
-+gp_file_name_concat_string(const char *prefix, unsigned plen)
-+{
-+ if (plen > 0 && prefix[plen - 1] == '/')
-+ return "";
-+ return "/";
- }
diff --git a/print/ghostscript-gpl/files/patch-alps__gdevalps.c b/print/ghostscript-gpl/files/patch-alps__gdevalps.c
new file mode 100644
index 000000000000..ad77a9e9af10
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-alps__gdevalps.c
@@ -0,0 +1,22 @@
+--- alps/gdevalps.c.orig Wed Nov 24 09:28:35 1999
++++ alps/gdevalps.c Fri Dec 17 19:12:35 2004
+@@ -173,7 +173,7 @@
+ {
+ int lnum;
+ int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
+- byte *data = (byte *)gs_malloc(8, line_size, "md50_print_page(data)" );
++ byte *data = (byte *)gs_malloc(pdev->memory, 8, line_size, "md50_print_page(data)" );
+ int skipping = 0;
+ int nbyte;
+ int nskip;
+@@ -232,8 +232,8 @@
+ {
+ int lnum;
+ int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
+- byte *data = (byte *)gs_malloc(8, line_size, "md1xm_print_page(data)");
+- byte *out_start = (byte *)gs_malloc(8, line_size, "md1xm_print_page(data)");
++ byte *data = (byte *)gs_malloc(pdev->memory, 8, line_size, "md1xm_print_page(data)");
++ byte *out_start = (byte *)gs_malloc(pdev->memory, 8, line_size, "md1xm_print_page(data)");
+ int skipping = 0;
+ int nbyte;
+
diff --git a/print/ghostscript-gpl/files/patch-epag__gdevepag.c b/print/ghostscript-gpl/files/patch-epag__gdevepag.c
new file mode 100644
index 000000000000..f3823f24998b
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-epag__gdevepag.c
@@ -0,0 +1,37 @@
+--- epag/gdevepag.c.orig Sat Jul 8 13:33:09 2000
++++ epag/gdevepag.c Thu May 26 00:12:48 2005
+@@ -417,15 +417,15 @@
+ cont->maxY = epag_cont.cRowBuf / cont->bh * cont->bh ;
+ if(cont->maxY < cont->bh) cont->maxY = cont->bh;
+
+- cont->bp = gs_malloc(bpl , cont->maxY, "epag_skip_blank_init(bp)");
+- cont->bp2 = gs_malloc(bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
++ cont->bp = gs_malloc(pdev->memory, bpl , cont->maxY, "epag_skip_blank_init(bp)");
++ cont->bp2 = gs_malloc(pdev->memory, bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
+
+ cont->h = cont->r = 0;
+
+- cont->bubbleTbl=gs_malloc(sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
++ cont->bubbleTbl=gs_malloc(pdev->memory, sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
+ for(i=0;i<cont->maxBx;i++)
+ cont->bubbleTbl[i] = NULL;
+- cont->bubbleBuffer=gs_malloc(sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
++ cont->bubbleBuffer=gs_malloc(pdev->memory, sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
+ bbtbl = (EpagBubble *)cont->bubbleBuffer;
+ for(i=0;i<cont->maxBx-1;i++)
+ bbtbl[i].next = &bbtbl[i+1];
+@@ -436,9 +436,11 @@
+ private void
+ epag_page_close(EpagPageCont *cont)
+ {
+- gs_free(cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
+- gs_free(cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
+- gs_free(cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
++ gx_device* pdev;
++
++ gs_free(pdev->memory, cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
++ gs_free(pdev->memory, cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
++ gs_free(pdev->memory, cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
+ }
+
+ private int
diff --git a/print/ghostscript-gpl/files/patch-gdev10v__gdev10v.c b/print/ghostscript-gpl/files/patch-gdev10v__gdev10v.c
new file mode 100644
index 000000000000..46887cfad39c
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-gdev10v__gdev10v.c
@@ -0,0 +1,23 @@
+--- gdev10v/gdev10v.c.orig Sat Dec 11 04:10:45 1993
++++ gdev10v/gdev10v.c Fri Dec 17 19:15:49 2004
+@@ -152,8 +152,8 @@
+ int bytes_per_column = bits_per_column / 8;
+ int x_skip_unit = bytes_per_column * (xres / 180);
+ int y_skip_unit = (yres / 180);
+- byte *in = (byte *)gs_malloc(8, line_size, "bj10v_print_page(in)");
+- byte *out = (byte *)gs_malloc(bits_per_column, line_size, "bj10v_print_page(out)");
++ byte *in = (byte *)gs_malloc(pdev->memory, 8, line_size, "bj10v_print_page(in)");
++ byte *out = (byte *)gs_malloc(pdev->memory, bits_per_column, line_size, "bj10v_print_page(out)");
+ int lnum = 0;
+ int y_skip = 0;
+ int code = 0;
+@@ -275,7 +275,7 @@
+ /* Eject the page */
+ xit: prn_putc(pdev, 014); /* form feed */
+ prn_flush(pdev);
+- gs_free((char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
+- gs_free((char *)in, 8, line_size, "bj10v_print_page(in)");
++ gs_free(pdev->memory, (char *)out, bits_per_column, line_size, "bj10v_print_page(out)");
++ gs_free(pdev->memory, (char *)in, 8, line_size, "bj10v_print_page(in)");
+ return code;
+ }
diff --git a/print/ghostscript-gpl/files/patch-jbig2dec__os_types.h b/print/ghostscript-gpl/files/patch-jbig2dec__os_types.h
new file mode 100644
index 000000000000..4ce75024cc04
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-jbig2dec__os_types.h
@@ -0,0 +1,11 @@
+--- jbig2dec/os_types.h.orig Thu Dec 29 04:56:24 2005
++++ jbig2dec/os_types.h Sun May 28 01:10:59 2006
+@@ -47,7 +47,7 @@
+
+ #if defined(HAVE_STDINT_H) || defined(__MACOS__)
+ # include <stdint.h>
+-#elif defined(__VMS)
++#elif defined(__VMS) || defined(__FreeBSD__)
+ # include <inttypes.h>
+ #endif
+
diff --git a/print/ghostscript-gpl/files/patch-lex7000__src__gdevlx7.c b/print/ghostscript-gpl/files/patch-lex7000__src__gdevlx7.c
new file mode 100644
index 000000000000..d3a72fa97dd3
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lex7000__src__gdevlx7.c
@@ -0,0 +1,31 @@
+--- lex7000/src/gdevlx7.c.orig Fri Dec 31 17:22:48 2004
++++ lex7000/src/gdevlx7.c Fri Dec 31 17:24:39 2004
+@@ -615,14 +615,14 @@
+ dprintf2("Current resolution is %f width x %f height dpi\n",
+ pdev->x_pixels_per_inch, pdev->y_pixels_per_inch );
+ #endif
+- pbuf = (byte *)gs_malloc(rpbufsize, 1, "lxmgen_print_page(pbuf)");
++ pbuf = (byte *)gs_malloc(pdev->memory, rpbufsize, 1, "lxmgen_print_page(pbuf)");
+ if (pbuf == NULL)
+ return_error(gs_error_VMerror);
+
+- outbuf = (byte *)gs_malloc(OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
++ outbuf = (byte *)gs_malloc(pdev->memory, OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
+ if (outbuf == NULL)
+ {
+- gs_free((char*)pbuf,pbufsize, 1, "lxmgen_print_page(pbuf)");
++ gs_free(pdev->memory, (char*)pbuf,pbufsize, 1, "lxmgen_print_page(pbuf)");
+ return_error(gs_error_VMerror);
+ }
+ /* initialize begin of outbuf ... */
+@@ -799,8 +799,8 @@
+
+ /* eject page */
+ lex_eject(prn_stream);
+- gs_free((char*)pbuf,rpbufsize, 1, "lxmgen_print_page(pbuf)");
+- gs_free((char*)outbuf,OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
++ gs_free(pdev->memory, (char*)pbuf,rpbufsize, 1, "lxmgen_print_page(pbuf)");
++ gs_free(pdev->memory, (char*)outbuf,OUT_BUF_SIZE, 1, "lxmgen_print_page(outbuf)");
+
+ #ifdef DEBUG
+ dprintf1("[%s] print_page() end\n",pdev->dname);
diff --git a/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps b/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps
deleted file mode 100644
index 2bd645bb99fe..000000000000
--- a/print/ghostscript-gpl/files/patch-lib-gs_setpd.ps
+++ /dev/null
@@ -1,98 +0,0 @@
---- lib/gs_setpd.ps.orig Tue Sep 14 07:32:19 2004
-+++ lib/gs_setpd.ps Tue May 24 22:20:49 2005
-@@ -377,21 +377,42 @@
- /MediaPosition { dup //null ne { pop //null } if } bind
- .dicttomark readonly def
-
--% Define the keys used in input attribute matching.
--/.inputattrkeys [
-- /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
-- % The following are documented in Adobe's supplement for v2017.
-- /LeadingEdge /MediaClass
--] readonly def
--% Define other keys used in media selection.
--/.inputselectionkeys [
-- /MediaPosition /Orientation
--] readonly def
--
--% Define the keys used in output attribute matching.
--/.outputattrkeys [
-- /OutputType
--] readonly def
-+% M. Sweet, Easy Software Products:
-+%
-+% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
-+% selection policies for setpagedevice. This is used by CUPS to support
-+% the standard Adobe media attributes.
-+NOMEDIAATTRS {
-+ % Define only PageSize for input attribute matching.
-+ /.inputattrkeys [
-+ /PageSize
-+ ] readonly def
-+ % Define no other keys used in media selection.
-+ /.inputselectionkeys [
-+ /noInputSelectionsKeys
-+ ] readonly def
-+
-+ % Define no keys used in output attribute matching.
-+ /.outputattrkeys [
-+ /noOutputAttrKeys
-+ ] readonly def
-+} {
-+ % Define the keys used in input attribute matching.
-+ /.inputattrkeys [
-+ /PageSize /MediaColor /MediaWeight /MediaType /InsertSheet
-+ % The following are documented in Adobe's supplement for v2017.
-+ /LeadingEdge /MediaClass
-+ ] readonly def
-+ % Define other keys used in media selection.
-+ /.inputselectionkeys [
-+ /MediaPosition /Orientation
-+ ] readonly def
-+
-+ % Define the keys used in output attribute matching.
-+ /.outputattrkeys [
-+ /OutputType
-+ ] readonly def
-+} ifelse
-
- % Define all the parameters that should always be copied to the merged
- % dictionary.
-@@ -420,7 +441,13 @@
- /PageSize //false % obsolete alias for .MediaSize
- /InputAttributes //false
- .inputattrkeys
-- { dup /PageSize eq
-+ % M. Sweet, Easy Software Products:
-+ %
-+ % Treat LeadingEdge like PageSize so that a common Ghostscript driver
-+ % doesn't need the NOMEDIAATTRS definition.
-+ %
-+ % { dup /PageSize eq
-+ { dup dup /PageSize eq exch /LeadingEdge eq or
- { pop }
- { { 2 index /InputAttributes .knownget { //null eq } { //true } ifelse } }
- ifelse
-@@ -501,11 +528,22 @@
- % They are expected to consume the top 2 operands.
- % NOTE: we currently treat all values other than 0, 1, or 7 (for PageSize)
- % the same as 0, i.e., we signal an error.
-+%
-+% M. Sweet, Easy Software Products:
-+%
-+% Define NOMEDIAATTRS to turn off the default (but unimplementable) media
-+% selection policies for setpagedevice. This is used by CUPS to support
-+% the standard Adobe media attributes.
- 0 { % Set errorinfo and signal a configurationerror.
-+ NOMEDIAATTRS {
-+ % NOMEDIAATTRS means that the default policy is 7...
-+ pop 2 index exch 7 put
-+ } {
- pop dup 4 index exch get 2 array astore
- $error /errorinfo 3 -1 roll put
- cleartomark
- /setpagedevice load /configurationerror signalerror
-+ } ifelse
- } bind
- 1 { % Roll back the failed request to its previous status.
- SETPDDEBUG { (Rolling back.) = pstack flush } if
diff --git a/print/ghostscript-gpl/files/patch-lib::gs_ttf.ps b/print/ghostscript-gpl/files/patch-lib::gs_ttf.ps
index aeec34bd0c60..ba745a856a26 100644
--- a/print/ghostscript-gpl/files/patch-lib::gs_ttf.ps
+++ b/print/ghostscript-gpl/files/patch-lib::gs_ttf.ps
@@ -1,22 +1,13 @@
---- lib/gs_ttf.ps.orig Sat Feb 14 04:43:51 2004
-+++ lib/gs_ttf.ps Mon Jun 7 12:51:44 2004
-@@ -519,7 +519,7 @@
- (maxp) 1 index
- (name) 1 index
- (OS/2) 1 index
-- (post) 1 index
-+ (post) { .readbigtable }
- (vhea) 1 index
- % Big tables
- (glyf) { .readbigtable }
-@@ -854,10 +854,17 @@
+--- lib/gs_ttf.ps.orig Tue Feb 6 20:07:48 2007
++++ lib/gs_ttf.ps Sat Mar 24 16:15:49 2007
+@@ -997,10 +997,17 @@
} ifelse
% Stack: ... /FontInfo mark key1 value1 ...
post null ne {
-- /ItalicAngle post 4 gets32 65536.0 div
-- /isFixedPitch post 12 getu32 0 ne
-- /UnderlinePosition post 8 gets16 upem div
-- /UnderlineThickness post 10 gets16 upem div
+- /ItalicAngle first_post_string 4 gets32 65536.0 div
+- /isFixedPitch first_post_string 12 getu32 0 ne
+- /UnderlinePosition first_post_string 8 gets16 upem div
+- /UnderlineThickness first_post_string 10 gets16 upem div
+ post type /arraytype eq {
+ % this post table is a big table. /post should be [(...) ...]
+ % data we actually need here should be first one in array.
diff --git a/print/ghostscript-gpl/files/patch-lib:gs_init.ps b/print/ghostscript-gpl/files/patch-lib:gs_init.ps
index 22d48fd79896..11ec1bba61cd 100644
--- a/print/ghostscript-gpl/files/patch-lib:gs_init.ps
+++ b/print/ghostscript-gpl/files/patch-lib:gs_init.ps
@@ -1,14 +1,6 @@
---- lib/gs_init.ps.orig Tue Sep 7 00:40:52 2004
-+++ lib/gs_init.ps Tue May 24 22:19:25 2005
-@@ -122,6 +122,7 @@
- currentdict /DELAYBIND known /DELAYBIND exch def
- currentdict /DISKFONTS known /DISKFONTS exch def
- currentdict /DOINTERPOLATE .knownget { /INTERPOLATE exch def } if
-+currentdict /NOMEDIAATTRS known /NOMEDIAATTRS exch def
- currentdict /ESTACKPRINT known /ESTACKPRINT exch def
- currentdict /FAKEFONTS known /FAKEFONTS exch def
- currentdict /FIXEDMEDIA known /FIXEDMEDIA exch def
-@@ -1420,7 +1421,7 @@
+--- lib/gs_init.ps.orig Sat Mar 5 07:02:23 2005
++++ lib/gs_init.ps Thu Apr 21 13:05:43 2005
+@@ -1440,7 +1440,7 @@
% Set the default screen and BG/UCR.
/.setdefaultbgucr {
systemdict /setblackgeneration known {
@@ -17,7 +9,7 @@
} if
} bind def
/.useloresscreen { % - .useloresscreen <bool>
-@@ -2199,3 +2200,7 @@
+@@ -2241,3 +2241,7 @@
ifelse
% The interpreter will run the initial procedure (start).
diff --git a/print/ghostscript-gpl/files/patch-lib__ps2epsi.CAN-2004-0967 b/print/ghostscript-gpl/files/patch-lib__ps2epsi.CAN-2004-0967
new file mode 100644
index 000000000000..c1b1cbcc3fbe
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lib__ps2epsi.CAN-2004-0967
@@ -0,0 +1,19 @@
+--- lib/ps2epsi.orig Thu May 25 02:19:27 2006
++++ lib/ps2epsi Fri Mar 23 10:55:11 2007
+@@ -5,14 +5,8 @@
+ # executable name set in the makefile
+ GS_EXECUTABLE=gs
+
+-# try to create a temporary file securely
+-tmpdir=/tmp/ps2epsi.$$
+-(umask 077 && mkdir $tmpdir)
+-if test ! -d $tmpdir; then
+- echo "failed: could not create temporary file"
+- exit 1
+-fi
+-tmpfile=$tmpdir/ps2epsi$$
++tmpfile=`mktemp -t ps2epsi.XXXXXX || exit 1`
++trap "rm -rf $tmpfile" 0 1 2 3 7 13 15
+
+ export outfile
+
diff --git a/print/ghostscript-gpl/files/patch-lib__pv.sh.CAN-2004-0967 b/print/ghostscript-gpl/files/patch-lib__pv.sh.CAN-2004-0967
new file mode 100644
index 000000000000..a37fc43aada9
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lib__pv.sh.CAN-2004-0967
@@ -0,0 +1,16 @@
+--- lib/pv.sh.orig Mon Nov 28 02:18:26 2005
++++ lib/pv.sh Mon Nov 28 02:18:59 2005
+@@ -29,9 +29,10 @@
+ PAGE=$1
+ shift
+ FILE=$1
++TEMPFILE=`mktemp -t ${FILE}XXXXXX` || exit 1
+ shift
+-trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15
++trap "rm -rf $TEMPFILE" 0 1 2 15
+ #dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
+-dvips -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
+-gs $FILE.$$.pv
++dvips -p $PAGE -n 1 $FILE $* -o $TEMPFILE
++gs $TEMPFILE
+ exit 0
diff --git a/print/ghostscript-gpl/files/patch-lips:gdevl4r.c b/print/ghostscript-gpl/files/patch-lips:gdevl4r.c
index 353ec2399a84..e7ab9d0ecbe2 100644
--- a/print/ghostscript-gpl/files/patch-lips:gdevl4r.c
+++ b/print/ghostscript-gpl/files/patch-lips:gdevl4r.c
@@ -1,5 +1,5 @@
--- lips/gdevl4r.c.orig Thu Nov 2 12:09:18 2000
-+++ lips/gdevl4r.c Tue Jan 13 01:28:40 2004
++++ lips/gdevl4r.c Fri Dec 17 19:19:02 2004
@@ -53,8 +53,8 @@
#define lips_device(dtype, procs, dname, xdpi, ydpi, lm, bm, rm, tm, color_bits,\
print_page_copies, image_out, cassetFeed, username)\
@@ -36,6 +36,85 @@
private int lips4type_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, int num_copies, int ptype);
private int
+@@ -597,7 +602,7 @@
+ /* Initialize printer. */
+ lips_job_start(pdev, ptype, prn_stream, num_copies);
+
+- if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
++ if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
+ return_error(gs_error_VMerror);
+
+
+@@ -607,7 +612,7 @@
+ if (code < 0)
+ return code;
+
+- gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
++ gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
+
+ /* eject page */
+ lips_job_end(pdev, prn_stream);
+@@ -641,9 +646,9 @@
+
+ if (pdev->color_info.depth == 1)
+ {
+- if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
++ if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf)")))
+ return_error(gs_error_VMerror);
+- if (!(lprn->CompBuf2 = gs_malloc(bpl * 3 / 2 + 1, maxY, "(CompBuf2)")))
++ if (!(lprn->CompBuf2 = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "(CompBuf2)")))
+ return_error(gs_error_VMerror);
+
+ if (lprn->NegativePrint) {
+@@ -663,8 +668,8 @@
+ if (code < 0)
+ return code;
+
+- gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
+- gs_free(lprn->CompBuf2, bpl * 3 / 2 + 1, maxY, "(CompBuf2)");
++ gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "(CompBuf)");
++ gs_free(pdev->memory, lprn->CompBuf2, bpl * 3 / 2 + 1, maxY, "(CompBuf2)");
+ }
+ else
+ {
+@@ -903,15 +908,15 @@
+ int lnum = 0;
+
+ /* Memory Allocate */
+- if (!(pBuff = (byte *) gs_malloc(nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)")))
++ if (!(pBuff = (byte *) gs_malloc(pdev->memory, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)")))
+ return_error(gs_error_VMerror);
+- if (!(prevBuff = (byte *) gs_malloc(nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)")))
++ if (!(prevBuff = (byte *) gs_malloc(pdev->memory, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)")))
+ return_error(gs_error_VMerror);
+- if (!(ComBuff = (byte *) gs_malloc(Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)")))
++ if (!(ComBuff = (byte *) gs_malloc(pdev->memory, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)")))
+ return_error(gs_error_VMerror);
+- if (!(TotalBuff = (byte *) gs_malloc((Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)")))
++ if (!(TotalBuff = (byte *) gs_malloc(pdev->memory, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)")))
+ return_error(gs_error_VMerror);
+- if (!(diffBuff = (byte *) gs_malloc(Xpixel * num_components * 2, sizeof(byte), "lips_print_page")))
++ if (!(diffBuff = (byte *) gs_malloc(pdev->memory, Xpixel * num_components * 2, sizeof(byte), "lips_print_page")))
+ return_error(gs_error_VMerror);
+
+ /* make output data */
+@@ -927,11 +932,11 @@
+ pdev->height - (lnum - NUM_LINES_4C));
+ }
+ /* Free Memory */
+- gs_free(pBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)");
+- gs_free(prevBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)");
+- gs_free(ComBuff, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)");
+- gs_free(TotalBuff, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)");
+- gs_free(diffBuff, Xpixel * num_components * 2, sizeof(byte), "lips_print_page");
++ gs_free(pdev->memory, pBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(pBuff)");
++ gs_free(pdev->memory, prevBuff, nBytesPerLine, sizeof(byte), "lips4c_compress_output_page(prevBuff)");
++ gs_free(pdev->memory, ComBuff, Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128, sizeof(byte), "lips4c_compress_output_page(ComBuff)");
++ gs_free(pdev->memory, TotalBuff, (Xpixel * num_components + (Xpixel * num_components + 127) * 129 / 128) * NUM_LINES_4C, sizeof(byte), "lips4c_compress_output_page(TotalBuff)");
++ gs_free(pdev->memory, diffBuff, Xpixel * num_components * 2, sizeof(byte), "lips_print_page");
+
+ return 0;
+ }
@@ -1065,11 +1070,25 @@
if (paper_size == USER_SIZE) {
fprintf(prn_stream, "%c2 I", LIPS_CSI);
diff --git a/print/ghostscript-gpl/files/patch-lips__gdevespg.c b/print/ghostscript-gpl/files/patch-lips__gdevespg.c
new file mode 100644
index 000000000000..ae28dffd626e
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lips__gdevespg.c
@@ -0,0 +1,20 @@
+--- lips/gdevespg.c.orig Thu Nov 2 12:09:18 2000
++++ lips/gdevespg.c Fri Dec 17 19:39:57 2004
+@@ -142,7 +142,7 @@
+ if (pdev->PageCount == 0)
+ escpage_printer_initialize(pdev, fp, num_coipes);
+
+- if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)")))
++ if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)")))
+ return_error(gs_error_VMerror);
+
+ if (lprn->NegativePrint) {
+@@ -154,7 +154,7 @@
+ if (code < 0)
+ return code;
+
+- gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)");
++ gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "lp2000_print_page_copies(CompBuf)");
+
+ if (pdev->Duplex)
+ fprintf(fp, "%c0dpsE", GS);
diff --git a/print/ghostscript-gpl/files/patch-lips__gdevlprn.c b/print/ghostscript-gpl/files/patch-lips__gdevlprn.c
new file mode 100644
index 000000000000..236cc5a3a8f5
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lips__gdevlprn.c
@@ -0,0 +1,35 @@
+--- lips/gdevlprn.c.orig Thu Nov 2 12:09:18 2000
++++ lips/gdevlprn.c Fri Dec 17 19:21:08 2004
+@@ -219,13 +219,13 @@
+ maxBy = (pdev->height + lprn->nBh - 1) / lprn->nBh;
+ maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
+
+- if (!(lprn->ImageBuf = gs_malloc(bpl, maxY, "lprn_print_image(ImageBuf)")))
++ if (!(lprn->ImageBuf = gs_malloc(pdev->memory, bpl, maxY, "lprn_print_image(ImageBuf)")))
+ return_error(gs_error_VMerror);
+- if (!(lprn->TmpBuf = gs_malloc(bpl, maxY, "lprn_print_iamge(TmpBuf)")))
++ if (!(lprn->TmpBuf = gs_malloc(pdev->memory, bpl, maxY, "lprn_print_iamge(TmpBuf)")))
+ return_error(gs_error_VMerror);
+- if (!(lprn->bubbleTbl = gs_malloc(sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)")))
++ if (!(lprn->bubbleTbl = gs_malloc(pdev->memory, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)")))
+ return_error(gs_error_VMerror);
+- if (!(bubbleBuffer = gs_malloc(sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)")))
++ if (!(bubbleBuffer = gs_malloc(pdev->memory, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)")))
+ return_error(gs_error_VMerror);
+
+ for (i = 0; i < maxBx; i++)
+@@ -261,10 +261,10 @@
+ }
+ lprn_bubble_flush_all(pdev, fp); /* flush the rest of bubble */
+
+- gs_free(lprn->ImageBuf, bpl, maxY, "lprn_print_image(ImageBuf)");
+- gs_free(lprn->TmpBuf, bpl, maxY, "lprn_print_iamge(TmpBuf)");
+- gs_free(lprn->bubbleTbl, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)");
+- gs_free(bubbleBuffer, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)");
++ gs_free(pdev->memory, lprn->ImageBuf, bpl, maxY, "lprn_print_image(ImageBuf)");
++ gs_free(pdev->memory, lprn->TmpBuf, bpl, maxY, "lprn_print_iamge(TmpBuf)");
++ gs_free(pdev->memory, lprn->bubbleTbl, sizeof(Bubble *), maxBx, "lprn_print_image(bubbleTbl)");
++ gs_free(pdev->memory, bubbleBuffer, sizeof(Bubble), maxBx, "lprn_print_image(bubbleBuffer)");
+
+ return code;
+ }
diff --git a/print/ghostscript-gpl/files/patch-lips__gdevnpdl.c b/print/ghostscript-gpl/files/patch-lips__gdevnpdl.c
new file mode 100644
index 000000000000..ad237e348f15
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lips__gdevnpdl.c
@@ -0,0 +1,20 @@
+--- lips/gdevnpdl.c.orig Thu Nov 2 12:09:18 2000
++++ lips/gdevnpdl.c Fri Dec 31 17:32:52 2004
+@@ -582,7 +582,7 @@
+ int code;
+ int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
+
+- if (!(lprn->CompBuf = gs_malloc(line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)")))
++ if (!(lprn->CompBuf = gs_malloc(pdev->memory, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)")))
+ return_error(gs_error_VMerror);
+
+
+@@ -680,7 +680,7 @@
+ /* Form Feed */
+ fputs("\014", prn_stream);
+
+- gs_free(lprn->CompBuf, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)");
++ gs_free(pdev->memory, lprn->CompBuf, line_size * maxY, sizeof(byte), "npdl_print_page_copies(CompBuf)");
+ return 0;
+ }
+
diff --git a/print/ghostscript-gpl/files/patch-lips__gdevrpdl.c b/print/ghostscript-gpl/files/patch-lips__gdevrpdl.c
new file mode 100644
index 000000000000..8673cb716108
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-lips__gdevrpdl.c
@@ -0,0 +1,20 @@
+--- lips/gdevrpdl.c.orig Thu Nov 2 12:09:18 2000
++++ lips/gdevrpdl.c Fri Dec 31 17:34:04 2004
+@@ -81,7 +81,7 @@
+ if (pdev->PageCount == 0)
+ rpdl_printer_initialize(pdev, prn_stream, num_coipes);
+
+- if (!(lprn->CompBuf = gs_malloc(bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)")))
++ if (!(lprn->CompBuf = gs_malloc(pdev->memory, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)")))
+ return_error(gs_error_VMerror);
+
+ lprn->NegativePrint = false; /* Not Support */
+@@ -90,7 +90,7 @@
+ if (code < 0)
+ return code;
+
+- gs_free(lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)");
++ gs_free(pdev->memory, lprn->CompBuf, bpl * 3 / 2 + 1, maxY, "rpdl_print_page_copies(CompBuf)");
+
+ fprintf(prn_stream, "\014"); /* Form Feed */
+
diff --git a/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c b/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c
index fef3a6452e40..e4b45a4bece2 100644
--- a/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c
+++ b/print/ghostscript-gpl/files/patch-lxm3200:gdevlx32.c
@@ -1,5 +1,5 @@
--- lxm3200/gdevlx32.c.orig Wed Apr 23 01:06:20 2003
-+++ lxm3200/gdevlx32.c Thu May 15 08:24:08 2003
++++ lxm3200/gdevlx32.c Thu May 26 00:11:50 2005
@@ -422,9 +422,11 @@
* of the nearest color.
*/
@@ -23,3 +23,33 @@
break;
}
+@@ -732,10 +734,10 @@
+ /* Allocate memory for the buffers and
+ * verify that the allocation was done properly.
+ */
+- gendata.scanbuf = (byte *)gs_malloc(gendata.numbytes, gendata.numblines,
++ gendata.scanbuf = (byte *)gs_malloc(pdev->memory, gendata.numbytes, gendata.numblines,
+ "lxm3200_print_page(scanbuf)");
+
+- gendata.outdata = (byte *)gs_malloc(gendata.numbytes, 30,
++ gendata.outdata = (byte *)gs_malloc(pdev->memory, gendata.numbytes, 30,
+ "lxm3200_print_page(outdata)");
+
+ if(gendata.scanbuf == NULL ||
+@@ -943,12 +945,14 @@
+ private void
+ freeresources(void)
+ {
++ gx_device *pdev;
++
+ if(gendata.scanbuf)
+- gs_free((char *)gendata.scanbuf, gendata.numbytes, gendata.numblines,
++ gs_free(pdev->memory, (char *)gendata.scanbuf, gendata.numbytes, gendata.numblines,
+ "lxm3200:freeresources(scanbuf)");
+
+ if(gendata.outdata)
+- gs_free((char *)gendata.outdata, gendata.numbytes, 30,
++ gs_free(pdev->memory, (char *)gendata.outdata, gendata.numbytes, 30,
+ "lxm3200:freeresources(outdata)");
+ }
+
diff --git a/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c b/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c
index 4b1049db015c..1aeeb74be38f 100644
--- a/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c
+++ b/print/ghostscript-gpl/files/patch-md2k:gdevmd2k.c
@@ -1,5 +1,23 @@
--- md2k/gdevmd2k.c.orig Sun May 2 14:07:57 1999
-+++ md2k/gdevmd2k.c Fri Nov 8 07:29:13 2002
++++ md2k/gdevmd2k.c Fri Dec 17 19:10:22 2004
+@@ -495,7 +495,7 @@
+ int i, j;
+
+ /* allocate memory */
+- work = (byte *)gs_malloc(3+sizeof(int), line_size,
++ work = (byte *)gs_malloc(pdev->memory, 3+sizeof(int), line_size,
+ "alps_print_page(work)");
+ if (work == 0)
+ return_error(gs_error_VMerror);
+@@ -597,7 +597,7 @@
+ "\033\052\162\103"
+ "\033\045\0\130", 1, 9, prn_stream);
+
+- gs_free((char *)work, 3+sizeof(int), line_size, "alps_print_page(work)");
++ gs_free(pdev->memory, (char *)work, 3+sizeof(int), line_size, "alps_print_page(work)");
+ return 0;
+ }
+
@@ -638,11 +638,13 @@
(k) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
diff --git a/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c b/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c
index ffdae781ffa1..862e9f1801c2 100644
--- a/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c
+++ b/print/ghostscript-gpl/files/patch-mjc:gdevmjc.c
@@ -1,5 +1,5 @@
--- mjc/gdevmjc.c.orig Sat Nov 2 17:58:50 1996
-+++ mjc/gdevmjc.c Sun Nov 10 21:37:22 2002
++++ mjc/gdevmjc.c Fri Dec 31 16:24:50 2004
@@ -43,7 +43,8 @@
#include <limits.h>
#include "gdevprn.h"
@@ -259,6 +259,30 @@
private int
+@@ -988,7 +980,7 @@
+
+ /* NOZ */
+ xtalbuff_size = plane_size*8 + 64;
+- xtalbuff = (short *) gs_malloc( xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
++ xtalbuff = (short *) gs_malloc(pdev->memory, xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
+ memset(xtalbuff, 0, xtalbuff_size*(16*4+2*4) * W);
+ {
+ int i;
+@@ -1027,12 +1019,12 @@
+ p += xtalbuff_size;
+ }
+
+- storage = (word *) gs_malloc(storage_size_words, W, "mj_colour_print_page");
++ storage = (word *) gs_malloc(pdev->memory, storage_size_words, W, "mj_colour_print_page");
+
+ /* prepare a temporary buffer for mj_raster_cmd */
+
+ mj_tmp_buf_size = plane_size;
+- mj_tmp_buf = (byte *) gs_malloc(mj_tmp_buf_size, W ,"mj_raster_buffer");
++ mj_tmp_buf = (byte *) gs_malloc(pdev->memory, mj_tmp_buf_size, W ,"mj_raster_buffer");
+
+ #if 0
+ fprintf(stderr, "storage_size_words :%d\n", storage_size_words);
@@ -1163,7 +1155,8 @@
/* Send each scan line in turn */
@@ -269,7 +293,19 @@
int cErr, mErr, yErr, kErr;
int this_pass, i;
long int lnum;
-@@ -1412,10 +1405,10 @@
+@@ -1403,19 +1396,19 @@
+ fflush(prn_stream);
+ }
+ /* free temporary storage */
+- gs_free((char *) storage, storage_size_words, W, "mj_colour_print_page");
+- gs_free((char *) mj_tmp_buf, mj_tmp_buf_size, W, "mj_raster_buffer");
+- gs_free((char *) xtalbuff , xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
++ gs_free(pdev->memory, (char *) storage, storage_size_words, W, "mj_colour_print_page");
++ gs_free(pdev->memory, (char *) mj_tmp_buf, mj_tmp_buf_size, W, "mj_raster_buffer");
++ gs_free(pdev->memory, (char *) xtalbuff , xtalbuff_size*(16*4+2*4) , W, "mj_colour_print_barrier");
+
+ return 0;
+ }
void
mj_color_correct(gx_color_value *Rptr ,gx_color_value *Gptr , gx_color_value *Bptr )
diff --git a/print/ghostscript-gpl/files/patch-pcl3__eprn__gdeveprn.c b/print/ghostscript-gpl/files/patch-pcl3__eprn__gdeveprn.c
new file mode 100644
index 000000000000..894661dd365b
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-pcl3__eprn__gdeveprn.c
@@ -0,0 +1,180 @@
+--- pcl3/eprn/gdeveprn.c.orig Mon Apr 30 14:15:51 2001
++++ pcl3/eprn/gdeveprn.c Sun Mar 25 22:22:54 2007
+@@ -142,11 +142,13 @@
+ if_debug0(EPRN_TRACE_CHAR,
+ "! eprn_get_initial_matrix(): code is still ms_none.\n");
+ #endif
++#if 0
+ if (eprn_set_page_layout(dev) != 0)
+ fputs(" Processing can't be stopped at this point although this error "
+ "occurred.\n", stderr);
+ /* The current function has a signature without the ability to signal
+ an error condition. */
++#endif
+ }
+
+ quarters = dev->eprn.default_orientation +
+@@ -607,6 +609,7 @@
+ }
+ }
+
++#if 0
+ /* Now the 'best_*match' variables indicate for each of the categories of
+ page descriptions to which extent the size is supported at all (non-NULL
+ value) and what the best flag match in the category is. Here we now check
+@@ -647,6 +650,7 @@
+ return -1;
+ }
+ }
++#endif
+ /* Now we have: best_dmatch != NULL || best_cmatch != NULL &&
+ (eprn->media_overrides == NULL || best_cdmatch != NULL). */
+
+@@ -692,7 +696,9 @@
+ }
+ /* If we've found a match, 'code' is no longer 'ms_none'. */
+ if (eprn->code == ms_none) {
++#if 0
+ eprn_flag_mismatch(stderr, eprn, no_match);
++#endif
+ return -1;
+ }
+
+@@ -762,9 +768,11 @@
+
+ rc = gdev_prn_open((gx_device *)dev);
+ if (rc < 0) {
++#if 0
+ fprintf(stderr, "%s" ERRPREF
+ "Failure of gdev_prn_open(), code is %d.\n",
+ epref, rc);
++#endif
+ return rc;
+ }
+ }
+@@ -875,7 +883,7 @@
+ &hres, &vres, &eprn->black_levels, &eprn->non_black_levels);
+
+ if (eprn->pagecount_file != NULL) {
+- gs_free(eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
++ gs_free(dev->memory, eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
+ sizeof(char), "eprn_init_device");
+ eprn->pagecount_file = NULL;
+ }
+@@ -944,17 +952,21 @@
+ &eprn->black_levels, &eprn->non_black_levels) != 0) {
+ gs_param_string str;
+
++#if 0
+ fprintf(stderr, "%s" ERRPREF "The requested combination of colour model (",
+ epref);
++#endif
+ str.size = 0;
+ if (eprn_get_string(eprn->colour_model, eprn_colour_model_list, &str) != 0)
+ assert(0); /* Bug. No harm on NDEBUG because I've just set the size. */
++#if 0
+ fwrite(str.data, str.size, sizeof(str.data[0]), stderr);
+ fprintf(stderr, "),\n"
+ "%s resolution (%gx%g ppi) and intensity levels (%d, %d) is\n"
+ "%s not supported by the %s.\n",
+ epref, device->HWResolution[0], device->HWResolution[1],
+ eprn->black_levels, eprn->non_black_levels, epref, eprn->cap->name);
++#endif
+ return_error(gs_error_rangecheck);
+ }
+
+@@ -1017,11 +1029,13 @@
+ inappropriate :-). Note that eprn does not use 'PageCount' for
+ updating the file. */
+ else {
++#if 0
+ /* pcf_getcount() has issued an error message. */
+ fputs(
+ " No further attempts will be made to access the page count file.\n",
+ stderr);
+- gs_free(eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
++#endif
++ gs_free(device->memory, eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
+ sizeof(char), "eprn_open_device");
+ eprn->pagecount_file = NULL;
+ }
+@@ -1034,31 +1048,33 @@
+ /* Just in case a previous open call failed in a derived device (note that
+ 'octets_per_line' is still the same as then): */
+ if (eprn->scan_line.str != NULL)
+- gs_free(eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
++ gs_free(device->memory, eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
+ "eprn_open_device");
+ if (eprn->next_scan_line.str != NULL) {
+- gs_free(eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
++ gs_free(device->memory, eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
+ "eprn_open_device");
+ eprn->next_scan_line.str = NULL;
+ }
+
+ /* Calls which might depend on prn having been initialized */
+ eprn->octets_per_line = gdev_prn_raster((gx_device_printer *)device);
+- eprn->scan_line.str = (eprn_Octet *) gs_malloc(eprn->octets_per_line,
++ eprn->scan_line.str = (eprn_Octet *) gs_malloc(device->memory, eprn->octets_per_line,
+ sizeof(eprn_Octet), "eprn_open_device");
+ if (eprn->intensity_rendering == eprn_IR_FloydSteinberg) {
+- eprn->next_scan_line.str = (eprn_Octet *) gs_malloc(eprn->octets_per_line,
++ eprn->next_scan_line.str = (eprn_Octet *) gs_malloc(device->memory, eprn->octets_per_line,
+ sizeof(eprn_Octet), "eprn_open_device");
+ if (eprn->next_scan_line.str == NULL && eprn->scan_line.str != NULL) {
+- gs_free(eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
++ gs_free(device->memory, eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
+ "eprn_open_device");
+ eprn->scan_line.str = NULL;
+ }
+ }
+ if (eprn->scan_line.str == NULL) {
++#if 0
+ fprintf(stderr, "%s" ERRPREF
+ "Memory allocation failure from gs_malloc() in eprn_open_device().\n",
+ epref);
++#endif
+ return_error(gs_error_VMerror);
+ }
+
+@@ -1080,12 +1096,12 @@
+ #endif
+
+ if (eprn->scan_line.str != NULL) {
+- gs_free(eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
++ gs_free(device->memory, eprn->scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
+ "eprn_close_device");
+ eprn->scan_line.str = NULL;
+ }
+ if (eprn->next_scan_line.str != NULL) {
+- gs_free(eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
++ gs_free(device->memory, eprn->next_scan_line.str, eprn->octets_per_line, sizeof(eprn_Octet),
+ "eprn_close_device");
+ eprn->next_scan_line.str = NULL;
+ }
+@@ -1152,20 +1168,24 @@
+ accounting, this seems unfair.
+ */
+ if (rc == 0 && eprn->CUPS_accounting)
++#if 0
+ fprintf(stderr, "PAGE: %ld %d\n", dev->ShowpageCount, num_copies);
+ /* The arguments are the number of the page, starting at 1, and the number
+ of copies of that page. */
++#endif
+
+ #ifndef EPRN_NO_PAGECOUNTFILE
+ /* On success, record the number of pages printed */
+ if (rc == 0 && eprn->pagecount_file != NULL) {
+ assert(num_copies > 0); /* because of signed/unsigned */
+ if (pcf_inccount(eprn->pagecount_file, num_copies) != 0) {
++#if 0
+ /* pcf_inccount() has issued an error message. */
+ fputs(
+ " No further attempts will be made to access the page count file.\n",
+ stderr);
+- gs_free(eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
++#endif
++ gs_free(dev->memory, eprn->pagecount_file, strlen(eprn->pagecount_file) + 1,
+ sizeof(char), "eprn_output_page");
+ eprn->pagecount_file = NULL;
+ }
diff --git a/print/ghostscript-gpl/files/patch-src-gdevdmpr.c b/print/ghostscript-gpl/files/patch-src-gdevdmpr.c
index 2da080e7d34e..4e2b27f4fca4 100644
--- a/print/ghostscript-gpl/files/patch-src-gdevdmpr.c
+++ b/print/ghostscript-gpl/files/patch-src-gdevdmpr.c
@@ -1,5 +1,5 @@
--- src/gdevdmpr.c.orig Tue May 13 20:43:37 1997
-+++ src/gdevdmpr.c Thu Jun 9 02:52:25 2005
++++ src/gdevdmpr.c Sat Mar 24 15:41:48 2007
@@ -41,7 +41,7 @@
/* include library header. */
#include "dviprlib.h"
@@ -27,7 +27,77 @@
/* The device descriptor */
gx_device_procs prn_dmprt_procs = {
-@@ -833,6 +833,7 @@
+@@ -405,7 +405,9 @@
+ if (pddev->dmprt.max_height>0 && pddev->dmprt.max_height<pddev->height)
+ pddev->height = pddev->dmprt.max_height;
+
++#if 0
+ dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL);
++#endif
+
+ return code;
+ }
+@@ -425,7 +427,9 @@
+ if (code < 0) return code;
+ if (code == 0) pddev->dmprt.debug_f = vbool;
+
++#if 0
+ dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL);
++#endif
+
+ code = param_read_bool(plist, "Verbose", &vbool);
+ if (code < 0) return code;
+@@ -475,14 +479,14 @@
+ code = param_read_string(plist, "FileName", &vstr);
+ if (code < 0) return code;
+ if (code == 0) {
+- char *filename = gs_malloc(vstr.size + 1, 1,
++ char *filename = gs_malloc(pdev->memory, vstr.size + 1, 1,
+ "gdev_dmprt_put_props(filename)");
+ int ccode;
+ if (filename == 0) return e_VMerror;
+ strncpy(filename, (const char*)vstr.data, vstr.size);
+ filename[vstr.size] = '\0';
+ ccode = gdev_dmprt_get_printer_props(pddev,filename);
+- gs_free(filename, vstr.size+1, 1, "gdev_dmprt_put_props(filename)");
++ gs_free(pdev->memory, filename, vstr.size+1, 1, "gdev_dmprt_put_props(filename)");
+ if (ccode < 0) return ccode;
+ }
+
+@@ -686,7 +690,7 @@
+ byte *in;
+
+ /* get work buffer */
+- in = (byte *)gs_malloc(1, i_buf_size ,"gdev_dmprt_print_page(in)");
++ in = (byte *)gs_malloc(pdev->memory, 1, i_buf_size ,"gdev_dmprt_print_page(in)");
+ if ( in == 0 )
+ return e_VMerror;
+
+@@ -737,7 +741,7 @@
+ eprintf1(" %lu bytes\n",dviprt_getoutputbytes(pprint)-prev_bytes);
+ }
+ error_ex:
+- gs_free((char *)in, 1, i_buf_size,"gdev_dmprt_print_page(in)");
++ gs_free(pdev->memory, (char *)in, 1, i_buf_size,"gdev_dmprt_print_page(in)");
+
+ return code;
+ }
+@@ -797,7 +801,7 @@
+ dviprt_cfg_t cfg;
+ char *fname;
+
+- fname = gs_malloc(256,1,"dviprt_lib_fname");
++ fname = gs_malloc(pdev->memory, 256,1,"dviprt_lib_fname");
+ if (fname == NULL) return e_VMerror;
+
+ fp = gdev_dmprt_dviprt_lib_fopen(fnamebase,fname);
+@@ -828,11 +832,12 @@
+ cfg.integer[CFG_Y_DPI] > 0 ? cfg.integer[CFG_Y_DPI] : pddev->dmprt.orig_x_dpi;
+ }
+
+- gs_free(fname,256,1,"dviprt_lib_fname");
++ gs_free(pdev->memory, fname,256,1,"dviprt_lib_fname");
+
return code;
}
@@ -35,7 +105,7 @@
private FILE *
gdev_dmprt_dviprt_lib_fopen(const char *fnamebase,char *fname)
{
-@@ -845,9 +846,7 @@
+@@ -845,9 +850,7 @@
env = getenv("TEXCFG");
if (env) {
strcpy(fname,env);
@@ -46,7 +116,7 @@
fp = fopen(fname,gp_fmode_rb);
}
}
-@@ -867,4 +866,15 @@
+@@ -867,4 +870,15 @@
default:
return -1;
}
diff --git a/print/ghostscript-gpl/files/patch-src-gdevijs.c b/print/ghostscript-gpl/files/patch-src-gdevijs.c
index b9e8a47b5aff..fd5aeb1966d3 100644
--- a/print/ghostscript-gpl/files/patch-src-gdevijs.c
+++ b/print/ghostscript-gpl/files/patch-src-gdevijs.c
@@ -1,5 +1,5 @@
---- src/gdevijs.c.orig Wed Mar 24 17:38:53 2004
-+++ src/gdevijs.c Thu May 26 01:23:29 2005
+--- src/gdevijs.c.orig Thu Mar 10 23:57:23 2005
++++ src/gdevijs.c Fri May 27 02:56:55 2005
@@ -27,15 +27,29 @@
* which is a security risk, since any program can be run.
* You should use -dSAFER which sets .LockSafetyParams to true
@@ -30,9 +30,9 @@
/* This should go into gdevprn.h, or, better yet, gdevprn should
acquire an API for changing resolution. */
int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev,
-@@ -51,6 +65,14 @@
- private dev_proc_get_params(gsijs_get_params);
+@@ -52,6 +66,14 @@
private dev_proc_put_params(gsijs_put_params);
+ private dev_proc_finish_copydevice(gsijs_finish_copydevice);
+/* Following definitions are for krgb support. */
+private dev_proc_create_buf_device(gsijs_create_buf_device);
@@ -42,10 +42,10 @@
+private dev_proc_fill_path(gsijs_fill_path);
+private dev_proc_stroke_path(gsijs_stroke_path);
+
- private const gx_device_procs gsijs_procs =
- prn_color_params_procs(gsijs_open, gsijs_output_page, gsijs_close,
- gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
-@@ -83,6 +105,14 @@
+ private const gx_device_procs gsijs_procs = {
+ gsijs_open,
+ NULL, /* get_initial_matrix */
+@@ -126,6 +148,14 @@
IjsClientCtx *ctx;
int ijs_version;
@@ -60,7 +60,7 @@
};
#define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */
-@@ -110,7 +140,12 @@
+@@ -153,7 +183,12 @@
FALSE, /* Tumble_set */
NULL, /* IjsClient *ctx */
@@ -74,7 +74,7 @@
};
-@@ -126,12 +161,254 @@
+@@ -169,12 +204,254 @@
/**************************************************************************/
@@ -334,7 +334,7 @@
private int
gsijs_parse_wxh (const char *val, int size, double *pw, double *ph)
-@@ -169,34 +446,6 @@
+@@ -212,34 +489,6 @@
}
/**
@@ -369,7 +369,7 @@
* gsijs_set_generic_params: Set generic IJS parameters.
**/
private int
-@@ -207,9 +456,6 @@
+@@ -250,9 +499,6 @@
int i, j;
char *value;
@@ -379,7 +379,7 @@
/* Split IjsParams into separate parameters and send to ijs server */
value = NULL;
for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
-@@ -250,68 +496,6 @@
+@@ -293,68 +539,6 @@
}
/**
@@ -448,7 +448,7 @@
* gsijs_set_margin_params: Do margin negotiation with IJS server.
**/
private int
-@@ -322,9 +506,6 @@
+@@ -365,9 +549,6 @@
int i, j;
char *value;
@@ -458,7 +458,7 @@
/* Split IjsParams into separate parameters and send to ijs server */
value = NULL;
for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
-@@ -491,12 +672,18 @@
+@@ -534,12 +715,18 @@
char buf[256];
bool use_outputfd;
int fd = -1;
@@ -477,7 +477,7 @@
/* Decide whether to use OutputFile or OutputFD. Note: how to
determine this is a tricky question, so we just allow the
user to set it.
-@@ -511,6 +698,8 @@
+@@ -554,6 +741,8 @@
if (code < 0)
return code;
@@ -486,7 +486,7 @@
if (use_outputfd) {
/* Note: dup() may not be portable to all interesting IJS
platforms. In that case, this branch should be #ifdef'ed out.
-@@ -570,6 +759,9 @@
+@@ -613,6 +802,9 @@
if (code >= 0)
code = gsijs_set_margin_params(ijsdev);
@@ -496,7 +496,7 @@
return code;
}
-@@ -629,21 +821,6 @@
+@@ -695,21 +887,6 @@
return min(width, end);
}
@@ -518,7 +518,7 @@
/* Print a page. Don't use normal printer gdev_prn_output_page
* because it opens the output file.
*/
-@@ -654,8 +831,9 @@
+@@ -720,8 +897,9 @@
gx_device_printer *pdev = (gx_device_printer *)dev;
int raster = gdev_prn_raster(pdev);
int ijs_width, ijs_height;
@@ -529,7 +529,7 @@
unsigned char *data;
char buf[256];
double xres = pdev->HWResolution[0];
-@@ -671,13 +849,23 @@
+@@ -737,13 +915,23 @@
/* Determine bitmap width and height */
ijs_height = gdev_prn_print_scan_lines(dev);
@@ -550,14 +550,14 @@
+ /* Create banding buffer for k plane. */
+ ijsdev->k_width = ijs_width;
+ ijsdev->k_band_size = band_height * k_row_bytes;
-+ if ((ijsdev->k_band = gs_malloc(ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
++ if ((ijsdev->k_band = gs_malloc(pdev->memory, ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
+ return gs_note_error(gs_error_VMerror);
+ }
+
/* Required page parameters */
sprintf(buf, "%d", n_chan);
gsijs_client_set_param(ijsdev, "NumChan", buf);
-@@ -686,44 +874,71 @@
+@@ -752,44 +940,71 @@
/* This needs to become more sophisticated for DeviceN. */
strcpy(buf, (n_chan == 4) ? "DeviceCMYK" :
@@ -644,12 +644,12 @@
+#endif
+
+ if(krgb_mode)
-+ gs_free(ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
++ gs_free(pdev->memory, ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
+
gs_free_object(pdev->memory, data, "gsijs_output_page");
endcode = (pdev->buffer_space && !pdev->is_async_renderer ?
-@@ -1027,7 +1242,6 @@
+@@ -1093,7 +1308,6 @@
dprintf2("ijs: Can't set parameter %s=%s\n", key, value);
return code;
}
diff --git a/print/ghostscript-gpl/files/patch-src:fapi_ft.c b/print/ghostscript-gpl/files/patch-src:fapi_ft.c
index 9238e4f52ee8..52f28daefcf7 100644
--- a/print/ghostscript-gpl/files/patch-src:fapi_ft.c
+++ b/print/ghostscript-gpl/files/patch-src:fapi_ft.c
@@ -1,6 +1,6 @@
---- src/fapi_ft.c.orig Sat Dec 13 07:07:59 2003
-+++ src/fapi_ft.c Wed Mar 17 21:43:43 2004
-@@ -30,7 +30,8 @@
+--- src/fapi_ft.c.orig Mon Mar 13 17:18:19 2006
++++ src/fapi_ft.c Sun Mar 18 16:23:21 2007
+@@ -26,11 +26,14 @@
#include "math_.h"
/* FreeType headers */
@@ -10,3 +10,9 @@
#include "freetype/ftincrem.h"
#include "freetype/ftglyph.h"
#include "freetype/ftoutln.h"
+ #include "freetype/fttrigon.h"
++#include "gserrors.h"
++#include "gserror.h"
+
+ /* Note: structure definitions here start with FF_, which stands for 'FAPI FreeType". */
+
diff --git a/print/ghostscript-gpl/files/patch-src:gdevccr.c b/print/ghostscript-gpl/files/patch-src:gdevccr.c
deleted file mode 100644
index 56bb760b8ac8..000000000000
--- a/print/ghostscript-gpl/files/patch-src:gdevccr.c
+++ /dev/null
@@ -1,15 +0,0 @@
---- src/gdevccr.c.orig Fri Feb 22 07:24:51 2002
-+++ src/gdevccr.c Sun Nov 10 22:38:51 2002
-@@ -112,8 +112,11 @@
- /* ------ Color mapping routines ------ */
- /* map an rgb color to a ccr cmy bitmap */
- private gx_color_index
--ccr_map_rgb_color(gx_device *pdev, ushort r, ushort g, ushort b)
-+ccr_map_rgb_color(gx_device *pdev, const ushort cv[])
- {
-+ ushort r = cv[0];
-+ ushort g = cv[1];
-+ ushort b = cv[2];
- register int shift = gx_color_value_bits - 1;
- r>>=shift;
- g>>=shift;
diff --git a/print/ghostscript-gpl/files/patch-src:gdevcd8.c b/print/ghostscript-gpl/files/patch-src:gdevcd8.c
index f92af5b292f4..b5257edb49de 100644
--- a/print/ghostscript-gpl/files/patch-src:gdevcd8.c
+++ b/print/ghostscript-gpl/files/patch-src:gdevcd8.c
@@ -1,5 +1,5 @@
--- src/gdevcd8.c.orig Mon Feb 28 16:01:59 2000
-+++ src/gdevcd8.c Wed Dec 10 21:32:53 2003
++++ src/gdevcd8.c Fri Dec 17 19:42:52 2004
@@ -406,19 +406,19 @@
};
@@ -236,6 +236,24 @@
private void
+@@ -1175,7 +1175,7 @@
+ 2bpp feature of the hp850 someday, it is sized like storage.
+ storagee contains the errors from b/w fs-ditherng */
+
+- data_ptrs.storage = (ulong *) gs_malloc(misc_vars.storage_size_words, W,
++ data_ptrs.storage = (ulong *) gs_malloc(pdev->memory, misc_vars.storage_size_words, W,
+ "cdj850_print_page");
+
+ /* if we can't allocate working area */
+@@ -1196,7 +1196,7 @@
+ (*cdj850->terminate_page) (pdev, prn_stream);
+
+ /* Free Memory */
+- gs_free((char *)data_ptrs.storage, misc_vars.storage_size_words, W,
++ gs_free(pdev->memory, (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
+ "hp850_print_page");
+
+ return 0;
@@ -2744,13 +2744,14 @@
(y) = gx_bits_to_color_value((v) & ((1 << (b)) - 1), (b))
diff --git a/print/ghostscript-gpl/files/patch-src:gdevcp50.c b/print/ghostscript-gpl/files/patch-src:gdevcp50.c
deleted file mode 100644
index ffc8308ec35d..000000000000
--- a/print/ghostscript-gpl/files/patch-src:gdevcp50.c
+++ /dev/null
@@ -1,18 +0,0 @@
---- src/gdevcp50.c.orig Fri Feb 22 07:24:51 2002
-+++ src/gdevcp50.c Sun Nov 10 22:35:13 2002
-@@ -204,9 +204,12 @@
-
- /* Map a r-g-b color to a color index. */
- private gx_color_index
--cp50_rgb_color(gx_device *dev, gx_color_value r, gx_color_value g,
-- gx_color_value b)
--{ return ((ulong)gx_color_value_to_byte(r) << 16)+
-+cp50_rgb_color(gx_device *dev, const gx_color_value cv[])
-+{
-+ gx_color_value r = cv[0];
-+ gx_color_value g = cv[1];
-+ gx_color_value b = cv[2];
-+ return ((ulong)gx_color_value_to_byte(r) << 16)+
- ((uint)gx_color_value_to_byte(g) << 8) +
- gx_color_value_to_byte(b);
- }
diff --git a/print/ghostscript-gpl/files/patch-src:gdevdj9.c b/print/ghostscript-gpl/files/patch-src:gdevdj9.c
index f58a6c7de792..ef473318ad07 100644
--- a/print/ghostscript-gpl/files/patch-src:gdevdj9.c
+++ b/print/ghostscript-gpl/files/patch-src:gdevdj9.c
@@ -1,5 +1,5 @@
---- src/gdevdj9.c.orig Fri Nov 8 06:15:08 2002
-+++ src/gdevdj9.c Sun Nov 10 22:00:45 2002
+--- src/gdevdj9.c.orig Fri Dec 17 19:31:42 2004
++++ src/gdevdj9.c Fri Dec 17 19:44:07 2004
@@ -243,19 +243,19 @@
};
@@ -205,6 +205,24 @@
/* assign_dpi:
+@@ -863,7 +863,7 @@
+ 2bpp feature of the hp970 someday, it is sized like storage.
+ storagee contains the errors from b/w fs-ditherng */
+
+- data_ptrs.storage = (ulong *) gs_malloc(misc_vars.storage_size_words, W,
++ data_ptrs.storage = (ulong *) gs_malloc(pdev->memory, misc_vars.storage_size_words, W,
+ "cdj970_print_page");
+
+ /* if we can't allocate working area */
+@@ -884,7 +884,7 @@
+ (*cdj970->terminate_page) (pdev, prn_stream);
+
+ /* Free Memory */
+- gs_free((char *)data_ptrs.storage, misc_vars.storage_size_words, W,
++ gs_free(pdev->memory, (char *)data_ptrs.storage, misc_vars.storage_size_words, W,
+ "hp970_print_page");
+
+ PageCtr ++;
@@ -2292,12 +2292,13 @@
/* gdev_cmyk_map_cmyk_color:
----------------------------------------------------------------------------------*/
diff --git a/print/ghostscript-gpl/files/patch-src:gdevgdi.c b/print/ghostscript-gpl/files/patch-src:gdevgdi.c
index 996758e09685..49d575dd8c27 100644
--- a/print/ghostscript-gpl/files/patch-src:gdevgdi.c
+++ b/print/ghostscript-gpl/files/patch-src:gdevgdi.c
@@ -1,5 +1,5 @@
--- src/gdevgdi.c.orig Wed Jun 19 19:32:49 2002
-+++ src/gdevgdi.c Mon Jul 21 13:44:41 2003
++++ src/gdevgdi.c Fri Dec 31 17:41:18 2004
@@ -60,8 +60,8 @@
#define GDI_REPEAT_LENGTH 2
#define GDI_BAND_HEIGHT 128
@@ -53,6 +53,19 @@
private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp);
private FILE *WriteBandHeader(FILE *fp, unsigned int usBandNo,
unsigned char ubCompMode, unsigned int usBandWidth,
+@@ -193,9 +207,9 @@
+ }
+
+ ul_band_size = band_width_bytes * band_height;
+- ibp = (byte *)gs_malloc(ul_band_size, 1, "gdi_print_page");
+- obp = (byte *)gs_malloc(ul_band_size*13/10, 1, "gdi_print_page");
+- tmp = (byte *)gs_malloc(raster, 1, "gdi_print_page");
++ ibp = (byte *)gs_malloc(pdev->memory, ul_band_size, 1, "gdi_print_page");
++ obp = (byte *)gs_malloc(pdev->memory, ul_band_size*13/10, 1, "gdi_print_page");
++ tmp = (byte *)gs_malloc(pdev->memory, raster, 1, "gdi_print_page");
+
+ if (!ibp) return_error(gs_error_VMerror);
+ if (!obp) return_error(gs_error_VMerror);
@@ -220,7 +234,7 @@
memset(obp, 0x00, ul_band_size*13/10);
for (j=0; j<band_height; j++) {
@@ -102,7 +115,7 @@
+ int f, g, h;
+ if (!fudge) {
+ ASSERT(use_band == ibp);
-+ use_band = (byte*)gs_malloc(ul_band_size, 1, "gdi_print_page/fudge");
++ use_band = (byte*)gs_malloc(pdev->memory, ul_band_size, 1, "gdi_print_page/fudge");
+ fudge=1;
+ }
+ memcpy(use_band, ibp, ul_band_size);
@@ -130,7 +143,7 @@
+ oh_well:
+ if (fudge > 1) {
+ ASSERT(use_band != ibp);
-+ gs_free(use_band, ul_band_size, 1, "gdi_print_page/fudge");
++ gs_free(pdev->memory, use_band, ul_band_size, 1, "gdi_print_page/fudge");
+ /*fprintf(stderr, "smartgdi: band %d fudge factor is %d\n", i, fudge);*/
+ }
+ }
@@ -138,7 +151,7 @@
break;
case GDI_COMP_SCANLINE:
ul_comp_size = bmp2run(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP);
-@@ -253,7 +323,7 @@
+@@ -253,15 +323,15 @@
prn_stream = WriteBandHeader(prn_stream, i, compression_type, (band_width_bytes * 8),
band_height, ul_comp_size);
@@ -147,6 +160,17 @@
fwrite(obp, ul_comp_size, 1, prn_stream);
}
+ /* Trailer Output */
+ WriteTrailerData(prn_stream);
+- gs_free(ibp, ul_band_size, 1, "gdi_line_buffer");
+- gs_free(obp, ul_band_size*13/10, 1, "gdi_line_buffer");
+- gs_free(tmp, raster, 1, "gdi_line_buffer");
++ gs_free(pdev->memory, ibp, ul_band_size, 1, "gdi_line_buffer");
++ gs_free(pdev->memory, obp, ul_band_size*13/10, 1, "gdi_line_buffer");
++ gs_free(pdev->memory, tmp, raster, 1, "gdi_line_buffer");
+ return code;
+ }
+
@@ -271,50 +341,50 @@
unsigned char buffer[300];
int dots_per_inch = (int)pdev->y_pixels_per_inch;
diff --git a/print/ghostscript-gpl/files/patch-src:gdevifno.c b/print/ghostscript-gpl/files/patch-src:gdevifno.c
deleted file mode 100644
index b3bc447dd27a..000000000000
--- a/print/ghostscript-gpl/files/patch-src:gdevifno.c
+++ /dev/null
@@ -1,15 +0,0 @@
---- src/gdevifno.c.orig Sun Jun 16 14:48:55 2002
-+++ src/gdevifno.c Sun Nov 10 22:49:32 2002
-@@ -99,8 +99,10 @@
- * rgb and color map entries
- */
- private gx_color_index
--inferno_rgb2cmap(gx_device *dev, gx_color_value red,
-- gx_color_value green, gx_color_value blue) {
-+inferno_rgb2cmap(gx_device *dev, const gx_color_value cv[]) {
-+ gx_color_value red = cv[0];
-+ gx_color_value green = cv[1];
-+ gx_color_value blue = cv[2];
- int shift;
- inferno_device *bdev = (inferno_device*) dev;
- int nbits = bdev->nbits;
diff --git a/print/ghostscript-gpl/files/patch-src:gdevlx50.c b/print/ghostscript-gpl/files/patch-src:gdevlx50.c
index 01ceae208cd3..b762afcec85d 100644
--- a/print/ghostscript-gpl/files/patch-src:gdevlx50.c
+++ b/print/ghostscript-gpl/files/patch-src:gdevlx50.c
@@ -1,5 +1,50 @@
---- src/gdevlx50.c.orig Thu May 15 07:38:07 2003
-+++ src/gdevlx50.c Thu May 15 08:02:58 2003
+--- src/gdevlx50.c.orig Fri Dec 17 19:31:43 2004
++++ src/gdevlx50.c Fri Dec 17 22:31:26 2004
+@@ -1120,18 +1120,18 @@
+
+ /* Allocate a buffer for a single scan line */
+ lineBuffer = (byte *)gs_alloc_byte_array
+- ( &gs_memory_default, lx5000dev->scanLineBytes, 1,
++ ( lx5000dev->memory, lx5000dev->scanLineBytes, 1,
+ "lx5000_print_page(lineBuffer)" );
+
+ swipeBuf = (byte *)gs_alloc_byte_array
+- ( &gs_memory_default, lx5000dev->swipeBufSize, 1,
++ ( lx5000dev->memory, lx5000dev->swipeBufSize, 1,
+ "lx5000_print_page(swipeBuf)" );
+
+ for ( colour = 0 ; colour < numColours; colour++ )
+ {
+ if ( ( colourBufs[colour] =
+ (byte *)gs_alloc_byte_array
+- ( &gs_memory_default, lx5000dev->penBufSize, 1,
++ ( lx5000dev->memory, lx5000dev->penBufSize, 1,
+ "lx5000_print_page(colourBufs)"
+ )
+ ) == NULL )
+@@ -1172,19 +1172,19 @@
+ for ( colour = 0; colour < numColours; colour++ )
+ {
+ if ( colourBufs[colour] != NULL )
+- gs_free_object( &gs_memory_default,
++ gs_free_object( lx5000dev->memory,
+ (char *)colourBufs[colour],
+ "lx5000_print_page(colourBufs)" );
+ colourBufs[ colour ] = NULL;
+ colourBufPtrs[ colour ] = NULL;
+ }
+ if ( swipeBuf != NULL )
+- gs_free_object( &gs_memory_default,
++ gs_free_object( lx5000dev->memory,
+ (char *)swipeBuf, "lx5000_print_page(swipeBuf)" );
+ swipeBuf = NULL;
+ *swipeBufPtr = NULL;
+ if ( lineBuffer != NULL )
+- gs_free_object( &gs_memory_default,
++ gs_free_object( lx5000dev->memory,
+ (char *)lineBuffer, "lx5000_print_page(lineBuffer)" );
+ lineBuffer = NULL;
+ *lineBufferPtr = NULL;
@@ -2603,9 +2603,12 @@
/* Map CMYK to color. */
diff --git a/print/ghostscript-gpl/files/patch-src:gdevmgr.c b/print/ghostscript-gpl/files/patch-src:gdevmgr.c
deleted file mode 100644
index 8f2dc4028c34..000000000000
--- a/print/ghostscript-gpl/files/patch-src:gdevmgr.c
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/gdevmgr.c.orig Sun Jun 16 14:48:55 2002
-+++ src/gdevmgr.c Sun Nov 10 22:52:19 2002
-@@ -364,9 +364,11 @@
- /* (1/6, 1/2, and 5/6), instead of the obvious 8x8x4. */
-
- gx_color_index
--mgr_8bit_map_rgb_color(gx_device *dev, gx_color_value r, gx_color_value g,
-- gx_color_value b)
--{ uint rv = r / (gx_max_color_value / 7 + 1);
-+mgr_8bit_map_rgb_color(gx_device *dev, const gx_color_value cv[])
-+{ gx_color_value r = cv[0];
-+ gx_color_value g = cv[1];
-+ gx_color_value b = cv[2];
-+ uint rv = r / (gx_max_color_value / 7 + 1);
- uint gv = g / (gx_max_color_value / 7 + 1);
- uint bv = b / (gx_max_color_value / 7 + 1);
- return (gx_color_index)
diff --git a/print/ghostscript-gpl/files/patch-src:genarch.c b/print/ghostscript-gpl/files/patch-src:genarch.c
deleted file mode 100644
index 3b74ac7e6145..000000000000
--- a/print/ghostscript-gpl/files/patch-src:genarch.c
+++ /dev/null
@@ -1,34 +0,0 @@
---- src/genarch.c.orig Wed Sep 20 04:00:23 2000
-+++ src/genarch.c Wed Jun 20 04:05:36 2001
-@@ -40,6 +40,7 @@
- fprintf(f, "\n\t /* ---------------- %s ---------------- */\n\n", str);
- }
-
-+#ifndef __FreeBSD__
- private clock_t
- time_clear(char *buf, int bsize, int nreps)
- {
-@@ -50,6 +51,7 @@
- memset(buf, 0, bsize);
- return clock() - t;
- }
-+#endif /* __FreeBSD__ */
-
- private void
- define(FILE *f, const char *str)
-@@ -180,6 +182,7 @@
- fprintf(f, "((unsigned long)~0L + (unsigned long)0)\n");
- #undef PRINT_MAX
-
-+#ifndef __FreeBSD__
- section(f, "Cache sizes");
-
- /*
-@@ -240,6 +243,7 @@
- }
- define_int(f, "ARCH_CACHE2_SIZE", bsize >> 1);
- }
-+#endif /* __FreeBSD__ */
-
- section(f, "Miscellaneous");
-
diff --git a/print/ghostscript-gpl/files/patch-src:gxobj.h b/print/ghostscript-gpl/files/patch-src:gxobj.h
index 1b3bb6758042..9ae2fe0d5535 100644
--- a/print/ghostscript-gpl/files/patch-src:gxobj.h
+++ b/print/ghostscript-gpl/files/patch-src:gxobj.h
@@ -1,12 +1,12 @@
---- src/gxobj.h.orig Thu Feb 21 14:24:53 2002
-+++ src/gxobj.h Sat Sep 27 19:17:17 2003
-@@ -103,11 +103,15 @@
+--- src/gxobj.h.orig Tue Mar 14 01:18:19 2006
++++ src/gxobj.h Fri Mar 23 14:41:44 2007
+@@ -109,11 +109,15 @@
* required by the hardware, regardless of the value of obj_align_mod.
* See gsmemraw.h for more information about this.
*/
+#if !defined(__ia64__) && !defined(__amd64__)
#define obj_align_mod\
- (((arch_align_memory_mod - 1) |\
+ (((ARCH_ALIGN_MEMORY_MOD - 1) |\
(align_bitmap_mod - 1) |\
(obj_back_scale - 1)) + 1)
/* The only possible values for obj_align_mod are 4, 8, or 16.... */
diff --git a/print/ghostscript-gpl/files/patch-src:unix-dll.mak b/print/ghostscript-gpl/files/patch-src:unix-dll.mak
deleted file mode 100644
index dbecfe241c4d..000000000000
--- a/print/ghostscript-gpl/files/patch-src:unix-dll.mak
+++ /dev/null
@@ -1,60 +0,0 @@
---- src/unix-dll.mak.orig Wed Sep 24 22:41:20 2003
-+++ src/unix-dll.mak Wed Dec 10 19:25:49 2003
-@@ -46,11 +46,9 @@
-
- # shared library
- GS_SONAME=lib$(GS).so
--GS_SONAME_MAJOR=$(GS_SONAME).$(GS_VERSION_MAJOR)
--GS_SONAME_MAJOR_MINOR= $(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR)
-+GS_SONAME_MAJOR=$(GS_SONAME).$(GS_SHLIB_VER)
- GS_SO=$(BINDIR)/$(GS_SONAME)
--GS_SO_MAJOR=$(GS_SO).$(GS_VERSION_MAJOR)
--GS_SO_MAJOR_MINOR=$(GS_SO_MAJOR).$(GS_VERSION_MINOR)
-+GS_SO_MAJOR=$(GS_SO).$(GS_SHLIB_VER)
-
- # Shared object is built by redefining GS_XE in a recursive make.
-
-@@ -58,24 +56,20 @@
-
- $(GS_SO): $(GS_SO_MAJOR)
- $(RM_) $(GS_SO)
-- ln -s $(GS_SONAME_MAJOR_MINOR) $(GS_SO)
--
--$(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR)
-- $(RM_) $(GS_SO_MAJOR)
-- ln -s $(GS_SONAME_MAJOR_MINOR) $(GS_SO_MAJOR)
-+ ln -s $(GS_SONAME_MAJOR) $(GS_SO)
-
- # Build the small Ghostscript loaders, with Gtk+ and without
-
- $(GSSOX_XE): $(GS_SO) $(GLSRC)dxmain.c
-- $(GLCC) -g `gtk-config --cflags` -o $(GSSOX_XE) $(GLSRC)dxmain.c -L$(BINDIR) -l$(GS) `gtk-config --libs`
-+ $(GLCC) `pkg-config --cflags gtk+` -o $(GSSOX_XE) $(GLSRC)dxmain.c -L$(BINDIR) -l$(GS) `pkg-config --libs gtk+`
-
- $(GSSOC_XE): $(GS_SO) $(GLSRC)dxmainc.c
-- $(GLCC) -g -o $(GSSOC_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS)
-+ $(GLCC) -o $(GSSOC_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS)
-
- # ------------------------- Recursive make targets ------------------------- #
-
--SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname=$(GS_SONAME_MAJOR)'\
-- GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR)\
-+SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname,$(GS_SONAME_MAJOR)'\
-+ GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR)\
- STDIO_IMPLEMENTATION=c\
- DISPLAY_DEV=$(DD)$(SOOBJRELDIR)/display.dev\
- BINDIR=$(BINDIR)/$(SOBINRELDIR)\
-@@ -104,11 +98,9 @@
- -mkdir -p $(libdir)
- $(INSTALL_PROGRAM) $(GSSOC) $(bindir)/$(GSSOC_XENAME)
- $(INSTALL_PROGRAM) $(GSSOX) $(bindir)/$(GSSOX_XENAME)
-- $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR_MINOR)
-+ $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR) $(libdir)/$(GS_SONAME_MAJOR)
- $(RM_) $(libdir)/$(GS_SONAME)
-- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME)
-- $(RM_) $(libdir)/$(GS_SONAME_MAJOR)
-- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR)
-+ ln -s $(GS_SONAME_MAJOR) $(libdir)/$(GS_SONAME)
-
- soinstall: install-so install-scripts install-data
-
diff --git a/print/ghostscript-gpl/files/patch-src:unix-gcc.mak b/print/ghostscript-gpl/files/patch-src:unix-gcc.mak
index ab8ae52b389b..ddc62984a8a9 100644
--- a/print/ghostscript-gpl/files/patch-src:unix-gcc.mak
+++ b/print/ghostscript-gpl/files/patch-src:unix-gcc.mak
@@ -1,6 +1,6 @@
---- src/unix-gcc.mak.orig Thu Oct 24 21:57:57 2002
-+++ src/unix-gcc.mak Sun Nov 17 22:01:58 2002
-@@ -24,14 +24,15 @@
+--- src/unix-gcc.mak.orig Fri Jul 7 06:32:50 2006
++++ src/unix-gcc.mak Fri Mar 23 14:44:08 2007
+@@ -21,15 +21,16 @@
# source, generated intermediate file, and object directories
# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
@@ -10,6 +10,7 @@
-GLOBJDIR=./obj
-PSSRCDIR=./src
-PSLIBDIR=./lib
+-PSRESDIR=./Resource
-PSGENDIR=./obj
-PSOBJDIR=./obj
+.CURDIR?=.
@@ -19,12 +20,13 @@
+GLOBJDIR=${.CURDIR}/obj
+PSSRCDIR=${.CURDIR}/src
+PSLIBDIR=${.CURDIR}/lib
++PSRESDIR=${.CURDIR}/Resource
+PSGENDIR=${.CURDIR}/obj
+PSOBJDIR=${.CURDIR}/obj
# Do not edit the next group of lines.
-@@ -50,11 +51,10 @@
+@@ -48,11 +49,10 @@
# the directories also define the default search path for the
# initialization files (gs_*.ps) and the fonts.
@@ -66,7 +68,22 @@
#ZLIB_NAME=gz
ZLIB_NAME=z
-@@ -197,7 +197,7 @@
+@@ -179,6 +179,14 @@
+ JBIG2_LIB=jbig2dec
+ JBIG2SRCDIR=jbig2dec
+
++# Choose the library to use for (JPXDecode support)
++# whether to link to an external build or compile in from source
++# and source location and configuration flags for compiling in
++JPX_LIB=jasper
++SHARE_JPX=0
++JPXSRCDIR=jasper
++JPX_CFLAGS=-DJAS_CONFIGURE
++
+ # Define the directory where the icclib source are stored.
+ # See icclib.mak for more information
+
+@@ -202,7 +210,7 @@
# Define the name of the C compiler.
@@ -75,7 +92,7 @@
# Define the name of the linker for the final link step.
# Normally this is the same as the C compiler.
-@@ -214,9 +214,9 @@
+@@ -219,9 +227,9 @@
# Define the added flags for standard, debugging, profiling
# and shared object builds.
@@ -88,16 +105,16 @@
CFLAGS_SO=-fPIC
# Define the other compilation flags. Add at most one of the following:
-@@ -230,7 +230,7 @@
+@@ -235,7 +243,7 @@
# We don't include -ansi, because this gets in the way of the platform-
# specific stuff that <math.h> typically needs; nevertheless, we expect
# gcc to accept ANSI-style function prototypes and function definitions.
-XCFLAGS=
-+XCFLAGS+=-I${LOCALBASE}/include/libpng -I${LOCALBASE}/include
++XCFLAGS+=-I${.CURDIR}/jasper/src/libjasper/include -I${LOCALBASE}/include/libpng -I${LOCALBASE}/include
CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
-@@ -241,7 +241,7 @@
+@@ -246,7 +254,7 @@
# -R /usr/local/xxx/lib:/usr/local/lib
# giving the full path names of the shared library directories.
# XLDFLAGS can be set from the command line.
@@ -106,7 +123,7 @@
LDFLAGS=$(XLDFLAGS)
-@@ -274,7 +274,7 @@
+@@ -279,7 +287,7 @@
# Note that x_.h expects to find the header files in $(XINCLUDE)/X11,
# not in $(XINCLUDE).
@@ -115,7 +132,7 @@
# Define the directory/ies and library names for the X11 library files.
# XLIBDIRS is for ld and should include -L; XLIBDIR is for LD_RUN_PATH
-@@ -286,12 +286,12 @@
+@@ -291,12 +299,12 @@
# Solaris and other SVR4 systems with dynamic linking probably want
#XLIBDIRS=-L/usr/openwin/lib -R/usr/openwin/lib
# X11R6 (on any platform) may need
@@ -131,3 +148,13 @@
# Define whether this platform has floating point hardware:
# FPU_TYPE=2 means floating point is faster than fixed point.
+@@ -447,6 +455,9 @@
+ include $(GLSRCDIR)/zlib.mak
+ include $(GLSRCDIR)/libpng.mak
+ include $(GLSRCDIR)/jbig2.mak
++include $(GLSRCDIR)/jasper.mak
++include $(GLSRCDIR)/ldf_jb2.mak
++include $(GLSRCDIR)/lwf_jp2.mak
+ include $(GLSRCDIR)/icclib.mak
+ include $(GLSRCDIR)/ijs.mak
+ include $(GLSRCDIR)/devs.mak
diff --git a/print/ghostscript-gpl/files/patch-src:zmedia2.c b/print/ghostscript-gpl/files/patch-src:zmedia2.c
deleted file mode 100644
index 9033a4388085..000000000000
--- a/print/ghostscript-gpl/files/patch-src:zmedia2.c
+++ /dev/null
@@ -1,25 +0,0 @@
---- src/zmedia2.c.orig Fri Apr 27 02:57:41 2001
-+++ src/zmedia2.c Fri Nov 2 04:08:16 2001
-@@ -429,11 +429,17 @@
-
- rx = ry, ry = temp;
- }
-- /* Adjust the medium size if flexible. */
-- if (medium->p.x < MIN_MEDIA_SIZE && mx > rx)
-- mx = rx;
-- if (medium->p.y < MIN_MEDIA_SIZE && my > ry)
-- my = ry;
-+ /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry',
-+ respectively. Note that 'mx' and 'my' have just acquired the largest
-+ permissible value, medium->q. */
-+ if (medium->p.x < mx) /* non-empty width range */
-+ if (rx < medium->p.x) mx = medium->p.x; /* minimum */
-+ else if (mx > rx) mx = rx; /* fits */
-+ /* else use medium->q.x, i.e., the maximum */
-+ if (medium->p.y < my) /* non-empty height range */
-+ if (ry < medium->p.y) my = medium->p.y; /* minimum */
-+ else if (my > ry) my = ry; /* fits */
-+ /* else use medium->q.y, i.e., the maximum */
-
- /* Translate to align the centers. */
- gs_make_translation(mx / 2, my / 2, pmat);
diff --git a/print/ghostscript-gpl/files/patch-src__gdevperm.c b/print/ghostscript-gpl/files/patch-src__gdevperm.c
new file mode 100644
index 000000000000..da5d52ceedf8
--- /dev/null
+++ b/print/ghostscript-gpl/files/patch-src__gdevperm.c
@@ -0,0 +1,11 @@
+--- src/gdevperm.c.orig Fri Jun 18 16:00:47 2004
++++ src/gdevperm.c Fri Dec 31 18:06:42 2004
+@@ -289,7 +289,7 @@
+ (strncmp((const char *)name, (const char *)str, name_size) == 0))
+
+ private int
+-perm_get_color_comp_index(const gx_device *pdev, const char *pname,
++perm_get_color_comp_index(gx_device *pdev, const char *pname,
+ int name_size, int component_type)
+ {
+ const gx_device_perm_t * const dev = (const gx_device_perm_t *)pdev;