[gs-cvs] rev 8364 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Wed Nov 14 10:09:05 PST 2007
Author: leonardo
Date: 2007-11-14 10:09:02 -0800 (Wed, 14 Nov 2007)
New Revision: 8364
Modified:
trunk/gs/src/gxclist.h
trunk/gs/src/gxclrast.c
Log:
Fix (clist) : A preparation for providing clist instruction ids and offsets to debug trace.
DETAILS :
We would like this change to be algorithmically equivalent,
but the proof is too complex. Therefore we commit it separately
in order to check for raster differences.
1. Inserted a new field into cmd_prefix_s.
For now this field is never used, but it changes memory allocation.
Due to that the bufferring in the clist writer goes slightly different.
Particularly it may cause new effects while restarting failed instructions.
2. Early return from top_up_cbuf when the stream is over.
The new code does not top up the last portion of the data stream.
It shouldn't be important for the reader, but we can't proove for sure.
This change is necessary because we want to add more fields to gx_clist_state_s,
and the new fields would be invalid after s_close resets stream::state.
See the next patch for details.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/gxclist.h
===================================================================
--- trunk/gs/src/gxclist.h 2007-11-14 02:22:53 UTC (rev 8363)
+++ trunk/gs/src/gxclist.h 2007-11-14 18:09:02 UTC (rev 8364)
@@ -133,6 +133,7 @@
struct cmd_prefix_s {
cmd_prefix *next;
uint size;
+ ulong id; /* Debug purpose only. */
};
/* Define the pointers for managing a list of command runs in the buffer. */
@@ -250,6 +251,7 @@
gs_pattern1_instance_t *pinst; /* Used when it is a pattern clist. */
bool cropping_by_path;
int cropping_min, cropping_max;
+ ulong ins_count; /* Debug purpose only. */
} gx_device_clist_writer;
/* Bits for gx_device_clist_writer.disable_mask. Bit set disables behavior */
Modified: trunk/gs/src/gxclrast.c
===================================================================
--- trunk/gs/src/gxclrast.c 2007-11-14 02:22:53 UTC (rev 8363)
+++ trunk/gs/src/gxclrast.c 2007-11-14 18:09:02 UTC (rev 8364)
@@ -149,6 +149,11 @@
uint nread;
byte *cb_top = pcb->data + (pcb->end - cbp);
+ if (seofp(pcb->s)) {
+ /* Return early because s_close did reset s->state. */
+ pcb->end_status = pcb->s->end_status;
+ return cbp;
+ }
memmove(pcb->data, cbp, pcb->end - cbp);
nread = pcb->end - cb_top;
pcb->end_status = sgets(pcb->s, cb_top, nread, &nread);
More information about the gs-cvs
mailing list