Various warnings fixed.

This commit is contained in:
steve 2003-06-24 01:38:02 +00:00
parent bad861dba3
commit 21ff80075a
13 changed files with 70 additions and 50 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_expr.cc,v 1.79 2003/06/18 03:55:18 steve Exp $"
#ident "$Id: elab_expr.cc,v 1.80 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -498,6 +498,8 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
des->errors += 1;
return 0;
}
unsigned long ulsb=lsb;
unsigned long umsb=msb;
NetEConst*le = dynamic_cast<NetEConst*>(tmp);
assert(le);
@ -511,7 +513,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
the range, we sign extend signed unsized
numbers, zero extend unsigned unsigned numbers,
and X extend sized numbers. */
for (long idx = lsb ; idx <= msb ; idx += 1) {
for (unsigned long idx = ulsb ; idx <= umsb ; idx += 1) {
if (idx < exl.len())
result.set(idx-lsb, exl.get(idx));
else if (exl.is_string())
@ -562,7 +564,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
verinum::V rb = verinum::Vx;
long ridx = rv.as_long();
if ((ridx >= 0) && (ridx < lv.len())) {
if ((ridx >= 0) && ((unsigned long) ridx < lv.len())) {
rb = lv[ridx];
} else if ((ridx >= 0) && (!lv.has_len())) {
@ -962,6 +964,9 @@ NetExpr* PEUnary::elaborate_expr(Design*des, NetScope*scope, bool) const
/*
* $Log: elab_expr.cc,v $
* Revision 1.80 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.79 2003/06/18 03:55:18 steve
* Add arithmetic shift operators.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_scope.cc,v 1.24 2003/06/20 00:53:19 steve Exp $"
#ident "$Id: elab_scope.cc,v 1.25 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -257,7 +257,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
// about to create, and if I find it then somebody beat me to
// it.
if (NetScope*tmp = sc->child(get_name())) {
if (sc->child(get_name())) {
cerr << get_line() << ": error: Instance/Scope name " <<
get_name() << " already used in this context." <<
endl;
@ -549,6 +549,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/*
* $Log: elab_scope.cc,v $
* Revision 1.25 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.24 2003/06/20 00:53:19 steve
* Module attributes from the parser
* through to elaborated form.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_sig.cc,v 1.29 2003/06/21 01:21:43 steve Exp $"
#ident "$Id: elab_sig.cc,v 1.30 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -504,7 +504,7 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
long rnum = rval->as_long();
delete lval;
delete rval;
NetMemory*sig = new NetMemory(scope, name, wid, lnum, rnum);
new NetMemory(scope, name, wid, lnum, rnum);
// The constructor automatically adds the memory object
// to the scope. Do I need to set line number information?
@ -524,6 +524,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/*
* $Log: elab_sig.cc,v $
* Revision 1.30 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.29 2003/06/21 01:21:43 steve
* Harmless fixup of warnings.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_tree.cc,v 1.54 2003/06/05 04:28:24 steve Exp $"
#ident "$Id: eval_tree.cc,v 1.55 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -1198,11 +1198,11 @@ NetEConst* NetESelect::eval_tree()
verinum oval (verinum::V0, expr_width(), true);
long bval = base->value().as_long();
for (long idx = 0 ; idx < expr_width() ; idx += 1) {
if ((bval >= eval.len()) || (bval < 0))
oval.set(idx, verinum::Vx);
else
for (unsigned long idx = 0 ; idx < expr_width() ; idx += 1) {
if ((bval >= 0) && ((unsigned long) bval < eval.len()))
oval.set(idx, eval.get(bval));
else
oval.set(idx, verinum::Vx);
bval += 1;
}
@ -1458,6 +1458,9 @@ NetEConst* NetEUReduce::eval_tree()
/*
* $Log: eval_tree.cc,v $
* Revision 1.55 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.54 2003/06/05 04:28:24 steve
* Evaluate <= with real operands.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: expr_synth.cc,v 1.44 2003/04/19 04:52:56 steve Exp $"
#ident "$Id: expr_synth.cc,v 1.45 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -427,6 +427,7 @@ NetNet* NetEBShift::synthesize(Design*des)
assert(shift >= 0);
if (shift == 0)
return lsig;
unsigned long ushift=shift;
NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, expr_width());
@ -440,10 +441,10 @@ NetNet* NetEBShift::synthesize(Design*des)
connect(zcon->pin(0), zsig->pin(0));
for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) {
if (idx < shift) {
if (idx < ushift) {
connect(osig->pin(idx), zsig->pin(0));
} else {
connect(osig->pin(idx), lsig->pin(idx-shift));
connect(osig->pin(idx), lsig->pin(idx-ushift));
}
}
@ -731,6 +732,9 @@ NetNet* NetESignal::synthesize(Design*des)
/*
* $Log: expr_synth.cc,v $
* Revision 1.45 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.44 2003/04/19 04:52:56 steve
* Less picky about expression widths while synthesizing ternary.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_design.cc,v 1.36 2003/03/10 23:40:53 steve Exp $"
#ident "$Id: net_design.cc,v 1.37 2003/06/24 01:38:02 steve Exp $"
#endif
# include "config.h"
@ -439,7 +439,7 @@ void NetScope::evaluate_parameters(Design*des)
/* If the parameter has range information, then make
sure the value is set right. */
if (range_flag) {
long wid = (msb >= lsb)? msb - lsb : lsb - msb;
unsigned long wid = (msb >= lsb)? msb - lsb : lsb - msb;
wid += 1;
NetEConst*val = dynamic_cast<NetEConst*>((*cur).second.expr);
@ -685,6 +685,9 @@ void Design::delete_process(NetProcTop*top)
/*
* $Log: net_design.cc,v $
* Revision 1.37 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.36 2003/03/10 23:40:53 steve
* Keep parameter constants for the ivl_target API.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform.cc,v 1.116 2003/06/20 00:53:19 steve Exp $"
#ident "$Id: pform.cc,v 1.117 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -183,21 +183,6 @@ verinum* pform_verinum_with_size(verinum*siz, verinum*val,
return res;
}
/*
* This function evaluates delay expressions. The result should be a
* simple constant that I can interpret as an unsigned number.
*/
static unsigned long evaluate_delay(PExpr*delay)
{
PENumber*pp = dynamic_cast<PENumber*>(delay);
if (pp == 0) {
VLerror("Sorry, delay expression is too complicated.");
return 0;
}
return pp->value().as_ulong();
}
void pform_startmodule(const char*name, const char*file, unsigned lineno,
svector<named_pexpr_t*>*attr)
{
@ -1477,6 +1462,9 @@ int pform_parse(const char*path, FILE*file)
/*
* $Log: pform.cc,v $
* Revision 1.117 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.116 2003/06/20 00:53:19 steve
* Module attributes from the parser
* through to elaborated form.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.100 2003/06/23 01:25:44 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.101 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -1320,8 +1320,6 @@ extern "C" const char* ivl_scope_name(ivl_scope_t net)
if (net->parent == 0)
return net->name_;
ivl_scope_t cur;
unsigned needlen = scope_name_len(net);
if (name_size < needlen) {
@ -1850,6 +1848,9 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.101 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.100 2003/06/23 01:25:44 steve
* Module attributes make it al the way to ivl_target.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-expr.cc,v 1.36 2003/04/22 04:48:30 steve Exp $"
#ident "$Id: t-dll-expr.cc,v 1.37 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -236,8 +236,6 @@ void dll_target::expr_const(const NetEConst*net)
{
assert(expr_ == 0);
ivl_expr_t idx = 0;
expr_ = (ivl_expr_t)calloc(1, sizeof(struct ivl_expr_s));
assert(expr_);
expr_->value_= IVL_VT_VECTOR;
@ -603,6 +601,9 @@ void dll_target::expr_variable(const NetEVariable*net)
/*
* $Log: t-dll-expr.cc,v $
* Revision 1.37 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.36 2003/04/22 04:48:30 steve
* Support event names as expressions elements.
*

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-proc.cc,v 1.59 2003/05/14 05:26:41 steve Exp $"
#ident "$Id: t-dll-proc.cc,v 1.60 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -758,7 +758,6 @@ bool dll_target::proc_wait(const NetEvWait*net)
the signals weren't scanned yet. */
if (ev->nprobe() >= 1) {
const NetEvProbe*pr = ev->probe(0);
ivl_event_t evnt = stmt_cur_->u_.wait_.event_;
unsigned iany = 0;
@ -834,6 +833,9 @@ void dll_target::proc_while(const NetWhile*net)
/*
* $Log: t-dll-proc.cc,v $
* Revision 1.60 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.59 2003/05/14 05:26:41 steve
* Support real expressions in case statements.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.114 2003/06/23 01:25:44 steve Exp $"
#ident "$Id: t-dll.cc,v 1.115 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -1005,7 +1005,7 @@ void dll_target::udp(const NetUDP*net)
u->name = strings_.add(net->udp_name().c_str());
string inp;
char out;
int i = 0;
unsigned int i = 0;
if (net->first(inp, out))
do
{
@ -2132,6 +2132,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.115 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.114 2003/06/23 01:25:44 steve
* Module attributes make it al the way to ivl_target.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-xnf.cc,v 1.47 2003/01/30 16:23:08 steve Exp $"
#ident "$Id: t-xnf.cc,v 1.48 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -87,7 +87,7 @@ verinum::V link_get_ival(const Link&lnk)
if (cur == &lnk)
continue;
if (const NetNet*sig = dynamic_cast<const NetNet*>(cur->get_obj()))
if (dynamic_cast<const NetNet*>(cur->get_obj()))
return cur->nexus()->get_init();
}
@ -173,7 +173,7 @@ void target_xnf::draw_pin(ostream&os, const string&name,
use_name = use_name.substr(1);
}
char type;
char type=0;
switch (lnk.get_dir()) {
case Link::INPUT:
case Link::PASSIVE:
@ -183,6 +183,7 @@ void target_xnf::draw_pin(ostream&os, const string&name,
type = 'O';
break;
}
assert(type);
os << " PIN, " << use_name << ", " << type << ", " <<
choose_sig_name(&lnk);
@ -754,8 +755,6 @@ void target_xnf::lpm_ram_dq(const NetRamDq*ram)
{
assert(ram->count_partners() == 1);
const NetMemory*mem = ram->mem();
for (unsigned idx = 0 ; idx < ram->width() ; idx += 1) {
out_ << "SYM, " << mangle(ram->name())
<< "<" << idx << ">, RAMS" << endl;
@ -927,6 +926,9 @@ extern const struct target tgt_xnf = { "xnf", &target_xnf_obj };
/*
* $Log: t-xnf.cc,v $
* Revision 1.48 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.47 2003/01/30 16:23:08 steve
* Spelling fixes.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: xnfio.cc,v 1.26 2003/03/06 00:28:42 steve Exp $"
#ident "$Id: xnfio.cc,v 1.27 2003/06/24 01:38:03 steve Exp $"
#endif
# include "config.h"
@ -264,7 +264,6 @@ static void make_ibuf(Design*des, NetNet*net)
void xnfio_f::signal(Design*des, NetNet*net)
{
NetNode*buf;
if (! is_a_pad(net))
return;
@ -362,6 +361,9 @@ void xnfio(Design*des)
/*
* $Log: xnfio.cc,v $
* Revision 1.27 2003/06/24 01:38:03 steve
* Various warnings fixed.
*
* Revision 1.26 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*