Skip to content

Commit b514760

Browse files
author
Daniel Kroening
committed
use size_t for a count
1 parent 08310a3 commit b514760

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/goto-cc/compile.cpp

Lines changed: 5 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,15 @@ compilet::~compilet()
673673
delete_directory(dir);
674674
}
675675

676-
unsigned compilet::function_body_count(const goto_functionst &functions) const
676+
std::size_t compilet::function_body_count(const goto_functionst &functions) const
677677
{
678-
int fbs=0;
678+
std::size_t count=0;
679679

680680
for(const auto &f : functions.function_map)
681681
if(f.second.body_available())
682-
fbs++;
682+
count++;
683683

684-
return fbs;
684+
return count;
685685
}
686686

687687
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)