Cleanup various style issues.
This patch cleans up some style issues: no need to check that a value is defined before freeing or deleting it, use C++ style casts, make sure to NULL terminate strncpy(), empty() is faster than size() for size == 0 or size >= 0 checks, re-scope some variables, etc.
This commit is contained in:
parent
6f9e364dab
commit
8cbff6def0
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2009 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -781,6 +781,7 @@ int main(int argc, char **argv)
|
||||||
/* Convert to a short name to remove any embedded spaces. */
|
/* Convert to a short name to remove any embedded spaces. */
|
||||||
GetShortPathName(tmp, basepath, sizeof basepath);
|
GetShortPathName(tmp, basepath, sizeof basepath);
|
||||||
strncpy(ivl_root, basepath, MAXSIZE);
|
strncpy(ivl_root, basepath, MAXSIZE);
|
||||||
|
ivl_root[MAXSIZE-1] = 0;
|
||||||
s = strrchr(ivl_root, sep);
|
s = strrchr(ivl_root, sep);
|
||||||
if (s) *s = 0;
|
if (s) *s = 0;
|
||||||
s = strrchr(ivl_root, sep);
|
s = strrchr(ivl_root, sep);
|
||||||
|
|
|
||||||
|
|
@ -1111,7 +1111,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
||||||
// unconnected_drive directive and for a
|
// unconnected_drive directive and for a
|
||||||
// unconnected input warning when asked for.
|
// unconnected input warning when asked for.
|
||||||
vector<PEIdent*> mport = rmod->get_port(idx);
|
vector<PEIdent*> mport = rmod->get_port(idx);
|
||||||
if (mport.size() == 0) continue;
|
if (mport.empty()) continue;
|
||||||
|
|
||||||
perm_string pname = peek_tail_name(mport[0]->path());
|
perm_string pname = peek_tail_name(mport[0]->path());
|
||||||
|
|
||||||
|
|
@ -1214,8 +1214,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
||||||
// that connects to the port.
|
// that connects to the port.
|
||||||
|
|
||||||
NetNet*sig;
|
NetNet*sig;
|
||||||
if ((prts.size() == 0)
|
if (prts.empty() || (prts[0]->port_type() == NetNet::PINPUT)) {
|
||||||
|| (prts[0]->port_type() == NetNet::PINPUT)) {
|
|
||||||
|
|
||||||
/* Input to module. elaborate the expression to
|
/* Input to module. elaborate the expression to
|
||||||
the desired width. If this in an instance
|
the desired width. If this in an instance
|
||||||
|
|
@ -1271,14 +1270,14 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
||||||
// width cast. Since a real is only one bit the whole
|
// width cast. Since a real is only one bit the whole
|
||||||
// thing needs to go to each instance when arrayed.
|
// thing needs to go to each instance when arrayed.
|
||||||
if ((sig->data_type() == IVL_VT_REAL ) &&
|
if ((sig->data_type() == IVL_VT_REAL ) &&
|
||||||
prts.size() && (prts[0]->data_type() != IVL_VT_REAL )) {
|
!prts.empty() && (prts[0]->data_type() != IVL_VT_REAL )) {
|
||||||
sig = cast_to_int(des, scope, sig,
|
sig = cast_to_int(des, scope, sig,
|
||||||
prts_vector_width/instance.size());
|
prts_vector_width/instance.size());
|
||||||
}
|
}
|
||||||
// If we have a bit/vector signal driving a real port
|
// If we have a bit/vector signal driving a real port
|
||||||
// then we convert the value to a real.
|
// then we convert the value to a real.
|
||||||
if ((sig->data_type() != IVL_VT_REAL ) &&
|
if ((sig->data_type() != IVL_VT_REAL ) &&
|
||||||
prts.size() && (prts[0]->data_type() == IVL_VT_REAL )) {
|
!prts.empty() && (prts[0]->data_type() == IVL_VT_REAL )) {
|
||||||
sig = cast_to_real(des, scope, sig);
|
sig = cast_to_real(des, scope, sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2008 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -52,7 +52,7 @@ NetAssign_::~NetAssign_()
|
||||||
}
|
}
|
||||||
|
|
||||||
assert( more == 0 );
|
assert( more == 0 );
|
||||||
if (word_) delete word_;
|
delete word_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetAssign_::set_word(NetExpr*r)
|
void NetAssign_::set_word(NetExpr*r)
|
||||||
|
|
@ -120,7 +120,7 @@ NetAssignBase::NetAssignBase(NetAssign_*lv, NetExpr*rv)
|
||||||
|
|
||||||
NetAssignBase::~NetAssignBase()
|
NetAssignBase::~NetAssignBase()
|
||||||
{
|
{
|
||||||
if (rval_) delete rval_;
|
delete rval_;
|
||||||
while (lval_) {
|
while (lval_) {
|
||||||
NetAssign_*tmp = lval_;
|
NetAssign_*tmp = lval_;
|
||||||
lval_ = tmp->more;
|
lval_ = tmp->more;
|
||||||
|
|
@ -141,7 +141,7 @@ const NetExpr* NetAssignBase::rval() const
|
||||||
|
|
||||||
void NetAssignBase::set_rval(NetExpr*r)
|
void NetAssignBase::set_rval(NetExpr*r)
|
||||||
{
|
{
|
||||||
if (rval_) delete rval_;
|
delete rval_;
|
||||||
rval_ = r;
|
rval_ = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2008 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -267,8 +267,7 @@ Nexus::Nexus(Link&that)
|
||||||
Nexus::~Nexus()
|
Nexus::~Nexus()
|
||||||
{
|
{
|
||||||
assert(list_ == 0);
|
assert(list_ == 0);
|
||||||
if (name_)
|
delete[] name_;
|
||||||
delete[]name_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Nexus::assign_lval() const
|
bool Nexus::assign_lval() const
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2002 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -140,7 +140,7 @@ NetPDelay::NetPDelay(NetExpr*d, NetProc*st)
|
||||||
|
|
||||||
NetPDelay::~NetPDelay()
|
NetPDelay::~NetPDelay()
|
||||||
{
|
{
|
||||||
if (expr_) delete expr_;
|
delete expr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t NetPDelay::delay() const
|
uint64_t NetPDelay::delay() const
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ bool NetScope::auto_name(const char*prefix, char pad, const char* suffix)
|
||||||
int pad_pos = strlen(prefix);
|
int pad_pos = strlen(prefix);
|
||||||
int max_pos = sizeof(tmp) - strlen(suffix) - 1;
|
int max_pos = sizeof(tmp) - strlen(suffix) - 1;
|
||||||
strncpy(tmp, prefix, sizeof(tmp));
|
strncpy(tmp, prefix, sizeof(tmp));
|
||||||
|
tmp[31] = 0;
|
||||||
|
|
||||||
// Try a variety of potential new names. Make sure the new
|
// Try a variety of potential new names. Make sure the new
|
||||||
// name is not in the parent scope. Keep looking until we are
|
// name is not in the parent scope. Keep looking until we are
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ NetPins::NetPins(unsigned npins)
|
||||||
|
|
||||||
NetPins::~NetPins()
|
NetPins::~NetPins()
|
||||||
{
|
{
|
||||||
if (pins_) delete[]pins_;
|
delete[] pins_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Link& NetPins::pin(unsigned idx)
|
Link& NetPins::pin(unsigned idx)
|
||||||
|
|
@ -1821,8 +1821,8 @@ NetCondit::NetCondit(NetExpr*ex, NetProc*i, NetProc*e)
|
||||||
NetCondit::~NetCondit()
|
NetCondit::~NetCondit()
|
||||||
{
|
{
|
||||||
delete expr_;
|
delete expr_;
|
||||||
if (if_) delete if_;
|
delete if_;
|
||||||
if (else_) delete else_;
|
delete else_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NetExpr* NetCondit::expr() const
|
const NetExpr* NetCondit::expr() const
|
||||||
|
|
|
||||||
6
pform.cc
6
pform.cc
|
|
@ -1123,7 +1123,7 @@ void pform_make_udp(perm_string name, list<perm_string>*parms,
|
||||||
const char*file, unsigned lineno)
|
const char*file, unsigned lineno)
|
||||||
{
|
{
|
||||||
unsigned local_errors = 0;
|
unsigned local_errors = 0;
|
||||||
assert(parms->size() > 0);
|
assert(!parms->empty());
|
||||||
|
|
||||||
/* Put the declarations into a map, so that I can check them
|
/* Put the declarations into a map, so that I can check them
|
||||||
off with the parameters in the list. If the port is already
|
off with the parameters in the list. If the port is already
|
||||||
|
|
@ -1437,7 +1437,6 @@ void pform_set_net_range(list<perm_string>*names,
|
||||||
}
|
}
|
||||||
|
|
||||||
delete names;
|
delete names;
|
||||||
if (range)
|
|
||||||
delete range;
|
delete range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1937,7 +1936,6 @@ void pform_makewire(const vlltype&li,
|
||||||
}
|
}
|
||||||
|
|
||||||
delete names;
|
delete names;
|
||||||
if (range)
|
|
||||||
delete range;
|
delete range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2090,7 +2088,6 @@ svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
||||||
res = tmp;
|
res = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (range)
|
|
||||||
delete range;
|
delete range;
|
||||||
delete names;
|
delete names;
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -2362,7 +2359,6 @@ void pform_set_port_type(const struct vlltype&li,
|
||||||
}
|
}
|
||||||
|
|
||||||
delete names;
|
delete names;
|
||||||
if (range)
|
|
||||||
delete range;
|
delete range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Helper functions for VHDL syntax elements.
|
* Helper functions for VHDL syntax elements.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Nick Gasson (nick@nickg.me.uk)
|
* Copyright (C) 2008-2010 Nick Gasson (nick@nickg.me.uk)
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -32,7 +32,7 @@ void emit_children(std::ostream &of,
|
||||||
bool trailing_newline = true)
|
bool trailing_newline = true)
|
||||||
{
|
{
|
||||||
// Don't indent if there are no children
|
// Don't indent if there are no children
|
||||||
if (children.size() == 0)
|
if (children.empty())
|
||||||
newline(of, level);
|
newline(of, level);
|
||||||
else {
|
else {
|
||||||
typename std::list<T*>::const_iterator it;
|
typename std::list<T*>::const_iterator it;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* VHDL variable and signal types.
|
* VHDL variable and signal types.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Nick Gasson (nick@nickg.me.uk)
|
* Copyright (C) 2008-2010 Nick Gasson (nick@nickg.me.uk)
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -159,7 +159,6 @@ vhdl_type::vhdl_type(const vhdl_type &other)
|
||||||
|
|
||||||
vhdl_type::~vhdl_type()
|
vhdl_type::~vhdl_type()
|
||||||
{
|
{
|
||||||
if (base_ != NULL)
|
|
||||||
delete base_;
|
delete base_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -691,7 +691,6 @@ static int show_stmt_assign_nb_real(ivl_statement_t net)
|
||||||
ivl_expr_t rval = ivl_stmt_rval(net);
|
ivl_expr_t rval = ivl_stmt_rval(net);
|
||||||
ivl_expr_t del = ivl_stmt_delay_expr(net);
|
ivl_expr_t del = ivl_stmt_delay_expr(net);
|
||||||
/* variables for the selection of word from an array. */
|
/* variables for the selection of word from an array. */
|
||||||
ivl_expr_t word_ix;
|
|
||||||
unsigned long use_word = 0;
|
unsigned long use_word = 0;
|
||||||
/* thread address for a word value. */
|
/* thread address for a word value. */
|
||||||
int word;
|
int word;
|
||||||
|
|
@ -715,7 +714,7 @@ static int show_stmt_assign_nb_real(ivl_statement_t net)
|
||||||
word = draw_eval_real(rval);
|
word = draw_eval_real(rval);
|
||||||
|
|
||||||
if (ivl_signal_dimensions(sig) > 0) {
|
if (ivl_signal_dimensions(sig) > 0) {
|
||||||
word_ix = ivl_lval_idx(lval);
|
ivl_expr_t word_ix = ivl_lval_idx(lval);
|
||||||
assert(word_ix);
|
assert(word_ix);
|
||||||
assign_to_array_r_word(sig, word_ix, word, delay, del, nevents);
|
assign_to_array_r_word(sig, word_ix, word, delay, del, nevents);
|
||||||
clr_word(word);
|
clr_word(word);
|
||||||
|
|
@ -1127,7 +1126,7 @@ static int show_stmt_case_r(ivl_statement_t net, ivl_scope_t sscope)
|
||||||
/* The out of the case. */
|
/* The out of the case. */
|
||||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+count);
|
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+count);
|
||||||
|
|
||||||
return 0;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void force_real_to_lval(ivl_statement_t net, int res)
|
static void force_real_to_lval(ivl_statement_t net, int res)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
static PLI_INT32 sys_finish_calltf(PLI_BYTE8 *name)
|
static PLI_INT32 sys_finish_calltf(PLI_BYTE8 *name)
|
||||||
{
|
{
|
||||||
vpiHandle callh, argv, arg;
|
vpiHandle callh, argv;
|
||||||
s_vpi_value val;
|
s_vpi_value val;
|
||||||
long diag_msg = 1;
|
long diag_msg = 1;
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ static PLI_INT32 sys_finish_calltf(PLI_BYTE8 *name)
|
||||||
callh = vpi_handle(vpiSysTfCall, 0);
|
callh = vpi_handle(vpiSysTfCall, 0);
|
||||||
argv = vpi_iterate(vpiArgument, callh);
|
argv = vpi_iterate(vpiArgument, callh);
|
||||||
if (argv) {
|
if (argv) {
|
||||||
arg = vpi_scan(argv);
|
vpiHandle arg = vpi_scan(argv);
|
||||||
vpi_free_object(argv);
|
vpi_free_object(argv);
|
||||||
val.format = vpiIntVal;
|
val.format = vpiIntVal;
|
||||||
vpi_get_value(arg, &val);
|
vpi_get_value(arg, &val);
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,10 @@
|
||||||
|
|
||||||
int is_escaped_id(const char *name)
|
int is_escaped_id(const char *name)
|
||||||
{
|
{
|
||||||
int lp;
|
|
||||||
|
|
||||||
assert(name);
|
assert(name);
|
||||||
/* The first digit must be alpha or '_' to be a normal id. */
|
/* The first digit must be alpha or '_' to be a normal id. */
|
||||||
if (isalpha((int)name[0]) || name[0] == '_') {
|
if (isalpha((int)name[0]) || name[0] == '_') {
|
||||||
|
int lp;
|
||||||
for (lp=1; name[lp] != '\0'; lp++) {
|
for (lp=1; name[lp] != '\0'; lp++) {
|
||||||
/* If this digit is not alpha-numeric or '_' we have
|
/* If this digit is not alpha-numeric or '_' we have
|
||||||
* an escaped identifier. */
|
* an escaped identifier. */
|
||||||
|
|
|
||||||
|
|
@ -1675,17 +1675,15 @@ void memory_delete(vpiHandle item)
|
||||||
struct __vpiArray*arr = ARRAY_HANDLE(item);
|
struct __vpiArray*arr = ARRAY_HANDLE(item);
|
||||||
if (arr->vals_words) delete [] (arr->vals_words-1);
|
if (arr->vals_words) delete [] (arr->vals_words-1);
|
||||||
|
|
||||||
if (arr->vals4) {
|
// if (arr->vals4) {}
|
||||||
// Delete the individual words?
|
// Delete the individual words?
|
||||||
// constant_delete(handle)?
|
// constant_delete(handle)?
|
||||||
delete arr->vals4;
|
delete arr->vals4;
|
||||||
}
|
|
||||||
|
|
||||||
if (arr->valsr) {
|
// if (arr->valsr) {}
|
||||||
// Delete the individual words?
|
// Delete the individual words?
|
||||||
// constant_delete(handle)?
|
// constant_delete(handle)?
|
||||||
delete arr->valsr;
|
delete arr->valsr;
|
||||||
}
|
|
||||||
|
|
||||||
if (arr->nets) {
|
if (arr->nets) {
|
||||||
for (unsigned idx = 0; idx < arr->array_count; idx += 1) {
|
for (unsigned idx = 0; idx < arr->array_count; idx += 1) {
|
||||||
|
|
|
||||||
|
|
@ -1629,7 +1629,7 @@ void compile_code(char*label, char*mnem, comp_operands_t opa)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opa) free(opa);
|
free(opa);
|
||||||
|
|
||||||
free(mnem);
|
free(mnem);
|
||||||
}
|
}
|
||||||
|
|
@ -1749,7 +1749,6 @@ void compile_thread(char*start_sym, char*flag)
|
||||||
schedule_vthread(thr, 0, push_flag);
|
schedule_vthread(thr, 0, push_flag);
|
||||||
|
|
||||||
free(start_sym);
|
free(start_sym);
|
||||||
if (flag != 0)
|
|
||||||
free(flag);
|
free(flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
24
vvp/udp.cc
24
vvp/udp.cc
|
|
@ -47,10 +47,12 @@ void udp_defns_delete()
|
||||||
{
|
{
|
||||||
for (unsigned idx = 0; idx < udp_defns_count; idx += 1) {
|
for (unsigned idx = 0; idx < udp_defns_count; idx += 1) {
|
||||||
if (udp_defns[idx]->is_sequential()) {
|
if (udp_defns[idx]->is_sequential()) {
|
||||||
vvp_udp_seq_s *obj = (vvp_udp_seq_s *) udp_defns[idx];
|
vvp_udp_seq_s *obj = static_cast<vvp_udp_seq_s *>
|
||||||
|
(udp_defns[idx]);
|
||||||
delete obj;
|
delete obj;
|
||||||
} else {
|
} else {
|
||||||
vvp_udp_comb_s *obj = (vvp_udp_comb_s *) udp_defns[idx];
|
vvp_udp_comb_s *obj = static_cast<vvp_udp_comb_s *>
|
||||||
|
(udp_defns[idx]);
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,8 +130,8 @@ vvp_udp_comb_s::vvp_udp_comb_s(char*label, char*name, unsigned ports)
|
||||||
|
|
||||||
vvp_udp_comb_s::~vvp_udp_comb_s()
|
vvp_udp_comb_s::~vvp_udp_comb_s()
|
||||||
{
|
{
|
||||||
if (levels0_) delete[] levels0_;
|
delete[] levels0_;
|
||||||
if (levels1_) delete[] levels1_;
|
delete[] levels1_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -320,13 +322,13 @@ vvp_udp_seq_s::vvp_udp_seq_s(char*label, char*name,
|
||||||
|
|
||||||
vvp_udp_seq_s::~vvp_udp_seq_s()
|
vvp_udp_seq_s::~vvp_udp_seq_s()
|
||||||
{
|
{
|
||||||
if (levels0_) delete[]levels0_;
|
delete[] levels0_;
|
||||||
if (levels1_) delete[]levels1_;
|
delete[] levels1_;
|
||||||
if (levelsx_) delete[]levelsx_;
|
delete[] levelsx_;
|
||||||
if (levelsL_) delete[]levelsL_;
|
delete[] levelsL_;
|
||||||
if (edges0_) delete[]edges0_;
|
delete[] edges0_;
|
||||||
if (edges1_) delete[]edges1_;
|
delete[] edges1_;
|
||||||
if (edgesL_) delete[]edgesL_;
|
delete[] edgesL_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void edge_based_on_char(struct udp_edges_table&cur, char chr, unsigned pos)
|
void edge_based_on_char(struct udp_edges_table&cur, char chr, unsigned pos)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -107,7 +107,7 @@ void delete_vpi_callback(struct __vpiCallback* ref)
|
||||||
assert(ref);
|
assert(ref);
|
||||||
assert(ref->base.vpi_type);
|
assert(ref->base.vpi_type);
|
||||||
assert(ref->base.vpi_type->type_code == vpiCallback);
|
assert(ref->base.vpi_type->type_code == vpiCallback);
|
||||||
if (ref->cb_sync != 0) delete ref->cb_sync;
|
delete ref->cb_sync;
|
||||||
delete ref;
|
delete ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1123,9 +1123,6 @@ static vpiHandle find_scope(const char *name, vpiHandle handle, int depth)
|
||||||
vpiHandle vpi_handle_by_name(const char *name, vpiHandle scope)
|
vpiHandle vpi_handle_by_name(const char *name, vpiHandle scope)
|
||||||
{
|
{
|
||||||
vpiHandle hand;
|
vpiHandle hand;
|
||||||
const char *nm, *cp;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
|
|
||||||
if (vpi_trace) {
|
if (vpi_trace) {
|
||||||
fprintf(vpi_trace, "vpi_handle_by_name(%s, %p) -->\n",
|
fprintf(vpi_trace, "vpi_handle_by_name(%s, %p) -->\n",
|
||||||
|
|
@ -1155,9 +1152,9 @@ vpiHandle vpi_handle_by_name(const char *name, vpiHandle scope)
|
||||||
|
|
||||||
if (hand) {
|
if (hand) {
|
||||||
/* remove hierarchical portion of name */
|
/* remove hierarchical portion of name */
|
||||||
nm = vpi_get_str(vpiFullName, hand);
|
const char *nm = vpi_get_str(vpiFullName, hand);
|
||||||
len = strlen(nm);
|
int len = strlen(nm);
|
||||||
cp = name + len;
|
const char *cp = name + len;
|
||||||
if (!strncmp(name, nm, len) && *cp == '.') name = cp + 1;
|
if (!strncmp(name, nm, len) && *cp == '.') name = cp + 1;
|
||||||
|
|
||||||
/* Ok, time to burn some cycles */
|
/* Ok, time to burn some cycles */
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2009 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2004-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -2195,7 +2195,7 @@ vvp_vector2_t& vvp_vector2_t::operator -= (const vvp_vector2_t&that)
|
||||||
|
|
||||||
vvp_vector2_t::~vvp_vector2_t()
|
vvp_vector2_t::~vvp_vector2_t()
|
||||||
{
|
{
|
||||||
if (vec_) delete[]vec_;
|
delete[] vec_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vvp_vector2_t::trim()
|
void vvp_vector2_t::trim()
|
||||||
|
|
@ -2886,8 +2886,8 @@ vvp_wide_fun_core::vvp_wide_fun_core(vvp_net_t*net, unsigned nports)
|
||||||
|
|
||||||
vvp_wide_fun_core::~vvp_wide_fun_core()
|
vvp_wide_fun_core::~vvp_wide_fun_core()
|
||||||
{
|
{
|
||||||
if (port_values_) delete[]port_values_;
|
delete[] port_values_;
|
||||||
if (port_rvalues_) delete[]port_rvalues_;
|
delete[] port_rvalues_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vvp_wide_fun_core::propagate_vec4(const vvp_vector4_t&bit,
|
void vvp_wide_fun_core::propagate_vec4(const vvp_vector4_t&bit,
|
||||||
|
|
|
||||||
14
vvp/words.cc
14
vvp/words.cc
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2003-2010 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -66,7 +66,7 @@ static void __compile_var_real(char*label, char*name,
|
||||||
array_attach_word(array, array_addr, obj);
|
array_attach_word(array, array_addr, obj);
|
||||||
}
|
}
|
||||||
free(label);
|
free(label);
|
||||||
if (name) delete[] name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void compile_var_real(char*label, char*name, int msb, int lsb)
|
void compile_var_real(char*label, char*name, int msb, int lsb)
|
||||||
|
|
@ -131,7 +131,7 @@ static void __compile_var(char*label, char*name,
|
||||||
if (obj) array_attach_word(array, array_addr, obj);
|
if (obj) array_attach_word(array, array_addr, obj);
|
||||||
}
|
}
|
||||||
free(label);
|
free(label);
|
||||||
if (name) delete[] name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void compile_variable(char*label, char*name,
|
void compile_variable(char*label, char*name,
|
||||||
|
|
@ -283,7 +283,7 @@ static void __compile_net2(vvp_net_t*node, vvp_array_t array,
|
||||||
vpip_attach_to_scope(scope,obj);
|
vpip_attach_to_scope(scope,obj);
|
||||||
|
|
||||||
free(my_label);
|
free(my_label);
|
||||||
if (name) delete[] name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __compile_net(char*label,
|
static void __compile_net(char*label,
|
||||||
|
|
@ -295,7 +295,7 @@ static void __compile_net(char*label,
|
||||||
vvp_array_t array = array_label? array_find(array_label) : 0;
|
vvp_array_t array = array_label? array_find(array_label) : 0;
|
||||||
assert(array_label ? array!=0 : true);
|
assert(array_label ? array!=0 : true);
|
||||||
|
|
||||||
if (array_label) free(array_label);
|
free(array_label);
|
||||||
|
|
||||||
assert(argc == 1);
|
assert(argc == 1);
|
||||||
vvp_net_t*node = vvp_net_lookup(argv[0].text);
|
vvp_net_t*node = vvp_net_lookup(argv[0].text);
|
||||||
|
|
@ -410,7 +410,7 @@ static void __compile_real_net2(vvp_net_t*node, vvp_array_t array,
|
||||||
vpip_attach_to_scope(scope, obj);
|
vpip_attach_to_scope(scope, obj);
|
||||||
|
|
||||||
free(my_label);
|
free(my_label);
|
||||||
if (name) delete[]name;
|
delete[] name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __compile_real(char*label, char*name,
|
static void __compile_real(char*label, char*name,
|
||||||
|
|
@ -421,7 +421,7 @@ static void __compile_real(char*label, char*name,
|
||||||
vvp_array_t array = array_label ? array_find(array_label) : 0;
|
vvp_array_t array = array_label ? array_find(array_label) : 0;
|
||||||
assert(array_label ? array!=0 : true);
|
assert(array_label ? array!=0 : true);
|
||||||
|
|
||||||
if (array_label) free(array_label);
|
free(array_label);
|
||||||
|
|
||||||
assert(argc == 1);
|
assert(argc == 1);
|
||||||
vvp_net_t*node = vvp_net_lookup(argv[0].text);
|
vvp_net_t*node = vvp_net_lookup(argv[0].text);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue