Update files from GTKWave to the latest from SVN.

This commit is contained in:
Cary R 2014-06-07 18:18:59 -07:00
parent f104ffc133
commit 6323e6a0a5
9 changed files with 431 additions and 431 deletions

View File

@ -1,4 +1,4 @@
/*
/*
FastLZ - lightning-fast lossless compression library
Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
@ -53,7 +53,7 @@
#define FASTLZ_INLINE inline
#elif defined(__BORLANDC__) || defined(_MSC_VER) || defined(__LCC__)
#define FASTLZ_INLINE __inline
#else
#else
#define FASTLZ_INLINE
#endif
@ -87,7 +87,7 @@ int fastlz_decompress(const void* input, int length, void* output, int maxout);
#define MAX_DISTANCE 8192
#if !defined(FASTLZ_STRICT_ALIGN)
#define FASTLZ_READU16(p) *((const flzuint16*)(p))
#define FASTLZ_READU16(p) *((const flzuint16*)(p))
#else
#define FASTLZ_READU16(p) ((p)[0] | (p)[1]<<8)
#endif
@ -233,7 +233,7 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void*
*hslot = anchor;
/* is this a match? check the first 3 bytes */
if(distance==0 ||
if(distance==0 ||
#if FASTLZ_LEVEL==1
(distance >= MAX_DISTANCE) ||
#else
@ -246,11 +246,11 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void*
/* far, needs at least 5-byte match */
if(distance >= MAX_DISTANCE)
{
if(*ip++ != *ref++ || *ip++!= *ref++)
if(*ip++ != *ref++ || *ip++!= *ref++)
goto literal;
len += 2;
}
match:
#endif
@ -346,7 +346,7 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void* input, int length, void*
while(len > MAX_LEN-2)
{
*op++ = (7 << 5) + (distance >> 8);
*op++ = MAX_LEN - 2 - 7 -2;
*op++ = MAX_LEN - 2 - 7 -2;
*op++ = (distance & 255);
len -= MAX_LEN-2;
}
@ -457,7 +457,7 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void
ref = op - ofs - MAX_DISTANCE;
}
#endif
#ifdef FASTLZ_SAFE
if (FASTLZ_UNEXPECT_CONDITIONAL(op + len + 3 > op_limit))
return 0;
@ -530,7 +530,7 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void
return 0;
#endif
*op++ = *ip++;
*op++ = *ip++;
for(--ctrl; ctrl; ctrl--)
*op++ = *ip++;

View File

@ -1,4 +1,4 @@
/*
/*
FastLZ - lightning-fast lossless compression library
Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
@ -47,11 +47,11 @@ extern "C" {
#endif
/**
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
minimum input buffer size is 16.
The output buffer must be at least 5% larger than the input buffer
The output buffer must be at least 5% larger than the input buffer
and can not be smaller than 66 bytes.
If the input is not compressible, the return value might be larger than
@ -63,9 +63,9 @@ extern "C" {
int fastlz_compress(const void* input, int length, void* output);
/**
Decompress a block of compressed data and returns the size of the
decompressed block. If error occurs, e.g. the compressed data is
corrupted or the output buffer is not large enough, then 0 (zero)
Decompress a block of compressed data and returns the size of the
decompressed block. If error occurs, e.g. the compressed data is
corrupted or the output buffer is not large enough, then 0 (zero)
will be returned instead.
The input buffer and the output buffer can not overlap.
@ -74,14 +74,14 @@ int fastlz_compress(const void* input, int length, void* output);
more than what is specified in maxout.
*/
int fastlz_decompress(const void* input, int length, void* output, int maxout);
int fastlz_decompress(const void* input, int length, void* output, int maxout);
/**
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
Compress a block of data in the input buffer and returns the size of
compressed block. The size of input buffer is specified by length. The
minimum input buffer size is 16.
The output buffer must be at least 5% larger than the input buffer
The output buffer must be at least 5% larger than the input buffer
and can not be smaller than 66 bytes.
If the input is not compressible, the return value might be larger than
@ -89,14 +89,14 @@ int fastlz_decompress(const void* input, int length, void* output, int maxout);
The input buffer and the output buffer can not overlap.
Compression level can be specified in parameter level. At the moment,
Compression level can be specified in parameter level. At the moment,
only level 1 and level 2 are supported.
Level 1 is the fastest compression and generally useful for short data.
Level 2 is slightly slower but it gives better compression ratio.
Note that the compressed data, regardless of the level, can always be
decompressed using the function fastlz_decompress above.
*/
*/
int fastlz_compress_level(int level, const void* input, int length, void* output);

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@ enum fstFileType {
FST_FT_VERILOG = 0,
FST_FT_VHDL = 1,
FST_FT_VERILOG_VHDL = 2,
FST_FT_VERILOG_VHDL = 2,
FST_FT_MAX = 2
};
@ -118,7 +118,7 @@ enum fstVarType {
FST_VT_VCD_REG = 5,
FST_VT_VCD_SUPPLY0 = 6,
FST_VT_VCD_SUPPLY1 = 7,
FST_VT_VCD_TIME = 8,
FST_VT_VCD_TIME = 8,
FST_VT_VCD_TRI = 9,
FST_VT_VCD_TRIAND = 10,
FST_VT_VCD_TRIOR = 11,

View File

@ -30,18 +30,18 @@
static char *lxt2_wr_vcd_truncate_bitvec(char *s)
{
char l, r;
char l, r;
r=*s;
if(r=='1')
if(r=='1')
{
return s;
}
}
else
{
s++;
}
for(;;s++)
{
l=r; r=*s;
@ -50,7 +50,7 @@ for(;;s++)
if(l!=r)
{
return(((l=='0')&&(r=='1'))?s:s-1);
}
}
}
}
@ -155,7 +155,7 @@ static lxt2_wr_ds_Tree * lxt2_wr_ds_insert(granmsk_t i, lxt2_wr_ds_Tree * t, int
/* Insert i into the tree t, unless it's already there. */
/* Return a pointer to the resulting tree. */
lxt2_wr_ds_Tree * n;
n = (lxt2_wr_ds_Tree *) calloc (1, sizeof (lxt2_wr_ds_Tree));
if (n == NULL) {
fprintf(stderr, "ds_insert: ran out of memory, exiting.\n");
@ -245,7 +245,7 @@ static lxt2_wr_dslxt_Tree * lxt2_wr_dslxt_insert(char *i, lxt2_wr_dslxt_Tree * t
/* Return a pointer to the resulting tree. */
lxt2_wr_dslxt_Tree * n;
int dir;
n = (lxt2_wr_dslxt_Tree *) calloc (1, sizeof (lxt2_wr_dslxt_Tree));
if (n == NULL) {
fprintf(stderr, "dslxt_insert: ran out of memory, exiting.\n");
@ -281,7 +281,7 @@ static lxt2_wr_dslxt_Tree * lxt2_wr_dslxt_insert(char *i, lxt2_wr_dslxt_Tree * t
/*
* functions which emit various big endian
* data to a file
*/
*/
static int lxt2_wr_emit_u8(struct lxt2_wr_trace *lt, int value)
{
unsigned char buf[1];
@ -340,7 +340,7 @@ return(rc);
* data to a file. (lt->position needs to be
* fixed up on gzclose so the tables don't
* get out of sync!)
*/
*/
static int gzwrite_buffered(struct lxt2_wr_trace *lt)
{
int rc = 1;
@ -446,7 +446,7 @@ return(rc);
static int lxt2_wr_emit_stringz(struct lxt2_wr_trace *lt, char *value)
{
int rc=1;
do
do
{
rc&=lxt2_wr_emit_u8z(lt, *value);
} while(*(value++));
@ -473,7 +473,7 @@ for(p=s;*p;p++)
{
h=h^(g>>24);
h=h^g;
}
}
}
h^=h2; /* combine the two hashes */
@ -500,17 +500,17 @@ struct lxt2_wr_symbol *temp;
hv=lxt2_wr_hash(s);
if(!(temp=lt->sym[hv])) return(NULL); /* no hash entry, add here wanted to add */
while(temp)
{
if(!strcmp(temp->name,s))
{
return(temp); /* in table already */
return(temp); /* in table already */
}
if(!temp->next) break;
temp=temp->next;
}
return(NULL); /* not found, add here if you want to add*/
}
@ -535,13 +535,13 @@ if(lt->compress_fac_str)
lxt2_wr_emit_u16z(lt, i);
lxt2_wr_emit_stringz(lt, str+i);
free(lt->compress_fac_str);
}
}
else
{
lxt2_wr_emit_u16z(lt, 0);
lxt2_wr_emit_stringz(lt, str);
}
lt->compress_fac_str = (char *) malloc((lt->compress_fac_len=len)+1);
strcpy(lt->compress_fac_str, str);
}
@ -567,10 +567,10 @@ while(lastch!=s->name)
if(*lastch=='[')
{
*lastch=0x00;
*lastch=0x00;
return;
}
lastch--;
lastch--;
}
return;
}
@ -597,19 +597,19 @@ if((lt)&&(lt->numfacs))
strip_brack(s);
s=s->symchain;
}
else
else
for(i=0;i<lt->numfacs;i++)
{
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
s=s->symchain;
}
}
wave_msort(lt->sorted_facs, lt->numfacs);
if(lt->partial_preference)
{
/* move preferenced facs up */
struct lxt2_wr_symbol **prefcache = aliascache;
int prefs_encountered = 0;
int prefs_encountered = 0;
facs_encountered = 0;
for(i=0;i<lt->numfacs;i++)
@ -700,7 +700,7 @@ if((lt)&&(lt->numfacs))
free(lt->compress_fac_str); lt->compress_fac_str=NULL;
lt->compress_fac_len=0;
lt->zfacname_predec_size = lt->zpackcount;
gzflush_buffered(lt, 1);
fseeko(lt->handle, 0L, SEEK_END);
lt->position=ftello(lt->handle);
@ -746,7 +746,7 @@ if((lt)&&(lt->numfacs))
}
/*
/*
* initialize the trace and get back an lt context
*/
struct lxt2_wr_trace *lxt2_wr_init(const char *name)
@ -805,15 +805,15 @@ if(lt)
{
lt->partial = 1;
lt->partial_zip = (zipmode != 0);
lt->partial_iter = LXT2_WR_PARTIAL_SIZE;
lt->partial_iter = LXT2_WR_PARTIAL_SIZE;
}
}
void lxt2_wr_set_partial_preference(struct lxt2_wr_trace *lt, const char *name)
{
struct lxt2_wr_symbol *s;
if((lt)&&(name)&&(!lt->sorted_facs))
if((lt)&&(name)&&(!lt->sorted_facs))
{
s=lxt2_wr_symfind(lt, name);
if(s)
@ -852,8 +852,8 @@ if(lt)
/*
* set initial value of trace (0, 1, x, z) only legal vals
*/
void lxt2_wr_set_initial_value(struct lxt2_wr_trace *lt, char value)
{
void lxt2_wr_set_initial_value(struct lxt2_wr_trace *lt, char value)
{
if(lt)
{
switch(value)
@ -991,7 +991,7 @@ return(sa);
}
/*
/*
* set current time/granule updating
*/
int lxt2_wr_inc_time_by_delta(struct lxt2_wr_trace *lt, unsigned int timeval)
@ -1221,7 +1221,7 @@ if(using_partial)
lxt2_wr_emit_u32(lt, partial_length+9); /* size of this section (uncompressed) */
lxt2_wr_emit_u32(lt, iter); /* begin iter of section */
fflush(lt->handle);
lt->zhandle = gzdopen(dup(fileno(lt->handle)), lt->zmode);
lt->zpackcount = 0;
}
@ -1331,7 +1331,7 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush))
lxt2_wr_emit_u32(lt, 0); /* size of this section (uncompressed) */
lxt2_wr_emit_u32(lt, ~0); /* control section */
fflush(lt->handle);
lt->zhandle = gzdopen(dup(fileno(lt->handle)), lt->zmode);
lt->zpackcount = 0;
}
@ -1354,9 +1354,9 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush))
exit(255);
}
lxt2_wr_emit_stringz(lt, ds->item);
lxt2_wr_emit_stringz(lt, ds->item);
ds2 = ds->next;
free(ds->item);
free(ds->item);
free(ds);
ds = ds2;
}
@ -1382,7 +1382,7 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush))
#endif
dt2 = dt->next;
free(dt);
free(dt);
dt = dt2;
}
lt->mapdict_head = lt->mapdict_curr = lt->mapdict = NULL;
@ -1399,11 +1399,11 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush))
if(using_partial_zip)
{
off_t c_len;
gzflush_buffered(lt, 1);
fseeko(lt->handle, 0L, SEEK_END);
lt->position=ftello(lt->handle);
c_len = lt->position - current_iter_pos - 12;
fseeko(lt->handle, current_iter_pos, SEEK_SET);
@ -1467,7 +1467,7 @@ if(lt)
{
lt->bumptime = 0;
if(!lt->flush_valid)
if(!lt->flush_valid)
{
lt->timepos++;
}
@ -1475,7 +1475,7 @@ if(lt)
{
lt->flush_valid = 0;
}
if(lt->timepos == LXT2_WR_GRANULE_SIZE)
{
/* fprintf(stderr, "flushing granule to disk at time %d\n", (unsigned int)timeval); */
@ -1484,7 +1484,7 @@ if(lt)
}
/* fprintf(stderr, "updating time to %d (%d dict entries/%d bytes)\n", (unsigned int)timeval, lt->num_dict_entries, lt->dict_string_mem_required); */
lt->timetable[lt->timepos] = timeval;
lt->timetable[lt->timepos] = timeval;
lt->lasttime = timeval;
}
}
@ -1493,7 +1493,7 @@ if(lt)
lt->timeset = 1;
lt->mintime = lt->maxtime = timeval;
lt->timetable[lt->timepos] = timeval;
lt->timetable[lt->timepos] = timeval;
}
if( (!lt->timepos) && (!lt->timegranule) )
@ -1524,7 +1524,7 @@ if(lt)
else if (s->flags&LXT2_WR_SYM_F_DOUBLE)
{
double value = 0;
sscanf(s->value, "%lg", &value);
errno = 0;
lxt2_wr_emit_value_double(lt, s, 0, value);
@ -1625,7 +1625,7 @@ int rc=0;
if((!lt)||(lt->blackout)||(!s)||(row)) return(rc);
if(!lt->emitted)
if(!lt->emitted)
{
lxt2_wr_emitfacs(lt);
lt->emitted = 1;
@ -1666,7 +1666,7 @@ if(s->flags&LXT2_WR_SYM_F_DOUBLE)
if(lt->dict_curr)
{
lt->dict_curr->next = lt->dict;
lt->dict_curr->next = lt->dict;
lt->dict_curr = lt->dict;
}
else
@ -1707,7 +1707,7 @@ int rc=0;
if((!lt)||(lt->blackout)||(!s)||(!value)||(row)) return(rc);
if(!lt->emitted)
if(!lt->emitted)
{
lxt2_wr_emitfacs(lt);
lt->emitted = 1;
@ -1746,7 +1746,7 @@ if(s->flags&LXT2_WR_SYM_F_STRING)
if(lt->dict_curr)
{
lt->dict_curr->next = lt->dict;
lt->dict_curr->next = lt->dict;
lt->dict_curr = lt->dict;
}
else
@ -1791,7 +1791,7 @@ int i;
if((!lt)||(lt->blackout)||(!s)||(!value)||(!*value)||(row)) return(rc);
if(!lt->emitted)
if(!lt->emitted)
{
lxt2_wr_emitfacs(lt);
lt->emitted = 1;
@ -1856,12 +1856,12 @@ if(!(s->flags&(LXT2_WR_SYM_F_DOUBLE|LXT2_WR_SYM_F_STRING)))
prevch = *vpnt;
while(*vpnt)
{
if(prevch == *vpnt)
if(prevch == *vpnt)
{
vpnt++;
}
else
{
{
prevch = 0;
break;
}
@ -1968,7 +1968,7 @@ idxchk: if(idx<0)
if(lt->dict_curr)
{
lt->dict_curr->next = lt->dict;
lt->dict_curr->next = lt->dict;
lt->dict_curr = lt->dict;
}
else
@ -2016,15 +2016,15 @@ struct lxt2_wr_symbol *s;
if((lt)&&(!lt->blackout))
{
if(!lt->emitted)
if(!lt->emitted)
{
lxt2_wr_emitfacs(lt);
lt->emitted = 1;
if(!lt->timeset)
{
lxt2_wr_set_time(lt, 0);
}
}
}
s = lt->symchain;
@ -2036,7 +2036,7 @@ if((lt)&&(!lt->blackout))
{
s->msk |= (LXT2_WR_GRAN_1VAL<<lt->timepos);
s->chg[s->chgpos] = LXT2_WR_ENC_BLACKOUT;
s->chgpos++;
}
else
@ -2158,7 +2158,7 @@ if(lt)
{
struct lxt2_wr_symbol *s = lt->symchain;
struct lxt2_wr_symbol *s2;
while(s)
{
free(s->name);
@ -2170,7 +2170,7 @@ if(lt)
lt->symchain=NULL;
}
free(lt->lxtname);
free(lt->sorted_facs);
fclose(lt->handle);
@ -2193,13 +2193,13 @@ if(lt)
/*
* time zero offset
* time zero offset
*/
void lxt2_wr_set_timezero(struct lxt2_wr_trace *lt, lxtstime_t timeval)
{
void lxt2_wr_set_timezero(struct lxt2_wr_trace *lt, lxtstime_t timeval)
{
if(lt)
{
{
lt->timezero = timeval;
}
}
}

View File

@ -3,19 +3,19 @@
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
@ -83,12 +83,12 @@ typedef unsigned long long granmsk_t;
#define LXT2_WR_GRAN_1VAL (LXT2_WR_ULLDESC(1))
#else
typedef unsigned int granmsk_t;
#define LXT2_WR_GRAN_0VAL (0)
#define LXT2_WR_GRAN_0VAL (0)
#define LXT2_WR_GRAN_1VAL (1)
#endif
enum LXT2_WR_Encodings {
enum LXT2_WR_Encodings {
LXT2_WR_ENC_0,
LXT2_WR_ENC_1,
LXT2_WR_ENC_INV,
@ -132,12 +132,12 @@ struct lxt2_wr_ds_tree_node {
*/
typedef struct lxt2_wr_dslxt_tree_node lxt2_wr_dslxt_Tree;
struct lxt2_wr_dslxt_tree_node {
lxt2_wr_dslxt_Tree * left, * right;
lxt2_wr_dslxt_Tree * left, * right;
char *item;
unsigned int val;
lxt2_wr_dslxt_Tree * next;
};
struct lxt2_wr_trace
{

View File

@ -132,7 +132,7 @@ static dslxt_Tree * dslxt_insert(char *i, dslxt_Tree * t, unsigned int val) {
/* Return a pointer to the resulting tree. */
dslxt_Tree * n;
int dir;
n = (dslxt_Tree *) calloc (1, sizeof (dslxt_Tree));
if (n == NULL) {
fprintf(stderr, "dslxt_insert: ran out of memory, exiting.\n");
@ -190,7 +190,7 @@ static dslxt_Tree * dslxt_delete(char *i, dslxt_Tree * t) {
/*
* functions which emit various big endian
* data to a file
*/
*/
static int lt_emit_u8(struct lt_trace *lt, int value)
{
unsigned char buf[1];
@ -271,7 +271,7 @@ return(nmemb);
static int lt_emit_string(struct lt_trace *lt, char *value)
{
int rc=1;
do
do
{
rc&=lt_emit_u8(lt, *value);
} while(*(value++));
@ -284,7 +284,7 @@ return(rc);
* data to a file. (lt->position needs to be
* fixed up on gzclose so the tables don't
* get out of sync!)
*/
*/
static int lt_emit_u8z(struct lt_trace *lt, int value)
{
unsigned char buf[1];
@ -371,7 +371,7 @@ return(nmemb);
static int lt_emit_stringz(struct lt_trace *lt, char *value)
{
int rc=1;
do
do
{
rc&=lt_emit_u8z(lt, *value);
} while(*(value++));
@ -383,7 +383,7 @@ return(rc);
* data to a file. (lt->position needs to be
* fixed up on BZ2_bzclose so the tables don't
* get out of sync!)
*/
*/
static int lt_emit_u8bz(struct lt_trace *lt, int value)
{
unsigned char buf[1];
@ -470,7 +470,7 @@ return(nmemb);
static int lt_emit_stringbz(struct lt_trace *lt, char *value)
{
int rc=1;
do
do
{
rc&=lt_emit_u8bz(lt, *value);
} while(*(value++));
@ -537,7 +537,7 @@ for(p=s;*p;p++)
{
h=h^(g>>24);
h=h^g;
}
}
}
h^=h2; /* combine the two hashes */
@ -564,17 +564,17 @@ struct lt_symbol *temp;
hv=lt_hash(s);
if(!(temp=lt->sym[hv])) return(NULL); /* no hash entry, add here wanted to add */
while(temp)
{
if(!strcmp(temp->name,s))
{
return(temp); /* in table already */
return(temp); /* in table already */
}
if(!temp->next) break;
temp=temp->next;
}
return(NULL); /* not found, add here if you want to add*/
}
@ -599,13 +599,13 @@ if(lt->compress_fac_str)
lt_emit_u16z(lt, i);
lt_emit_stringz(lt, str+i);
free(lt->compress_fac_str);
}
}
else
{
lt_emit_u16z(lt, 0);
lt_emit_stringz(lt, str);
}
lt->compress_fac_str = (char *) malloc((lt->compress_fac_len=len)+1);
strcpy(lt->compress_fac_str, str);
}
@ -626,10 +626,10 @@ while(lastch!=s->name)
if(*lastch=='[')
{
*lastch=0x00;
*lastch=0x00;
return;
}
lastch--;
lastch--;
}
return;
}
@ -655,12 +655,12 @@ if((lt)&&(lt->numfacs))
strip_brack(s);
s=s->symchain;
}
else
else
for(i=0;i<lt->numfacs;i++)
{
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing*/
s=s->symchain;
}
}
wave_msort(lt->sorted_facs, lt->numfacs);
for(i=0;i<lt->numfacs;i++)
@ -688,7 +688,7 @@ if((lt)&&(lt->numfacs))
free(lt->compress_fac_str); lt->compress_fac_str=NULL;
lt->compress_fac_len=0;
lt->zfacname_predec_size = lt->zpackcount;
gzclose(lt->zhandle);
fseeko(lt->handle, 0L, SEEK_END);
lt->position=ftello(lt->handle);
@ -723,13 +723,13 @@ if((lt)&&(lt->numfacs))
if(is_interlaced_trace)
{
lt->zhandle = gzdopen(dup(fileno(lt->handle)), "wb9");
lt->sync_table_offset = lt->position;
for(i=0;i<lt->numfacs;i++)
{
lt_emit_u32z(lt, lt->sorted_facs[i]->last_change);
}
gzclose(lt->zhandle); lt->zhandle = NULL;
fseeko(lt->handle, 0L, SEEK_END);
lt->position=ftello(lt->handle);
@ -740,7 +740,7 @@ if((lt)&&(lt->numfacs))
}
/*
/*
* initialize the trace and get back an lt context
*/
struct lt_trace *lt_init(const char *name)
@ -866,7 +866,7 @@ switch(numbytes_trans&3)
case 3: lt->lt_emit_u32(lt, numtrans); break;
}
/* printf("Clock finish for '%s' at %lld ending with '%c' for %d repeats over a switch delta of %d\n",
/* printf("Clock finish for '%s' at %lld ending with '%c' for %d repeats over a switch delta of %d\n",
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK, s->clk_delta); */
s->clk_prevtrans = ULLDescriptor(~0);
s->clk_numtrans = 0;
@ -967,7 +967,7 @@ switch(numbytes_trans&3)
case 3: lt->lt_emit_u32(lt, numtrans); break;
}
/* printf("Clock finish for '%s' at %lld ending with '%08x' for %d repeats over a switch delta of %lld\n",
/* printf("Clock finish for '%s' at %lld ending with '%08x' for %d repeats over a switch delta of %lld\n",
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK_M, s->clk_delta); */
s->clk_prevtrans = ULLDescriptor(~0);
s->clk_numtrans = 0;
@ -1035,7 +1035,7 @@ for(i=0;i<lt->num_dict_entries;i++)
/* fprintf(stderr, "%8d) '%s'\n", ds->val, ds->item); */
lt_emit_stringz(lt, ds->item+1);
}
gzclose(lt->zhandle);
fseeko(lt->handle, 0L, SEEK_END);
lt->position=ftello(lt->handle);
@ -1072,13 +1072,13 @@ if(lt)
if(s->clk_numtrans > LT_CLKPACK_M) lt_flushclock_m(lt, s);
}
else
{
{
if(s->clk_numtrans > LT_CLKPACK) lt_flushclock(lt, s);
}
}
s=s->symchain;
}
}
lt_set_dumpon(lt); /* in case it was turned off */
@ -1134,7 +1134,7 @@ if(lt)
while(t)
{
lt_emit_u32z(lt, t->position - lastposition); lastposition = t->position;
t=t->next;
t=t->next;
}
t=lt->timehead;
@ -1144,9 +1144,9 @@ if(lt)
{
lxttime_t delta = t->timeval - lasttime;
lt_emit_u64z(lt, (int)(delta>>32), (int)delta); lasttime = t->timeval;
t2=t->next;
free(t);
free(t);
t=t2;
}
}
@ -1155,12 +1155,12 @@ if(lt)
while(t)
{
lt_emit_u32z(lt, (int)(t->timeval - lasttime)); lasttime = t->timeval;
t2=t->next;
free(t);
free(t);
t=t2;
}
lt->timehead = lt->timecurr = NULL;
}
@ -1170,7 +1170,7 @@ if(lt)
lt->ztime_table_size = lt->position - lt->ztime_table_size;
}
if(lt->initial_value>=0)
if(lt->initial_value>=0)
{
lt->initial_value_offset = lt->position;
lt_emit_u8(lt, lt->initial_value);
@ -1185,7 +1185,7 @@ if(lt)
if(lt->double_used)
{
lt->double_test_offset = lt->position;
lt_emit_double(lt, 3.14159);
lt_emit_double(lt, 3.14159);
}
if(lt->dumpoffcount)
@ -1201,7 +1201,7 @@ if(lt)
lt_emit_u64(lt, (int)((ltt->timeval)>>32), (int)ltt->timeval);
ltt2 = ltt;
ltt=ltt->next;
free(ltt2);
free(ltt2);
}
lt->dumpoffhead = lt->dumpoffcurr = NULL;
@ -1253,7 +1253,7 @@ if(lt)
{
struct lt_symbol *sc = lt->symchain;
struct lt_symbol *s2;
while(sc)
{
free(sc->name);
@ -1262,7 +1262,7 @@ if(lt)
sc=s2;
}
}
free(lt->sorted_facs);
fclose(lt->handle);
free(lt);
@ -1368,7 +1368,7 @@ return(sa);
}
/*
/*
* set current time
*/
int lt_inc_time_by_delta(struct lt_trace *lt, unsigned int timeval)
@ -1407,7 +1407,7 @@ if(lt)
else
{
free(trl);
goto bail;
goto bail;
}
}
else
@ -1485,7 +1485,7 @@ if((lt)&&(!lt->emitted))
}
/*
* sets change interlace
* sets change interlace
*/
void lt_set_no_interlace(struct lt_trace *lt)
{
@ -1510,12 +1510,12 @@ if((lt)&&(!lt->emitted)&&(!lt->sorted_facs))
strip_brack(s);
s=s->symchain;
}
else
else
for(i=0;i<lt->numfacs;i++)
{
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
s=s->symchain;
}
}
wave_msort(lt->sorted_facs, lt->numfacs);
for(i=0;i<lt->numfacs;i++)
@ -1555,12 +1555,12 @@ if(lt)
{
int tag;
switch(value)
{
{
case '0': tag = 0; break;
case '1': tag = 1; break;
case 'Z':
case 'Z':
case 'z': tag = 2; break;
case 'X':
case 'X':
case 'x': tag = 3; break;
case 'H':
case 'h': tag = 4; break;
@ -1686,7 +1686,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
s->clk_mask <<= 1;
s->clk_mask |= 1;
if( ((s->clk_mask&0x1f)==0x1f) &&
if( ((s->clk_mask&0x1f)==0x1f) &&
( (delta1=(ivalue - s->clk_prevval1) & lt_optimask[s->len]) == ((s->clk_prevval1 - s->clk_prevval3) & lt_optimask[s->len]) ) &&
( (delta2=(s->clk_prevval - s->clk_prevval2) & lt_optimask[s->len]) == ((s->clk_prevval2 - s->clk_prevval4) & lt_optimask[s->len]) ) &&
( (delta1==delta2) || ((!delta1)&&(!delta2)) )
@ -1862,7 +1862,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
{
tag = (numbytes<<4);
}
lt->lt_emit_u8(lt, tag);
switch(numbytes&3)
{
@ -1883,7 +1883,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
}
lt->lt_emit_u8(lt, optimized ? (3+optimized1) : 0);
}
s->last_change = start_position;
if(s->rows>0)
@ -1949,7 +1949,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
{
if(lt->num_dict_entries==(256*65536)) lt->dict32_offset = lt->position;
}
lt->num_dict_entries++;
}
@ -1994,14 +1994,14 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
value <<= (24-len);
rc=lt->lt_emit_u24(lt, value);
}
else
else
{
value <<= (32-len);
rc=lt->lt_emit_u32(lt, value);
}
}
}
}
if(lt->timebuff)
{
lt->timechangecount++;
@ -2063,7 +2063,7 @@ if((s->flags)&LT_SYM_F_DOUBLE)
{
numbytes = 0;
}
start_position = lt->position;
s->last_change = start_position;
@ -2119,7 +2119,7 @@ if((s->flags)&LT_SYM_F_DOUBLE)
}
rc=lt->lt_emit_double(lt, value);
if(lt->timebuff)
{
lt->timechangecount++;
@ -2181,7 +2181,7 @@ if((s->flags)&LT_SYM_F_STRING)
{
numbytes = 0;
}
start_position = lt->position;
s->last_change = start_position;
@ -2237,7 +2237,7 @@ if((s->flags)&LT_SYM_F_STRING)
}
rc=lt->lt_emit_string(lt, value);
if(lt->timebuff)
{
lt->timechangecount++;
@ -2318,7 +2318,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
s->clk_mask <<= 1;
s->clk_mask |= legal;
if( ((s->clk_mask&0x1f)==0x1f) &&
if( ((s->clk_mask&0x1f)==0x1f) &&
( (delta1=(ivalue - s->clk_prevval1) & lt_optimask[s->len]) == ((s->clk_prevval1 - s->clk_prevval3) & lt_optimask[s->len]) ) &&
( (delta2=(s->clk_prevval - s->clk_prevval2) & lt_optimask[s->len]) == ((s->clk_prevval2 - s->clk_prevval4) & lt_optimask[s->len]) ) &&
( (delta1==delta2) || ((!delta1)&&(!delta2)) )
@ -2350,7 +2350,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
s->clk_prevval1 = s->clk_prevval;
s->clk_prevval = ivalue;
/* printf("Clock value '%08x' for '%s' [len=%d] at %lld (#%d)\n",
/* printf("Clock value '%08x' for '%s' [len=%d] at %lld (#%d)\n",
ivalue, s->name, len, lt->timeval, s->clk_numtrans); */
return(1);
}
@ -2480,12 +2480,12 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
while((ch=*(pnt++)))
{
switch(ch)
{
{
case '0':
case '1': mvl|=LT_MVL_2; break;
case 'Z':
case 'z':
case 'X':
case 'Z':
case 'z':
case 'X':
case 'x': mvl|=LT_MVL_4; break;
default: mvl|=LT_MVL_9; break;
}
@ -2494,13 +2494,13 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
}
switch(prevch)
{
{
case 0x00: tagadd = 0; break;
case '0': tagadd = 3; break;
case '1': tagadd = 4; break;
case 'Z':
case 'Z':
case 'z': tagadd = 5; break;
case 'X':
case 'X':
case 'x': tagadd = 6; break;
case 'H':
case 'h': tagadd = 7; break;
@ -2597,7 +2597,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
int outval = 0;
int thisval= 0;
pnt = value;
pnt = value;
if((lt->dictmode)&&(len2>lt->mindictwidth))
{
@ -2628,7 +2628,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
{
if(lt->num_dict_entries==(256*65536)) lt->dict32_offset = lt->position;
}
lt->num_dict_entries++;
}
@ -2666,8 +2666,8 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
outval |= (thisval<<bitpos);
bitpos--;
if((bitpos==-1)||(i==len2-1))
{
lt->lt_emit_u8(lt, outval);
{
lt->lt_emit_u8(lt, outval);
outval = 0;
bitpos = 7;
}
@ -2681,7 +2681,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
int outval = 0;
int thisval= 0;
pnt = value;
pnt = value;
for(i=0;i<len2;i++)
{
@ -2700,8 +2700,8 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
outval |= (thisval<<bitpos);
bitpos-=2;
if((bitpos==-2)||(i==len2-1))
{
lt->lt_emit_u8(lt, outval);
{
lt->lt_emit_u8(lt, outval);
outval = 0;
bitpos = 6;
}
@ -2715,7 +2715,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
int outval = 0;
int thisval= 0;
pnt = value;
pnt = value;
for(i=0;i<len2;i++)
{
@ -2744,8 +2744,8 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
outval |= (thisval<<bitpos);
bitpos-=4;
if((bitpos==-4)||(i==len2-1))
{
lt->lt_emit_u8(lt, outval);
{
lt->lt_emit_u8(lt, outval);
outval = 0;
bitpos = 4;
}
@ -2755,7 +2755,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
rc=1;
}
if(lt->timebuff)
{
lt->timechangecount++;

View File

@ -3,19 +3,19 @@
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
@ -47,11 +47,11 @@ extern "C" {
typedef struct dslxt_tree_node dslxt_Tree;
struct dslxt_tree_node {
dslxt_Tree * left, * right;
dslxt_Tree * left, * right;
char *item;
unsigned int val;
};
#define LT_HDRID (0x0138)
#define LT_VERSION (0x0004)
@ -180,7 +180,7 @@ unsigned double_used : 1;
unsigned do_strip_brackets : 1;
unsigned clock_compress : 1;
unsigned dictmode : 1; /* dictionary compression enabled */
unsigned zmode : 2; /* for value changes */
unsigned zmode : 2; /* for value changes */
unsigned emitted : 1; /* gate off change field zmode changes when set */
};
@ -252,9 +252,9 @@ void lt_set_dumpoff(struct lt_trace *lt);
void lt_set_dumpon(struct lt_trace *lt);
/*
* value change functions..note that if the value string len for
* lt_emit_value_bit_string() is shorter than the symbol length
* it will be left justified with the rightmost character used as
* value change functions..note that if the value string len for
* lt_emit_value_bit_string() is shorter than the symbol length
* it will be left justified with the rightmost character used as
* a repeat value that will be propagated to pad the value string out:
*
* "10x" for 8 bits becomes "10xxxxxx"

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Tony Bybell 1999.
*
* This program is free software; you can redistribute it and/or
@ -10,7 +10,7 @@
#ifndef WAVE_ALLOCA_H
#define WAVE_ALLOCA_H
#include <stdlib.h>
#if HAVE_ALLOCA_H
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#elif defined(__GNUC__)
#ifndef __MINGW32__
@ -25,5 +25,5 @@
#define alloca _alloca
#endif
#define wave_alloca alloca
#endif
#endif