Skip to content

Commit 25f568d

Browse files
author
Daniel Kroening
committed
use size_t for a count
1 parent 8ea00d9 commit 25f568d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/goto-cc/compile.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ bool compilet::write_bin_object_file(
615615
if(write_goto_binary(outfile, lsymbol_table, functions))
616616
return true;
617617

618-
unsigned cnt=function_body_count(functions);
618+
const auto cnt = function_body_count(functions);
619619

620620
statistics() << "Functions: " << functions.function_map.size()
621621
<< "; " << cnt << " have a body." << eom;
@@ -673,15 +673,16 @@ compilet::~compilet()
673673
delete_directory(dir);
674674
}
675675

676-
unsigned compilet::function_body_count(const goto_functionst &functions) const
676+
std::size_t
677+
compilet::function_body_count(const goto_functionst &functions) const
677678
{
678-
int fbs=0;
679+
std::size_t count = 0;
679680

680681
for(const auto &f : functions.function_map)
681682
if(f.second.body_available())
682-
fbs++;
683+
count++;
683684

684-
return fbs;
685+
return count;
685686
}
686687

687688
void compilet::add_compiler_specific_defines(configt &config) const

src/goto-cc/compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class compilet : public messaget
104104
cmdlinet &cmdline;
105105
bool warning_is_fatal;
106106

107-
unsigned function_body_count(const goto_functionst &) const;
107+
std::size_t function_body_count(const goto_functionst &) const;
108108

109109
void add_compiler_specific_defines(class configt &config) const;
110110

0 commit comments

Comments
 (0)