Skip to content

Commit

Permalink
fix some scan-build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fschloesser committed May 20, 2022
1 parent b201432 commit 7452b65
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/abstractgraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ AbstractGraph::search(const bool canonical,
/*
* Compute backjumping level
*/
unsigned int backjumping_level = current_level+1-1;
unsigned int backjumping_level;
if(!first_path_orbits.is_minimal_representative(search_stack[gca_level_with_first].split_element))
{
backjumping_level = gca_level_with_first;
Expand Down
3 changes: 3 additions & 0 deletions src/bliss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ main(const int argc, const char** argv)
fclose(infile);

if(!g)
{
_fatal("Failed to read the graph, aborting");
exit(1); /* this is here because scan-build does not recognize _fatal exits. */
}

#ifndef _WIN32
if(verbose_level >= 2)
Expand Down
5 changes: 4 additions & 1 deletion src/digraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ Digraph::read_dimacs(FILE* const fp, FILE* const errstr)
unsigned int line_num = 1;

const bool verbose = false;
FILE* const verbstr = stdout;
FILE* verbstr;
if(verbose)
verbstr = stdout;


/* Read comments and the problem definition line */
while(1)
Expand Down
4 changes: 3 additions & 1 deletion src/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ Graph::read_dimacs(FILE* const fp, FILE* const errstr)
int c;

const bool verbose = false;
FILE* const verbstr = stdout;
FILE* verbstr;
if(verbose)
verbstr = stdout;

/* Read comments and the problem definition line */
while(1)
Expand Down

0 comments on commit 7452b65

Please sign in to comment.