diff --git a/src/analyses/escape_analysis.cpp b/src/analyses/escape_analysis.cpp index b0129dfd0a6..507df39f770 100644 --- a/src/analyses/escape_analysis.cpp +++ b/src/analyses/escape_analysis.cpp @@ -319,7 +319,7 @@ bool escape_domaint::merge( { const std::set &b_cleanup=cleanup.second.cleanup_functions; std::set &a_cleanup=cleanup_map[cleanup.first].cleanup_functions; - unsigned old_size=a_cleanup.size(); + auto old_size=a_cleanup.size(); a_cleanup.insert(b_cleanup.begin(), b_cleanup.end()); if(a_cleanup.size()!=old_size) changed=true; @@ -379,7 +379,7 @@ void escape_domaint::check_lhs( { // count the aliases - unsigned count=0; + std::size_t count=0; for(const auto &alias : aliases) { diff --git a/src/analyses/goto_check.cpp b/src/analyses/goto_check.cpp index b6ee194dd9f..95345814426 100644 --- a/src/analyses/goto_check.cpp +++ b/src/analyses/goto_check.cpp @@ -572,7 +572,7 @@ void goto_checkt::integer_overflow_check( // The overflow checks are binary! // We break these up. - for(unsigned i=1; i=entries.size()) { @@ -188,11 +188,11 @@ void invariant_sett::add( unsigned f_r=eq_set.find(p.first); unsigned s_r=eq_set.find(p.second); - for(unsigned f=0; f(f, s)); } @@ -209,7 +209,7 @@ void invariant_sett::add_eq(const std::pair &p) bool constant_seen=false; mp_integer c; - for(unsigned i=0; i=2) { bool first=true; - for(unsigned j=0; jget_expr(i); @@ -938,8 +938,8 @@ bool invariant_sett::make_union(const invariant_sett &other) eq_set.intersection(other.eq_set); // inequalities - unsigned old_ne_set=ne_set.size(); - unsigned old_le_set=le_set.size(); + std::size_t old_ne_set=ne_set.size(); + std::size_t old_le_set=le_set.size(); intersection(ne_set, other.ne_set); intersection(le_set, other.le_set); diff --git a/src/analyses/uninitialized_domain.cpp b/src/analyses/uninitialized_domain.cpp index 48830ed204e..4f92eaebd49 100644 --- a/src/analyses/uninitialized_domain.cpp +++ b/src/analyses/uninitialized_domain.cpp @@ -81,7 +81,7 @@ bool uninitialized_domaint::merge( locationt from, locationt to) { - unsigned old_uninitialized=uninitialized.size(); + auto old_uninitialized=uninitialized.size(); uninitialized.insert( other.uninitialized.begin(), diff --git a/src/ansi-c/c_typecheck_code.cpp b/src/ansi-c/c_typecheck_code.cpp index 9715fc2e4d3..a45420839a4 100644 --- a/src/ansi-c/c_typecheck_code.cpp +++ b/src/ansi-c/c_typecheck_code.cpp @@ -151,7 +151,7 @@ void c_typecheck_baset::typecheck_asm(codet &code) typecheck_expr(code.op0()); - for(unsigned i=1; iis_assume() || p_it->is_assignment() || p_it->is_constraint()) { if(!p_it->ignore) diff --git a/src/cpp/cpp_declarator_converter.cpp b/src/cpp/cpp_declarator_converter.cpp index e01b7bacaf3..2ea5732f436 100644 --- a/src/cpp/cpp_declarator_converter.cpp +++ b/src/cpp/cpp_declarator_converter.cpp @@ -252,7 +252,7 @@ void cpp_declarator_convertert::combine_types( if(decl_code_type.return_type()==symbol_code_type.return_type() && decl_code_type.parameters().size()==symbol_code_type.parameters().size()) { - for(unsigned i=0; i( template_symbol.value.find("template_methods")); - for(unsigned i=0; i( - static_cast(template_methods.operands()[i])); + static_cast(tm)); // copy the type of the template method template_typet method_type= diff --git a/src/cpp/cpp_internal_additions.cpp b/src/cpp/cpp_internal_additions.cpp index 78384905a83..a193742643e 100644 --- a/src/cpp/cpp_internal_additions.cpp +++ b/src/cpp/cpp_internal_additions.cpp @@ -20,7 +20,7 @@ std::string c2cpp(const std::string &s) result.reserve(s.size()); - for(unsigned i=0; i::const_iterator cit2 = diff --git a/src/cpp/parse.cpp b/src/cpp/parse.cpp index 1cb4bfbe651..4de000d02eb 100644 --- a/src/cpp/parse.cpp +++ b/src/cpp/parse.cpp @@ -139,7 +139,7 @@ class new_scopet typedef std::map id_mapt; id_mapt id_map; - unsigned anon_count; + std::size_t anon_count; new_scopet *parent; @@ -382,7 +382,7 @@ class Parser // NOLINT(readability/identifiers) bool rMSCuuidof(exprt &); bool rMSC_if_existsExpr(exprt &); - unsigned number_of_errors; + std::size_t number_of_errors; irep_idt current_function; void merge_types(const typet &src, typet &dest); @@ -488,7 +488,7 @@ bool Parser::SyntaxError() cpp_tokent t[ERROR_TOKENS]; - for(unsigned i=0; i &lines) for(std::list::const_iterator it=lines.begin(); it!=lines.end(); it++) { - for(unsigned j=0; jtext.size(); j++) + for(std::size_t j=0; jtext.size(); j++) if(it->text[j]!=' ') { strip=j; @@ -104,7 +104,7 @@ std::string escape_latex(const std::string &s, bool alltt) { std::string dest; - for(unsigned i=0; igoto_stack.size()) stack_is_prefix=false; - for(unsigned i=0, ilim=label_stack.size(); + for(std::size_t i=0, ilim=label_stack.size(); i!=ilim && stack_is_prefix; ++i) { @@ -2189,7 +2189,7 @@ void goto_convert( goto_programt &dest, message_handlert &message_handler) { - const unsigned errors_before= + const std::size_t errors_before= message_handler.get_message_count(messaget::M_ERROR); goto_convertt goto_convert(symbol_table, message_handler); diff --git a/src/goto-programs/goto_convert_exceptions.cpp b/src/goto-programs/goto_convert_exceptions.cpp index f34d4d2f3fa..d51a16c13ad 100644 --- a/src/goto-programs/goto_convert_exceptions.cpp +++ b/src/goto-programs/goto_convert_exceptions.cpp @@ -127,7 +127,7 @@ void goto_convertt::convert_try_catch( // add a goto to the end of the 'try' block dest.add_instruction()->make_goto(end_target); - for(unsigned i=1; i &property_counters) + std::map &property_counters) { for(goto_programt::instructionst::iterator it=goto_program.instructions.begin(); @@ -75,7 +75,7 @@ void label_properties( if(prefix!="") prefix+="."; - unsigned &count=property_counters[prefix]; + std::size_t &count=property_counters[prefix]; count++; @@ -87,7 +87,7 @@ void label_properties( void label_properties(goto_programt &goto_program) { - std::map property_counters; + std::map property_counters; label_properties(goto_program, property_counters); } @@ -116,7 +116,7 @@ void set_properties( void label_properties(goto_functionst &goto_functions) { - std::map property_counters; + std::map property_counters; for(goto_functionst::function_mapt::iterator it=goto_functions.function_map.begin(); diff --git a/src/goto-programs/string_instrumentation.cpp b/src/goto-programs/string_instrumentation.cpp index 71cf5959e35..6e696c30042 100644 --- a/src/goto-programs/string_instrumentation.cpp +++ b/src/goto-programs/string_instrumentation.cpp @@ -126,16 +126,16 @@ class string_instrumentationt:public messaget goto_programt &dest, goto_programt::const_targett target, const code_function_callt::argumentst &arguments, - unsigned format_string_inx, - unsigned argument_start_inx, + std::size_t format_string_inx, + std::size_t argument_start_inx, const std::string &function_name); void do_format_string_write( goto_programt &dest, goto_programt::const_targett target, const code_function_callt::argumentst &arguments, - unsigned format_string_inx, - unsigned argument_start_inx, + std::size_t format_string_inx, + std::size_t argument_start_inx, const std::string &function_name); bool is_string_type(const typet &t) const @@ -392,8 +392,8 @@ void string_instrumentationt::do_format_string_read( goto_programt &dest, goto_programt::const_targett target, const code_function_callt::argumentst &arguments, - unsigned format_string_inx, - unsigned argument_start_inx, + std::size_t format_string_inx, + std::size_t argument_start_inx, const std::string &function_name) { const exprt &format_arg=arguments[format_string_inx]; @@ -405,7 +405,7 @@ void string_instrumentationt::do_format_string_read( format_token_listt token_list= parse_format_string(format_arg.op0().op0().get_string(ID_value)); - unsigned args=0; + std::size_t args=0; for(const auto &token : token_list) { @@ -459,7 +459,7 @@ void string_instrumentationt::do_format_string_read( comment += function_name; format_ass->source_location.set_comment(comment); - for(unsigned i=2; i args; - for(unsigned i=1; i args; - for(unsigned i=1; i args; - for(unsigned i=1; i SSA_stepst; SSA_stepst SSA_steps; - SSA_stepst::iterator get_SSA_step(unsigned s) + SSA_stepst::iterator get_SSA_step(std::size_t s) { SSA_stepst::iterator it=SSA_steps.begin(); for(; s!=0; s--) diff --git a/src/java_bytecode/java_local_variable_table.cpp b/src/java_bytecode/java_local_variable_table.cpp index e50e96f41d3..4561d24086f 100644 --- a/src/java_bytecode/java_local_variable_table.cpp +++ b/src/java_bytecode/java_local_variable_table.cpp @@ -86,10 +86,12 @@ struct procedure_local_cfg_baset< { return args.second.begin()->first; } + unsigned get_last_node(const method_with_amapt &args) const { return (--args.second.end())->first; } + unsigned nodes_empty(const method_with_amapt &args) const { return args.second.empty(); @@ -485,7 +487,7 @@ static void populate_live_range_holes( merge_into, expanded_live_range_start, sorted_by_startpc[0]->var.start_pc); - for(unsigned idx=0; idx &cmdlinet::get_values( int cmdlinet::getoptnr(char option) const { - for(unsigned i=0; isecond.pretty(indent+2, max_indent); } - unsigned count=0; + std::size_t count=0; forall_irep(it, get_sub()) { diff --git a/src/util/json_expr.cpp b/src/util/json_expr.cpp index 2fbb8155714..b2aa92bb199 100644 --- a/src/util/json_expr.cpp +++ b/src/util/json_expr.cpp @@ -353,7 +353,7 @@ json_objectt json( result["name"]=json_stringt("array"); json_arrayt &elements=result["elements"].make_array(); - unsigned index=0; + std::size_t index=0; forall_operands(it, expr) { @@ -377,7 +377,7 @@ json_objectt json( "number of struct components should match with its type"); json_arrayt &members=result["members"].make_array(); - for(unsigned m=0; m