A few updates based on cppcheck results
This commit is contained in:
parent
d9478bd837
commit
7d78f5b2ea
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef IVL_netlist_H
|
#ifndef IVL_netlist_H
|
||||||
#define IVL_netlist_H
|
#define IVL_netlist_H
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998-2016 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 1998-2017 Stephen Williams (steve@icarus.com)
|
||||||
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
|
* Copyright CERN 2013 / 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
|
||||||
|
|
@ -4561,7 +4561,7 @@ class NetESFunc : public NetExpr {
|
||||||
|
|
||||||
bool takes_nargs_(ID func, unsigned nargs) {
|
bool takes_nargs_(ID func, unsigned nargs) {
|
||||||
if (nargs > 15) nargs = 15;
|
if (nargs > 15) nargs = 15;
|
||||||
return func & (1 << (nargs + 16));
|
return func & (1U << (nargs + 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* name_;
|
const char* name_;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998-2016 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 1998-2017 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
|
||||||
|
|
@ -844,7 +844,7 @@ void PCase::dump(ostream&out, unsigned ind) const
|
||||||
for (unsigned idx = 0 ; idx < items_->count() ; idx += 1) {
|
for (unsigned idx = 0 ; idx < items_->count() ; idx += 1) {
|
||||||
PCase::Item*cur = (*items_)[idx];
|
PCase::Item*cur = (*items_)[idx];
|
||||||
|
|
||||||
if (cur->expr.size()) {
|
if (! cur->expr.empty()) {
|
||||||
out << setw(ind+2) << "" << "default:";
|
out << setw(ind+2) << "" << "default:";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef IVL_svector_H
|
#ifndef IVL_svector_H
|
||||||
#define IVL_svector_H
|
#define IVL_svector_H
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 1999-2017 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
|
||||||
|
|
@ -57,7 +57,7 @@ template <class TYPE> class svector {
|
||||||
items_[l.nitems_+idx] = r[idx];
|
items_[l.nitems_+idx] = r[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
svector(const svector<TYPE>&l, TYPE r)
|
svector(const svector<TYPE>&l, TYPE&r)
|
||||||
: nitems_(l.nitems_ + 1), items_(new TYPE[nitems_])
|
: nitems_(l.nitems_ + 1), items_(new TYPE[nitems_])
|
||||||
{ for (unsigned idx = 0 ; idx < l.nitems_ ; idx += 1)
|
{ for (unsigned idx = 0 ; idx < l.nitems_ ; idx += 1)
|
||||||
items_[idx] = l[idx];
|
items_[idx] = l[idx];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2016 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2000-2017 Stephen Williams (steve@icarus.com)
|
||||||
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
|
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
|
||||||
* Copyright (c) 2016 CERN Michele Castellana (michele.castellana@cern.ch)
|
* Copyright (c) 2016 CERN Michele Castellana (michele.castellana@cern.ch)
|
||||||
*
|
*
|
||||||
|
|
@ -2134,7 +2134,7 @@ extern "C" int ivl_scope_func_signed(ivl_scope_t net)
|
||||||
assert(net);
|
assert(net);
|
||||||
assert(net->type_==IVL_SCT_FUNCTION);
|
assert(net->type_==IVL_SCT_FUNCTION);
|
||||||
assert(net->func_type==IVL_VT_LOGIC || net->func_type==IVL_VT_BOOL);
|
assert(net->func_type==IVL_VT_LOGIC || net->func_type==IVL_VT_BOOL);
|
||||||
return net->func_signed? !0 : 0;
|
return net->func_signed? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" unsigned ivl_scope_func_width(ivl_scope_t net)
|
extern "C" unsigned ivl_scope_func_width(ivl_scope_t net)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue