Fix some cppcheck warning issues

This commit is contained in:
Cary R 2016-09-13 23:44:44 -07:00
parent c706c5dd90
commit 5853e32f82
7 changed files with 8 additions and 44 deletions

View File

@ -1,6 +1,6 @@
// These are correct and are used to find the base (zero) pin.
thisSubtraction:netlist.h:4991
thisSubtraction:netlist.h:5000
thisSubtraction:netlist.h:5081
thisSubtraction:netlist.h:5090
// These are the functions that the compiler exports to the targets.
//ivl_branch_island()

View File

@ -1657,7 +1657,7 @@ NetExpr* PECallFunction::elaborate_access_func_(Design*des, NetScope*scope,
static NetExpr* check_for_enum_methods(const LineInfo*li,
Design*des, NetScope*scope,
const netenum_t*netenum,
pform_name_t use_path,
const pform_name_t&use_path,
perm_string method_name,
NetExpr*expr,
unsigned rtn_wid,

View File

@ -75,15 +75,8 @@
*/
NetAssign_* PExpr::elaborate_lval(Design*, NetScope*, bool, bool) const
{
NetNet*ll = 0;
if (ll == 0) {
cerr << get_fileline() << ": Assignment l-value too complex."
<< endl;
return 0;
}
NetAssign_*lv = new NetAssign_(ll);
return lv;
cerr << get_fileline() << ": Assignment l-value too complex." << endl;
return 0;
}
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2014 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2016 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -545,7 +545,7 @@ NetEConst* NetEBComp::eval_eqeq_real_(bool ne_flag, const NetExpr*le, const NetE
bool flag = get_real_arguments(le, re, lval, rval);
if (! flag) return 0;
verinum result(((lval == rval) ^ ne_flag) ?
verinum result(((lval == rval) != ne_flag) ?
verinum::V1 : verinum::V0, 1);
NetEConst*res = new NetEConst(result);
ivl_assert(*this, res);

View File

@ -558,7 +558,7 @@ void NetNet::calculate_slice_widths_from_packed_dims_(void)
ivl_assert(*this, ! slice_wids_.empty());
slice_wids_[0] = netrange_width(slice_dims_);
vector<netrange_t>::const_iterator cur = slice_dims_.begin();
for (size_t idx = 1 ; idx < slice_wids_.size() ; idx += 1, cur++) {
for (size_t idx = 1 ; idx < slice_wids_.size() ; idx += 1, ++cur) {
slice_wids_[idx] = slice_wids_[idx-1] / cur->width();
}
}

View File

@ -622,7 +622,6 @@ static void pform_put_wire_in_scope(perm_string name, PWire*net)
static void pform_put_enum_type_in_scope(enum_type_t*enum_set)
{
if (lexical_scope) {
ivl_assert(*enum_set, lexical_scope);
lexical_scope->enum_sets.insert(enum_set);
} else {
pform_enum_sets.insert(enum_set);

View File

@ -5,31 +5,3 @@ uninitVar:vvp_net.cc:167
// These functions are not used by Icarus
// __libvpi_c_dummy_function()
unusedFunction:libvpi.c:24
// yy_flex_strlen()
unusedFunction:lexor.cc:3632
// yy_scan_string()
unusedFunction:lexor.cc:3417
// yyget_debug()
unusedFunction:lexor.cc:3557
// yyget_in()
unusedFunction:lexor.cc:3501
// yyget_leng()
unusedFunction:lexor.cc:3517
// yyget_lineno()
unusedFunction:lexor.cc:3492
// yyget_out()
unusedFunction:lexor.cc:3509
// yyget_text()
unusedFunction:lexor.cc:3526
// yylex_destroy()
unusedFunction:lexor.cc:3596
// yypush_buffer_state()
unusedFunction:lexor.cc:3282
// yyset_debug()
unusedFunction:lexor.cc:3562
// yyset_in()
unusedFunction:lexor.cc:3547
// yyset_lineno()
unusedFunction:lexor.cc:3535
// yyset_out()
unusedFunction:lexor.cc:3552