New cppcheck cleanup

This commit is contained in:
Cary R 2026-02-08 22:40:14 -08:00
parent a838d5143d
commit f071957736
4 changed files with 14 additions and 12 deletions

View File

@ -31,7 +31,7 @@ functionStatic:net_link.cc:193
functionStatic:libmisc/StringHeap.cc
// Skip not initialized in the constructor for target scope
uninitMemberVar:t-dll.cc
uninitMemberVar:t-dll.cc:109
// By convention we put statics at the top scope.
variableScope:pform.cc:3461

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2025 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2026 Stephen Williams (steve@icarus.com)
* Copyright CERN 2012 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -528,7 +528,7 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const
cerr << get_fileline() << ": debug: Elaborate nets in "
<< "scope " << scope_path(*cur)
<< " in generate " << id_number << endl;
flag = elaborate_sig_(des, *cur) && flag;
flag &= elaborate_sig_(des, *cur) && flag;
}
return flag;
@ -574,6 +574,7 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
{
// Scan the declared PWires to elaborate the obvious signals
// in the current scope.
bool flag = true;
typedef map<perm_string,PWire*>::const_iterator wires_it_t;
for (wires_it_t wt = wires.begin()
; wt != wires.end() ; ++ wt ) {
@ -584,7 +585,8 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
cerr << get_fileline() << ": debug: Elaborate PWire "
<< cur->basename() << " in scope " << scope_path(scope) << endl;
cur->elaborate_sig(des, scope);
const NetNet* res = cur->elaborate_sig(des, scope);
flag &= (res != nullptr);
}
elaborate_sig_funcs(des, scope, funcs);
@ -593,23 +595,23 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
typedef list<PGenerate*>::const_iterator generate_it_t;
for (generate_it_t cur = generate_schemes.begin()
; cur != generate_schemes.end() ; ++ cur ) {
(*cur) -> elaborate_sig(des, scope);
flag &= (*cur)->elaborate_sig(des, scope);
}
typedef list<PGate*>::const_iterator pgate_list_it_t;
for (pgate_list_it_t cur = gates.begin()
; cur != gates.end() ; ++ cur ) {
(*cur) ->elaborate_sig(des, scope);
flag &= (*cur)->elaborate_sig(des, scope);
}
typedef list<PProcess*>::const_iterator proc_it_t;
for (proc_it_t cur = behaviors.begin()
; cur != behaviors.end() ; ++ cur ) {
(*cur) -> statement() -> elaborate_sig(des, scope);
(*cur)->statement()->elaborate_sig(des, scope);
}
return true;
return flag;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2025 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2026 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
@ -185,7 +185,7 @@ bool dll_target::make_single_lval_(const LineInfo*li, struct ivl_lval_s*cur, con
const NetAssign_*asn_nest = asn->nest();
ivl_assert(*li, asn_nest);
struct ivl_lval_s*cur_nest = new struct ivl_lval_s;
make_single_lval_(li, cur_nest, asn_nest);
flag &= make_single_lval_(li, cur_nest, asn_nest);
cur->type_ = IVL_LVAL_LVAL;
cur->n.nest = cur_nest;

View File

@ -22,7 +22,7 @@ invalidPointerCast:class_type.cc:338
invalidPointerCast:class_type.cc:339
cstyleCast:ufunc.cc:80
cstyleCast:vpi_priv.cc:229
cstyleCast:vpi_scope.cc:615
cstyleCast:vpi_scope.cc:603
// Skip the sscanf() field width limit warning
invalidscanf:compile.cc:597
@ -123,7 +123,7 @@ uninitMemberVar:vpi_event.cc:28
// Iterator values are set after creation
uninitMemberVar:vpi_iter.cc:41
// Scope values are set after creation
uninitMemberVar:vpi_scope.cc:353
uninitMemberVar:vpi_scope.cc:341
// The real var values are set after creation
uninitMemberVar:vpi_real.cc:158
// The PV values are set after creation