[gs-cvs] rev 7157 - in trunk/gs: lib src

alexcher at ghostscript.com alexcher at ghostscript.com
Fri Nov 3 20:02:23 PST 2006


Author: alexcher
Date: 2006-11-03 20:02:22 -0800 (Fri, 03 Nov 2006)
New Revision: 7157

Modified:
   trunk/gs/lib/gs_lev2.ps
   trunk/gs/src/gsfont.c
   trunk/gs/src/zusparam.c
Log:
Accept negative argument for setcachelimit operator and silently substitute
with 0. Intercept setuserparams errors and re-throw them as setcachelimit
errors. Fix CET 27-06.ps.

DIFFERENCES:
None


Modified: trunk/gs/lib/gs_lev2.ps
===================================================================
--- trunk/gs/lib/gs_lev2.ps	2006-11-03 20:47:10 UTC (rev 7156)
+++ trunk/gs/lib/gs_lev2.ps	2006-11-04 04:02:22 UTC (rev 7157)
@@ -235,7 +235,10 @@
 
 % Redefine cache parameter setting to interact properly with userparams.
 /setcachelimit {
-  mark /MaxFontItem 2 .argindex .dicttomark setuserparams pop
+    { mark /MaxFontItem 2 .argindex .dicttomark setuserparams pop }
+  stopped
+    {  /setcachelimit .systemvar $error /errorname get signalerror
+    } if
 } .bind odef
 /setcacheparams {
 	% The MaxFontCache parameter is a system parameter, which we might

Modified: trunk/gs/src/gsfont.c
===================================================================
--- trunk/gs/src/gsfont.c	2006-11-03 20:47:10 UTC (rev 7156)
+++ trunk/gs/src/gsfont.c	2006-11-04 04:02:22 UTC (rev 7157)
@@ -642,8 +642,8 @@
 }
 int
 gs_setcacheupper(gs_font_dir * pdir, uint size)
-{
-    pdir->ccache.upper = size;
+{ 
+    pdir->ccache.upper = ((int)size < 0) ? 0 : size; /* ?: for CET 27-06 */
     return 0;
 }
 int

Modified: trunk/gs/src/zusparam.c
===================================================================
--- trunk/gs/src/zusparam.c	2006-11-03 20:47:10 UTC (rev 7156)
+++ trunk/gs/src/zusparam.c	2006-11-04 04:02:22 UTC (rev 7157)
@@ -56,8 +56,10 @@
 
 #if arch_sizeof_long > arch_sizeof_int
 #  define MAX_UINT_PARAM max_uint
+#  define MIN_INT_PARAM min_int
 #else
 #  define MAX_UINT_PARAM max_long
+#  define MIN_INT_PARAM min_long
 #endif
 
 typedef struct bool_param_def_s {
@@ -434,7 +436,7 @@
 {
     {"JobTimeout", 0, MAX_UINT_PARAM,
      current_JobTimeout, set_JobTimeout},
-    {"MaxFontItem", 0, MAX_UINT_PARAM,
+    {"MaxFontItem", MIN_INT_PARAM, MAX_UINT_PARAM,
      current_MaxFontItem, set_MaxFontItem},
     {"MinFontCompress", 0, MAX_UINT_PARAM,
      current_MinFontCompress, set_MinFontCompress},



More information about the gs-cvs mailing list