Update GTKWave files to the latest from GTKWave CVS.

This update fixes a rare bug in the FST file creation process along
with a general sync of the files.
This commit is contained in:
Cary R 2010-11-01 15:04:46 -08:00 committed by Stephen Williams
parent 4fae068227
commit a359cc301c
3 changed files with 13 additions and 4 deletions

View File

@ -504,6 +504,7 @@ unsigned compress_hier : 1;
unsigned repack_on_close : 1;
unsigned skip_writing_section_hdr : 1;
unsigned size_limit_locked : 1;
unsigned section_header_only : 1;
/* should really be semaphores, but are bytes to cut down on read-modify-write window size */
unsigned char already_in_flush; /* in case control-c handlers interrupt */
@ -703,6 +704,13 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
xc->already_in_close = 1; /* never need to zero this out as it is freed at bottom */
if(xc->section_header_only && xc->section_header_truncpos)
{
fstFtruncate(fileno(xc->handle), xc->section_header_truncpos);
fseeko(xc->handle, xc->section_header_truncpos, SEEK_SET);
xc->section_header_only = 0;
}
xc->skip_writing_section_hdr = 1;
if(!xc->size_limit_locked)
{
@ -969,6 +977,7 @@ if(xc)
fputc(FST_BL_SKIP, xc->handle); /* temporarily tag the section, use FST_BL_VCDATA on finalize */
xc->section_start = ftello(xc->handle);
xc->section_header_only = 1; /* indicates truncate might be needed */
fstWriterUint64(xc->handle, 0); /* placeholder = section length */
fstWriterUint64(xc->handle, xc->is_initial_time ? xc->firsttime : xc->curtime); /* begin time of section */
fstWriterUint64(xc->handle, xc->curtime); /* end time of section (placeholder) */
@ -1024,6 +1033,7 @@ struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if((!xc)||(xc->vchn_siz <= 1)||(xc->already_in_flush)) return;
xc->already_in_flush = 1; /* should really do this with a semaphore */
xc->section_header_only = 0;
scratchpad = malloc(xc->vchn_siz);
fflush(xc->vchn_handle);
@ -1323,7 +1333,6 @@ if(xc->dump_size_limit)
}
}
if(!xc->skip_writing_section_hdr)
{
fstWriterEmitSectionHeader(xc); /* emit next section header */

View File

@ -126,7 +126,7 @@ union {
/* if htyp == FST_HT_VAR */
struct fstHierVar {
unsigned char typ; /* FST_VT_VCD_EVENT ... FST_VT_VCD_WOR */
unsigned char typ; /* FST_VT_VCD_EVENT ... FST_VT_VCD_REALTIME */
unsigned char direction; /* FST_VD_IMPLICIT ... FST_VD_INOUT */
const char *name;
uint32_t length;

View File

@ -996,8 +996,8 @@ if(rgh) lt_recurse_dictionary_free(lt, rgh);
static int lt_dictval_compare(const void *v1, const void *v2)
{
const dslxt_Tree *s1 = *(const dslxt_Tree * const *)v1;
const dslxt_Tree *s2 = *(const dslxt_Tree * const *)v2;
dslxt_Tree *s1 = *(dslxt_Tree **)v1;
dslxt_Tree *s2 = *(dslxt_Tree **)v2;
if(s1->val > s2->val) return(1); else return(-1); /* they're *never* equal */
}