]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Possible fixes for pstoraster...
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 16 Mar 2001 20:42:06 +0000 (20:42 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 16 Mar 2001 20:42:06 +0000 (20:42 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1637 7a7537e8-13f0-0310-91df-b6672ffda945

pstoraster/gdevprn.c
pstoraster/gdevprn.h
pstoraster/gxcldev.h
pstoraster/gxclist.h
pstoraster/gxclmem.c
pstoraster/gxclpath.c
pstoraster/gxclpath.h
pstoraster/gxclutil.c

index 57ddf56d4da42e47bdfd3bb89b9f3aaeca175d95..ff47bcd87f0a94d6aee9b844726dde1144d01f2c 100644 (file)
@@ -24,7 +24,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gdevprn.c,v 1.11 2001/03/08 15:13:14 mike Exp $ */
+/*$Id: gdevprn.c,v 1.12 2001/03/16 20:42:06 mike Exp $ */
 /* Generic printer driver support */
 #include "ctype_.h"
 #include "gdevprn.h"
@@ -815,10 +815,8 @@ gdev_prn_maybe_reallocate_memory(gx_device_printer *prdev,
 {
     int code = 0;
     gx_device *const pdev = (gx_device *)prdev;
-    gx_device_memory * const mdev = (gx_device_memory *)prdev;
        
-    /* The first test here used to be prdev->open.  See News for 5.50. */
-    if (mdev->base != 0 &&
+    if (prdev->is_open &&
        (memcmp(&prdev->space_params, old_sp, sizeof(*old_sp)) != 0 ||
         prdev->width != old_width || prdev->height != old_height )
        ) {
index b5754bd75af2f047253687659dd189bfd7a99974..18b7e5ed20ff6f480065048073c8653d2ee31405 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gdevprn.h,v 1.4 2000/03/08 23:14:25 mike Exp $ */
+/*$Id: gdevprn.h,v 1.5 2001/03/16 20:42:06 mike Exp $ */
 /* Common header file for memory-buffered printers */
 
 #ifndef gdevprn_INCLUDED
@@ -37,7 +37,7 @@
 #include "gsutil.h"            /* for memflip8x8 */
 #include "gxdevice.h"
 #include "gxdevmem.h"
-#include "gxclist.h"
+#include "gxcldev.h"
 #include "gsparam.h"
 
 /*
index ef572e568cb1f370a70306fa8898353c3630c0c9..dd94ea2e9e86929e815b35c3f2fcb8cc24218b57 100644 (file)
   GNU software to build or run it.
 */
 
-/*$Id: gxcldev.h,v 1.2 2000/03/08 23:14:51 mike Exp $ */
+/*$Id: gxcldev.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
 /* Internal definitions for Ghostscript command lists. */
 
 #ifndef gxcldev_INCLUDED
 #  define gxcldev_INCLUDED
 
-#include "gxclist.h"
 #include "gsropt.h"
 #include "gxht.h"              /* for gxdht.h */
 #include "gxtmap.h"            /* ditto */
@@ -247,6 +246,19 @@ typedef struct cmd_block_s {
 
 /* ---------------- Band state ---------------- */
 
+/* Define the prefix on each command run in the writing buffer. */
+typedef struct cmd_prefix_s cmd_prefix;
+struct cmd_prefix_s {
+    cmd_prefix *next;
+    uint size;
+};
+
+/* Define the pointers for managing a list of command runs in the buffer. */
+/* There is one of these for each band, plus one for band-range commands. */
+typedef struct cmd_list_s {
+    cmd_prefix *head, *tail;   /* list of commands for band */
+} cmd_list;
+
 /* Remember the current state of one band when writing or reading. */
 struct gx_clist_state_s {
     gx_color_index colors[2];  /* most recent colors */
@@ -281,6 +293,12 @@ struct gx_clist_state_s {
     ulong cost;                        /* cost of rendering the band */
 };
 
+/**** MRS: We need to include this here instead of the top to avoid lots of
+ ****      pointer errors.  Why the f**k does GS have to define so many
+ ****      interdependent structures?!?
+ ****/
+#include "gxclist.h"
+
 /* The initial values for a band state */
 /*static const gx_clist_state cls_initial */
 #define cls_initial_values\
@@ -555,6 +573,7 @@ int cmd_update_lop(P3(gx_device_clist_writer *, gx_clist_state *,
  * permanent_error, which prevents writing to the command list.
  */
 
+/**** MRS: Added cast to cdev->states since size of gx_clist_state is unknown ****/
 #define FOR_RECTS\
     BEGIN\
        int yend = y + height;\
@@ -565,7 +584,7 @@ int cmd_update_lop(P3(gx_device_clist_writer *, gx_clist_state *,
          return (cdev->permanent_error);\
        do {\
            int band = y / band_height;\
-           gx_clist_state *pcls = cdev->states + band;\
+           gx_clist_state *pcls = ((struct gx_clist_state_s *)cdev->states) + band;\
            int band_end = (band + 1) * band_height;\
 \
            height = min(band_end, yend) - y;\
index bb324feba36947a8a683abbfdddab0d345aff829..cdcccbe3863dde87930283d2e691f4b48a3697f4 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gxclist.h,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclist.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
 /* Command list definitions for Ghostscript. */
 /* Requires gxdevice.h and gxdevmem.h */
 
@@ -132,18 +132,6 @@ typedef struct {
 #define ts_bits(cldev,pts) (ts_mask(pts) + (cldev)->tile_band_mask_size)
 } tile_slot;
 
-/* Define the prefix on each command run in the writing buffer. */
-typedef struct cmd_prefix_s cmd_prefix;
-struct cmd_prefix_s {
-    cmd_prefix *next;
-    uint size;
-};
-
-/* Define the pointers for managing a list of command runs in the buffer. */
-/* There is one of these for each band, plus one for band-range commands. */
-typedef struct cmd_list_s {
-    cmd_prefix *head, *tail;   /* list of commands for band */
-} cmd_list;
 
 /*
  * In order to keep the per-band state down to a reasonable size,
@@ -208,9 +196,9 @@ typedef struct gx_device_clist_writer_s {
     byte *cbuf;                        /* start of command buffer */
     byte *cnext;               /* next slot in command buffer */
     byte *cend;                        /* end of command buffer */
-    cmd_list *ccl;             /* &clist_state.list of last command */
+    cmd_list *ccl;     /* &clist_state.list of last command */
     cmd_list band_range_list;  /* list of band-range commands */
-    int band_range_min, band_range_max;                /* range for list */
+    int band_range_min, band_range_max;        /* range for list */
     uint tile_max_size;                /* max size of a single tile (bytes) */
     uint tile_max_count;       /* max # of hash table entries */
     gx_strip_bitmap tile_params;       /* current tile parameters */
index 6cbcf3bbcb0116d46e3633578d12182637516fd0..ebba3ed633701db2e12b4fd68320c94fcb74c919 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gxclmem.c,v 1.5 2001/02/07 01:25:40 mike Exp $ */
+/*$Id: gxclmem.c,v 1.6 2001/03/16 20:42:06 mike Exp $ */
 /* RAM-based command list implementation */
 #include "memory_.h"
 #include "gx.h"
@@ -629,7 +629,7 @@ memfile_next_blk(MEMFILE * f)
     }                          /* end else (when we are compressing)                           */
 #endif /* HAVE_LIBZ */
 
-    return (0);
+    return (ecode);
 }
 
 int    /* returns # of chars actually written */
index 7f577e905716f8d2e876e3fd440713481da6ab0e..4096ad9c7c767dad02f52a62fee8838cd2ec9f31 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gxclpath.c,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclpath.c,v 1.3 2001/03/16 20:42:06 mike Exp $ */
 /* Higher-level path operations for band lists */
 #include "math_.h"
 #include "memory_.h"
@@ -163,7 +163,7 @@ cmd_clear_known(gx_device_clist_writer * cldev, uint known)
     gx_clist_state *pcls = cldev->states;
     int i;
 
-    for (i = cldev->nbands; --i >= 0; ++pcls)
+    for (i = cldev->nbands - 1; i >= 0; i --, pcls ++)
        pcls->known &= unknown;
 }
 
index cebaf8d2a330079a94bb34ac46d2d91d3a231aa5..5bca392df09f8132963e1d8f304477a8865056ee 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gxclpath.h,v 1.2 2000/03/08 23:14:53 mike Exp $ */
+/*$Id: gxclpath.h,v 1.3 2001/03/16 20:42:06 mike Exp $ */
 /* Extends (requires) gxcldev.h */
 
 #ifndef gxclpath_INCLUDED
@@ -191,7 +191,7 @@ void cmd_clear_known(P2(gx_device_clist_writer * cldev, uint known));
 
 /* Write out values of any unknown parameters. */
 #define cmd_do_write_unknown(cldev, pcls, must_know)\
-  ( ~(pcls)->known & (must_know) ?\
+  ( ~((pcls)->known) & (must_know) ?\
     cmd_write_unknown(cldev, pcls, must_know) : 0 )
 int cmd_write_unknown(P3(gx_device_clist_writer * cldev, gx_clist_state * pcls,
                         uint must_know));
index aec8ca01aa1adb2f36d583ce9ced7984bba42b8d..4b0e46acfe2e24c709fcd23f30ce2aa48f5598d8 100644 (file)
@@ -22,7 +22,7 @@
   GNU software to build or run it.
 */
 
-/*$Id: gxclutil.c,v 1.1 2000/03/08 23:14:54 mike Exp $ */
+/*$Id: gxclutil.c,v 1.2 2001/03/16 20:42:06 mike Exp $ */
 /* Command list writing utilities. */
 
 #include "memory_.h"
@@ -495,9 +495,9 @@ cmd_set_tile_phase(gx_device_clist_writer * cldev, gx_clist_state * pcls,
     if (code < 0)
        return code;
     ++dp;
-    cmd_putxy(pcls->tile_phase, dp);
     pcls->tile_phase.x = px;
     pcls->tile_phase.y = py;
+    cmd_putxy(pcls->tile_phase, dp);
     return 0;
 }