Cleanup a few more issues found with cppcheck.
Minor fixes and code reorganization to remove a few more issues that cppcheck is complaining about. It has a few false warnings and some issues that need more investigation.
This commit is contained in:
parent
5fb89262df
commit
ae49197a14
|
|
@ -931,11 +931,6 @@ NetNet* NetEUReduce::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
|||
return 0;
|
||||
}
|
||||
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, 1);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
NetUReduce::TYPE rtype = NetUReduce::NONE;
|
||||
|
||||
switch (op()) {
|
||||
|
|
@ -966,8 +961,13 @@ NetNet* NetEUReduce::synthesize(Design*des, NetScope*scope, NetExpr*root)
|
|||
|
||||
NetUReduce*gate = new NetUReduce(scope, scope->local_symbol(),
|
||||
rtype, isig->vector_width());
|
||||
|
||||
des->add_node(gate);
|
||||
|
||||
NetNet*osig = new NetNet(scope, scope->local_symbol(),
|
||||
NetNet::IMPLICIT, 1);
|
||||
osig->data_type(expr_type());
|
||||
osig->local_flag(true);
|
||||
|
||||
connect(gate->pin(0), osig->pin(0));
|
||||
for (unsigned idx = 0 ; idx < isig->pin_count() ; idx += 1)
|
||||
connect(gate->pin(1+idx), isig->pin(idx));
|
||||
|
|
|
|||
21
ivlpp/main.c
21
ivlpp/main.c
|
|
@ -371,6 +371,7 @@ int main(int argc, char*argv[])
|
|||
if (precomp_out_path) {
|
||||
precomp_out = fopen(precomp_out_path, "wb");
|
||||
if (precomp_out == 0) {
|
||||
if (out_path) fclose(out);
|
||||
perror(precomp_out_path);
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -379,6 +380,8 @@ int main(int argc, char*argv[])
|
|||
if (dep_path) {
|
||||
depend_file = fopen(dep_path, "a");
|
||||
if (depend_file == 0) {
|
||||
if (out_path) fclose(out);
|
||||
if (precomp_out) fclose(precomp_out);
|
||||
perror(dep_path);
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -386,27 +389,31 @@ int main(int argc, char*argv[])
|
|||
|
||||
if (source_cnt == 0) {
|
||||
fprintf(stderr, "%s: No input files given.\n", argv[0]);
|
||||
if (out_path) fclose(out);
|
||||
if (depend_file) fclose(depend_file);
|
||||
if (precomp_out) fclose(precomp_out);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Pass to the lexical analyzer the list of input file, and
|
||||
start scanning. */
|
||||
reset_lexor(out, source_list);
|
||||
if (yylex()) return -1;
|
||||
if (yylex()) {
|
||||
if (out_path) fclose(out);
|
||||
if (depend_file) fclose(depend_file);
|
||||
if (precomp_out) fclose(precomp_out);
|
||||
return -1;
|
||||
}
|
||||
destroy_lexor();
|
||||
|
||||
if (depend_file) {
|
||||
fclose(depend_file);
|
||||
}
|
||||
if (depend_file) fclose(depend_file);
|
||||
|
||||
if (precomp_out) {
|
||||
dump_precompiled_defines(precomp_out);
|
||||
fclose(precomp_out);
|
||||
}
|
||||
|
||||
if (out_path) {
|
||||
fclose(out);
|
||||
}
|
||||
if (out_path) fclose(out);
|
||||
|
||||
/* Free the source and include directory lists. */
|
||||
for (lp = 0; lp < source_cnt; lp += 1) {
|
||||
|
|
|
|||
|
|
@ -536,8 +536,10 @@ static vhdl_expr *translate_ufunc(ivl_expr_t e)
|
|||
int func_scope_sig = 0;
|
||||
for (int i = 0; i < nparams; i++) {
|
||||
vhdl_expr *param = translate_expr(ivl_expr_parm(e, i));
|
||||
if (NULL == param)
|
||||
if (NULL == param) {
|
||||
delete fcall;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Ensure the parameter has the correct VHDL type
|
||||
ivl_signal_t param_sig;
|
||||
|
|
|
|||
Loading…
Reference in New Issue