From 225ca1e205ae94db6fef12c109a7acbce97b2356 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sat, 23 Oct 2010 14:57:59 -0700 Subject: [PATCH] Change iterators to use prefix ++ since it is more efficient. This patch changes all the iterator code to use a prefix ++ instead of postfix since it is more efficient (no need for a temporary). It is likely that the compiler could optimize this away, but lets make it efficient from the start. --- HName.h | 6 ++--- Makefile.in | 2 +- Module.cc | 3 +-- design_dump.cc | 14 +++++------ elab_expr.cc | 2 +- elab_scope.cc | 44 +++++++++++++++++----------------- elab_sig.cc | 27 ++++++++++----------- elaborate.cc | 40 +++++++++++++++---------------- emit.cc | 14 +++++------ eval_attrib.cc | 2 +- functor.cc | 6 ++--- load_module.cc | 3 +-- main.cc | 33 +++++++++++--------------- net_design.cc | 16 ++++++------- net_event.cc | 9 ++++--- net_tran.cc | 2 +- netmisc.cc | 2 +- nodangle.cc | 2 +- parse.y | 4 ++-- pform.cc | 32 ++++++++++--------------- pform_disciplines.cc | 4 ++-- pform_dump.cc | 54 +++++++++++++++++++----------------------- t-dll-api.cc | 2 +- t-dll.cc | 8 +++---- vvp/delay.cc | 2 +- vvp/island_tran.cc | 12 +++++----- vvp/main.cc | 2 +- vvp/ufunc.cc | 2 +- vvp/vpi_vthr_vector.cc | 2 +- vvp/vthread.cc | 2 +- vvp/vvp_net.cc | 4 ++-- 31 files changed, 167 insertions(+), 190 deletions(-) diff --git a/HName.h b/HName.h index e78b7bb3fd..2409a356ab 100644 --- a/HName.h +++ b/HName.h @@ -1,7 +1,7 @@ #ifndef __HName_H #define __HName_H /* - * Copyright (c) 2001-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -94,10 +94,10 @@ inline ostream& operator<< (ostream&out, const list&ll) { list::const_iterator cur = ll.begin(); out << *cur; - cur ++; + ++ cur; while (cur != ll.end()) { out << "." << *cur; - cur ++; + ++ cur; } return out; } diff --git a/Makefile.in b/Makefile.in index 007c8181c4..bf7bda583e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -162,7 +162,7 @@ cppcheck: $(O:.o=.cc) $(srcdir)/dosify.c $(srcdir)/version.c cppcheck-all: $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) cppcheck && ) true $(foreach dir,$(NOTUSED),$(MAKE) -C $(dir) cppcheck && ) true - cppcheck + $(MAKE) cppcheck Makefile: $(srcdir)/Makefile.in config.status ./config.status --file=$@ diff --git a/Module.cc b/Module.cc index 215dfb3793..40871d059d 100644 --- a/Module.cc +++ b/Module.cc @@ -93,8 +93,7 @@ unsigned Module::find_port(const char*name) const PGate* Module::get_gate(perm_string name) { for (list::iterator cur = gates_.begin() - ; cur != gates_.end() - ; cur ++ ) { + ; cur != gates_.end() ; ++ cur ) { if ((*cur)->get_name() == name) return *cur; diff --git a/design_dump.cc b/design_dump.cc index 2eb7c87932..4b27d07815 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -1112,7 +1112,7 @@ void NetScope::dump(ostream&o) const { map::const_iterator pp; for (pp = parameters.begin() - ; pp != parameters.end() ; pp ++) { + ; pp != parameters.end() ; ++ pp ) { o << " parameter "; o << pp->second.type << " "; @@ -1162,7 +1162,7 @@ void NetScope::dump(ostream&o) const } for (pp = localparams.begin() - ; pp != localparams.end() ; pp ++) { + ; pp != localparams.end() ; ++ pp ) { o << " localparam " << (*pp).first << " = " << *(*pp).second.expr << ";" << endl; } @@ -1172,7 +1172,7 @@ void NetScope::dump(ostream&o) const { list >::const_iterator pp; for (pp = defparams.begin() - ; pp != defparams.end() ; pp ++ ) { + ; pp != defparams.end() ; ++ pp ) { o << " defparam " << (*pp).first << " = " << *(*pp).second << ";" << endl; } @@ -1181,7 +1181,7 @@ void NetScope::dump(ostream&o) const { list,NetExpr*> >::const_iterator pp; for (pp = defparams_later.begin() - ; pp != defparams_later.end() ; pp ++ ) { + ; pp != defparams_later.end() ; ++ pp ) { o << " defparam(later) " << pp->first << " = " << *(pp->second) << ";" << endl; } @@ -1203,7 +1203,7 @@ void NetScope::dump(ostream&o) const // Dump specparams typedef map::const_iterator specparam_it_t; for (specparam_it_t cur = specparams.begin() - ; cur != specparams.end() ; cur ++ ) { + ; cur != specparams.end() ; ++ cur ) { o << " specparam " << (*cur).first << " = "; spec_val_t value = (*cur).second; @@ -1240,7 +1240,7 @@ void NetScope::dump(ostream&o) const /* Dump any sub-scopes. */ for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->dump(o); } @@ -1518,7 +1518,7 @@ void Design::dump(ostream&o) const o << "DESIGN TIME PRECISION: 10e" << get_precision() << endl; o << "SCOPES:" << endl; for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->dump(o); o << "ELABORATED NODES:" << endl; diff --git a/elab_expr.cc b/elab_expr.cc index 4a1e1385f7..4c8ede40bf 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -1984,7 +1984,7 @@ static void probe_index_expr_width(Design*des, NetScope*scope, const name_component_t&name) { for (list::const_iterator cur = name.index.begin() - ; cur != name.index.end() ; cur ++) { + ; cur != name.index.end() ; ++ cur ) { if (cur->msb) probe_expr_width(des, scope, cur->msb); diff --git a/elab_scope.cc b/elab_scope.cc index 9814feabee..7116aff88e 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -53,7 +53,7 @@ static void collect_scope_parameters_(NetScope*scope, const map¶meters) { for (mparm_it_t cur = parameters.begin() - ; cur != parameters.end() ; cur ++) { + ; cur != parameters.end() ; ++ cur ) { NetEParam*tmp = new NetEParam; tmp->set_line(*((*cur).second.expr)); @@ -68,7 +68,7 @@ static void collect_scope_localparams_(NetScope*scope, const map&localparams) { for (mparm_it_t cur = localparams.begin() - ; cur != localparams.end() ; cur ++) { + ; cur != localparams.end() ; ++ cur ) { NetEParam*tmp = new NetEParam; tmp->set_line(*((*cur).second.expr)); @@ -172,7 +172,7 @@ static void elaborate_scope_parameters_(Design*des, NetScope*scope, const map¶meters) { for (mparm_it_t cur = parameters.begin() - ; cur != parameters.end() ; cur ++) { + ; cur != parameters.end() ; ++ cur ) { // A parameter can not have the same name as a genvar. if (scope->find_genvar((*cur).first)) { @@ -191,7 +191,7 @@ static void elaborate_scope_localparams_(Design*des, NetScope*scope, const map&localparams) { for (mparm_it_t cur = localparams.begin() - ; cur != localparams.end() ; cur ++) { + ; cur != localparams.end() ; ++ cur ) { // A localparam can not have the same name as a genvar. if (scope->find_genvar((*cur).first)) { @@ -210,7 +210,7 @@ static void replace_scope_parameters_(NetScope*scope, const LineInfo&loc, const Module::replace_t&replacements) { for (Module::replace_t::const_iterator cur = replacements.begin() - ; cur != replacements.end() ; cur ++) { + ; cur != replacements.end() ; ++ cur ) { NetExpr*val = (*cur).second; if (val == 0) { @@ -240,7 +240,7 @@ static void elaborate_scope_events_(Design*des, NetScope*scope, const map&events) { for (map::const_iterator et = events.begin() - ; et != events.end() ; et ++ ) { + ; et != events.end() ; ++ et ) { (*et).second->elaborate_scope(des, scope); } @@ -253,7 +253,7 @@ static void elaborate_scope_tasks(Design*des, NetScope*scope, typedef map::const_iterator tasks_it_t; for (tasks_it_t cur = tasks.begin() - ; cur != tasks.end() ; cur ++ ) { + ; cur != tasks.end() ; ++ cur ) { hname_t use_name( (*cur).first ); // A task can not have the same name as another scope object. @@ -308,7 +308,7 @@ static void elaborate_scope_funcs(Design*des, NetScope*scope, typedef map::const_iterator funcs_it_t; for (funcs_it_t cur = funcs.begin() - ; cur != funcs.end() ; cur ++ ) { + ; cur != funcs.end() ; ++ cur ) { hname_t use_name( (*cur).first ); // A function can not have the same name as another scope object. @@ -376,7 +376,7 @@ class generate_schemes_work_item_t : public elaborator_work_item_t { // elaboration. typedef list::const_iterator generate_it_t; for (generate_it_t cur = mod_->generate_schemes.begin() - ; cur != mod_->generate_schemes.end() ; cur ++ ) { + ; cur != mod_->generate_schemes.end() ; ++ cur ) { (*cur) -> generate_scope(des, scope_); } } @@ -399,7 +399,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope, // Add the genvars to the scope. typedef map::const_iterator genvar_it_t; - for (genvar_it_t cur = genvars.begin(); cur != genvars.end(); cur++ ) { + for (genvar_it_t cur = genvars.begin(); cur != genvars.end(); ++ cur ) { scope->add_genvar((*cur).first, (*cur).second); } @@ -446,7 +446,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope, typedef list::const_iterator defparms_iter_t; for (defparms_iter_t cur = defparms.begin() - ; cur != defparms.end() ; cur ++) { + ; cur != defparms.end() ; ++ cur ) { PExpr*ex = cur->second; assert(ex); @@ -496,7 +496,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope, typedef list::const_iterator gates_it_t; for (gates_it_t cur = gates_.begin() - ; cur != gates_.end() ; cur ++ ) { + ; cur != gates_.end() ; ++ cur ) { (*cur) -> elaborate_scope(des, scope); } @@ -509,7 +509,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope, typedef list::const_iterator proc_it_t; for (proc_it_t cur = behaviors.begin() - ; cur != behaviors.end() ; cur ++ ) { + ; cur != behaviors.end() ; ++ cur ) { (*cur) -> statement() -> elaborate_scope(des, scope); } @@ -849,7 +849,7 @@ bool PGenerate::generate_scope_case_(Design*des, NetScope*container) // Detect that the item is a default. if (item->item_test.size() == 0) { default_item = item; - cur ++; + ++ cur; continue; } @@ -881,7 +881,7 @@ bool PGenerate::generate_scope_case_(Design*des, NetScope*container) if (match_flag) break; - cur ++; + ++ cur; } delete case_value_co; @@ -1017,7 +1017,7 @@ void PGenerate::elaborate_subscope_direct_(Design*des, NetScope*scope) { typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur) -> generate_scope(des, scope); } } @@ -1026,7 +1026,7 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope) { // Add the genvars to this scope. typedef map::const_iterator genvar_it_t; - for (genvar_it_t cur = genvars.begin(); cur != genvars.end(); cur++ ) { + for (genvar_it_t cur = genvars.begin(); cur != genvars.end(); ++ cur ) { scope->add_genvar((*cur).first, (*cur).second); } @@ -1036,7 +1036,7 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope) typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur) -> generate_scope(des, scope); } @@ -1057,13 +1057,13 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope) // their own scopes. typedef list::const_iterator pgate_list_it_t; for (pgate_list_it_t cur = gates.begin() - ; cur != gates.end() ; cur ++) { + ; cur != gates.end() ; ++ cur ) { (*cur) ->elaborate_scope(des, scope); } typedef list::const_iterator proc_it_t; for (proc_it_t cur = behaviors.begin() - ; cur != behaviors.end() ; cur ++ ) { + ; cur != behaviors.end() ; ++ cur ) { (*cur) -> statement() -> elaborate_scope(des, scope); } @@ -1331,7 +1331,7 @@ void PGModule::elaborate_scope_mod_instances_(Design*des, Module*mod, NetScope*s replace[*cur] = (*overrides_)[jdx]; jdx += 1; - cur ++; + ++ cur; } } @@ -1352,7 +1352,7 @@ void PGModule::elaborate_scope_mod_instances_(Design*des, Module*mod, NetScope*s // parameter value with the new expression. for (mparm_local_it_t cur = replace.begin() - ; cur != replace.end() ; cur ++ ) { + ; cur != replace.end() ; ++ cur ) { PExpr*tmp = (*cur).second; // No expression means that the parameter is not diff --git a/elab_sig.cc b/elab_sig.cc index 3f393b0459..f4e6162f26 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -87,7 +87,7 @@ bool PScope::elaborate_sig_wires_(Design*des, NetScope*scope) const bool flag = true; for (map::const_iterator wt = wires.begin() - ; wt != wires.end() ; wt ++ ) { + ; wt != wires.end() ; ++ wt ) { PWire*cur = (*wt).second; NetNet*sig = cur->elaborate_sig(des, scope); @@ -143,7 +143,7 @@ static void elaborate_sig_funcs(Design*des, NetScope*scope, typedef map::const_iterator mfunc_it_t; for (mfunc_it_t cur = funcs.begin() - ; cur != funcs.end() ; cur ++) { + ; cur != funcs.end() ; ++ cur ) { hname_t use_name ( (*cur).first ); NetScope*fscope = scope->child(use_name); @@ -165,7 +165,7 @@ static void elaborate_sig_tasks(Design*des, NetScope*scope, typedef map::const_iterator mtask_it_t; for (mtask_it_t cur = tasks.begin() - ; cur != tasks.end() ; cur ++) { + ; cur != tasks.end() ; ++ cur ) { NetScope*tscope = scope->child( hname_t((*cur).first) ); assert(tscope); (*cur).second->elaborate_sig(des, tscope); @@ -229,7 +229,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const // scope in. typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur) -> elaborate_sig(des, scope); } @@ -241,8 +241,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const const list&gl = get_gates(); for (list::const_iterator gt = gl.begin() - ; gt != gl.end() - ; gt ++ ) { + ; gt != gl.end() ; ++ gt ) { flag &= (*gt)->elaborate_sig(des, scope); } @@ -261,7 +260,7 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const typedef list::const_iterator proc_it_t; for (proc_it_t cur = behaviors.begin() - ; cur != behaviors.end() ; cur ++ ) { + ; cur != behaviors.end() ; ++ cur ) { (*cur) -> statement() -> elaborate_sig(des, scope); } @@ -338,7 +337,7 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++) { + ; cur != generate_schemes.end() ; ++ cur ) { PGenerate*item = *cur; if (item->direct_nested_ || !item->scope_list_.empty()) { flag &= item->elaborate_sig(des, container); @@ -349,7 +348,7 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const typedef list::const_iterator scope_list_it_t; for (scope_list_it_t cur = scope_list_.begin() - ; cur != scope_list_.end() ; cur ++ ) { + ; cur != scope_list_.end() ; ++ cur ) { NetScope*scope = *cur; @@ -382,7 +381,7 @@ bool PGenerate::elaborate_sig_direct_(Design*des, NetScope*container) const bool flag = true; typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++) { + ; cur != generate_schemes.end() ; ++ cur ) { PGenerate*item = *cur; if (item->direct_nested_ || !item->scope_list_.empty()) { // Found the item, and it is direct nested. @@ -398,7 +397,7 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const // in the current scope. typedef map::const_iterator wires_it_t; for (wires_it_t wt = wires.begin() - ; wt != wires.end() ; wt ++ ) { + ; wt != wires.end() ; ++ wt ) { PWire*cur = (*wt).second; @@ -414,19 +413,19 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur) -> elaborate_sig(des, scope); } typedef list::const_iterator pgate_list_it_t; for (pgate_list_it_t cur = gates.begin() - ; cur != gates.end() ; cur ++) { + ; cur != gates.end() ; ++ cur ) { (*cur) ->elaborate_sig(des, scope); } typedef list::const_iterator proc_it_t; for (proc_it_t cur = behaviors.begin() - ; cur != behaviors.end() ; cur ++ ) { + ; cur != behaviors.end() ; ++ cur ) { (*cur) -> statement() -> elaborate_sig(des, scope); } diff --git a/elaborate.cc b/elaborate.cc index 0815917c29..ecac051ae5 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -4069,7 +4069,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const /* Create all the various paths from the path specifier. */ typedef std::vector::const_iterator str_vector_iter; for (str_vector_iter cur = dst.begin() - ; cur != dst.end() ; cur ++) { + ; cur != dst.end() ; ++ cur ) { if (debug_elaborate) { cerr << get_fileline() << ": debug: Path to " << (*cur); @@ -4137,7 +4137,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const unsigned idx = 0; for (str_vector_iter cur_src = src.begin() - ; cur_src != src.end() ; cur_src ++) { + ; cur_src != src.end() ; ++ cur_src ) { NetNet*src_sig = scope->find_signal(*cur_src); assert(src_sig); @@ -4175,7 +4175,7 @@ static void elaborate_functions(Design*des, NetScope*scope, { typedef map::const_iterator mfunc_it_t; for (mfunc_it_t cur = funcs.begin() - ; cur != funcs.end() ; cur ++) { + ; cur != funcs.end() ; ++ cur ) { hname_t use_name ( (*cur).first ); NetScope*fscope = scope->child(use_name); @@ -4189,7 +4189,7 @@ static void elaborate_tasks(Design*des, NetScope*scope, { typedef map::const_iterator mtask_it_t; for (mtask_it_t cur = tasks.begin() - ; cur != tasks.end() ; cur ++) { + ; cur != tasks.end() ; ++ cur ) { hname_t use_name ( (*cur).first ); NetScope*tscope = scope->child(use_name); @@ -4210,7 +4210,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const // Elaborate specparams typedef map::const_iterator specparam_it_t; for (specparam_it_t cur = specparams.begin() - ; cur != specparams.end() ; cur ++ ) { + ; cur != specparams.end() ; ++ cur ) { probe_expr_width(des, scope, (*cur).second); need_constant_expr = true; @@ -4255,7 +4255,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const // Elaborate within the generate blocks. typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur)->elaborate(des, scope); } @@ -4273,8 +4273,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const const list&gl = get_gates(); for (list::const_iterator gt = gl.begin() - ; gt != gl.end() - ; gt ++ ) { + ; gt != gl.end() ; ++ gt ) { (*gt)->elaborate(des, scope); } @@ -4287,7 +4286,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const // Elaborate the specify paths of the module. for (list::const_iterator sp = specify_paths.begin() - ; sp != specify_paths.end() ; sp ++) { + ; sp != specify_paths.end() ; ++ sp ) { (*sp)->elaborate(des, scope); } @@ -4314,7 +4313,7 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++) { + ; cur != generate_schemes.end() ; ++ cur ) { PGenerate*item = *cur; if (item->direct_nested_ || !item->scope_list_.empty()) { flag &= item->elaborate(des, container); @@ -4325,7 +4324,7 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const typedef list::const_iterator scope_list_it_t; for (scope_list_it_t cur = scope_list_.begin() - ; cur != scope_list_.end() ; cur ++ ) { + ; cur != scope_list_.end() ; ++ cur ) { NetScope*scope = *cur; // Check that this scope is one that is contained in the @@ -4368,7 +4367,7 @@ bool PGenerate::elaborate_direct_(Design*des, NetScope*container) const bool flag = true; typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++) { + ; cur != generate_schemes.end() ; ++ cur ) { PGenerate*item = *cur; if (item->direct_nested_ || !item->scope_list_.empty()) { // Found the item, and it is direct nested. @@ -4384,16 +4383,16 @@ bool PGenerate::elaborate_(Design*des, NetScope*scope) const elaborate_tasks(des, scope, tasks); typedef list::const_iterator gates_it_t; - for (gates_it_t cur = gates.begin() ; cur != gates.end() ; cur ++ ) + for (gates_it_t cur = gates.begin() ; cur != gates.end() ; ++ cur ) (*cur)->elaborate(des, scope); typedef list::const_iterator proc_it_t; - for (proc_it_t cur = behaviors.begin(); cur != behaviors.end(); cur++) + for (proc_it_t cur = behaviors.begin(); cur != behaviors.end(); ++ cur ) (*cur)->elaborate(des, scope); typedef list::const_iterator generate_it_t; for (generate_it_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur ++ ) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur)->elaborate(des, scope); } @@ -4408,13 +4407,13 @@ bool PScope::elaborate_behaviors_(Design*des, NetScope*scope) const // involves scanning the PProcess* list, creating a NetProcTop // for each process. for (list::const_iterator st = behaviors.begin() - ; st != behaviors.end() ; st ++ ) { + ; st != behaviors.end() ; ++ st ) { result_flag &= (*st)->elaborate(des, scope); } for (list::const_iterator st = analog_behaviors.begin() - ; st != analog_behaviors.end() ; st ++ ) { + ; st != analog_behaviors.end() ; ++ st ) { result_flag &= (*st)->elaborate(des, scope); } @@ -4439,7 +4438,7 @@ class elaborate_root_scope_t : public elaborator_work_item_t { { Module::replace_t root_repl; for (list::iterator cur = Module::user_defparms.begin() - ; cur != Module::user_defparms.end() ; cur++) { + ; cur != Module::user_defparms.end() ; ++ cur ) { pform_name_t tmp_name = cur->first; if (peek_head_name(tmp_name) != scope_->basename()) @@ -4498,7 +4497,7 @@ class later_defparams : public elaborator_work_item_t { { listtmp_list; for (set::iterator cur = des->defparams_later.begin() - ; cur != des->defparams_later.end() ; cur ++ ) + ; cur != des->defparams_later.end() ; ++ cur ) tmp_list.push_back(*cur); des->defparams_later.clear(); @@ -4561,8 +4560,7 @@ Design* elaborate(listroots) // Scan the root modules by name, and elaborate their scopes. for (list::const_iterator root = roots.begin() - ; root != roots.end() - ; root++) { + ; root != roots.end() ; ++ root ) { // Look for the root module in the list. map::const_iterator mod = pform_modules.find(*root); diff --git a/emit.cc b/emit.cc index 8cd2dcc078..d1e009b639 100644 --- a/emit.cc +++ b/emit.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -386,11 +386,11 @@ void NetScope::emit_scope(struct target_t*tgt) const tgt->event(cur); for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->emit_scope(tgt); for (signals_map_iter_t cur = signals_map_.begin() - ; cur != signals_map_.end() ; cur ++) { + ; cur != signals_map_.end() ; ++ cur ) { tgt->signal(cur->second); } @@ -414,7 +414,7 @@ bool NetScope::emit_defs(struct target_t*tgt) const switch (type_) { case MODULE: for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) flag &= cur->second->emit_defs(tgt); break; @@ -426,7 +426,7 @@ bool NetScope::emit_defs(struct target_t*tgt) const break; default: /* BEGIN_END and FORK_JOIN, GENERATE... */ for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) flag &= cur->second->emit_defs(tgt); break; } @@ -448,7 +448,7 @@ int Design::emit(struct target_t*tgt) const // enumerate the scopes for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->emit_scope(tgt); @@ -471,7 +471,7 @@ int Design::emit(struct target_t*tgt) const // emit task and function definitions bool tasks_rc = true; for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) tasks_rc &= (*scope)->emit_defs(tgt); diff --git a/eval_attrib.cc b/eval_attrib.cc index 7544292cc8..a293fb14c1 100644 --- a/eval_attrib.cc +++ b/eval_attrib.cc @@ -43,7 +43,7 @@ attrib_list_t* evaluate_attributes(const map&att, unsigned idx = 0; typedef map::const_iterator iter_t; - for (iter_t cur = att.begin() ; cur != att.end() ; cur ++, idx++) { + for (iter_t cur = att.begin() ; cur != att.end() ; ++ cur , idx += 1) { table[idx].key = (*cur).first; PExpr*exp = (*cur).second; diff --git a/functor.cc b/functor.cc index 4accea7c28..7fb946deff 100644 --- a/functor.cc +++ b/functor.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -100,7 +100,7 @@ void functor_t::lpm_ureduce(class Design*, class NetUReduce*) void NetScope::run_functor(Design*des, functor_t*fun) { for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->run_functor(des, fun); for (NetEvent*cur = events_ ; cur ; /* */) { @@ -124,7 +124,7 @@ void Design::functor(functor_t*fun) { // Scan the scopes for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->run_functor(this, fun); // apply to processes diff --git a/load_module.cc b/load_module.cc index c5b32efd85..c0c0bca8af 100644 --- a/load_module.cc +++ b/load_module.cc @@ -149,8 +149,7 @@ int build_library_index(const char*path, bool key_case_sensitive) char*key = 0; for (list::iterator suf = library_suff.begin() - ; suf != library_suff.end() - ; suf ++ ) { + ; suf != library_suff.end() ; ++ suf ) { const char*sufptr = *suf; unsigned sufsiz = strlen(sufptr); diff --git a/main.cc b/main.cc index dc69e57e7d..9654d96cfe 100644 --- a/main.cc +++ b/main.cc @@ -732,7 +732,7 @@ static void EOC_cleanup(void) cleanup_sys_func_table(); for (list::iterator suf = library_suff.begin() ; - suf != library_suff.end() ; suf ++ ) { + suf != library_suff.end() ; ++ suf ) { free((void *)*suf); } library_suff.clear(); @@ -742,7 +742,7 @@ static void EOC_cleanup(void) free(depfile_name); for (map::iterator flg = flags.begin() ; - flg != flags.end() ; flg ++ ) { + flg != flags.end() ; ++ flg ) { free((void *)flg->second); } flags.clear(); @@ -938,24 +938,22 @@ int main(int argc, char*argv[]) ofstream out (pf_path); out << "PFORM DUMP NATURES:" << endl; for (map::iterator cur = natures.begin() - ; cur != natures.end() ; cur ++ ) { + ; cur != natures.end() ; ++ cur ) { pform_dump(out, (*cur).second); } out << "PFORM DUMP DISCIPLINES:" << endl; for (map::iterator cur = disciplines.begin() - ; cur != disciplines.end() ; cur ++ ) { + ; cur != disciplines.end() ; ++ cur ) { pform_dump(out, (*cur).second); } out << "PFORM DUMP MODULES:" << endl; for (map::iterator mod = pform_modules.begin() - ; mod != pform_modules.end() - ; mod ++ ) { + ; mod != pform_modules.end() ; ++ mod ) { pform_dump(out, (*mod).second); } out << "PFORM DUMP PRIMITIVES:" << endl; for (map::iterator idx = pform_primitives.begin() - ; idx != pform_primitives.end() - ; idx ++ ) { + ; idx != pform_primitives.end() ; ++ idx ) { (*idx).second->dump(out); } } @@ -974,14 +972,12 @@ int main(int argc, char*argv[]) if (verbose_flag) cout << "LOCATING TOP-LEVEL MODULES" << endl << " "; for (mod = pform_modules.begin() - ; mod != pform_modules.end() - ; mod++) { + ; mod != pform_modules.end() ; ++ mod ) { find_module_mention(mentioned_p, mod->second); } for (mod = pform_modules.begin() - ; mod != pform_modules.end() - ; mod++) { + ; mod != pform_modules.end() ; ++ mod ) { /* Don't choose library modules. */ if ((*mod).second->library_flag) @@ -1061,7 +1057,7 @@ int main(int argc, char*argv[]) /* Done with all the pform data. Delete the modules. */ for (map::iterator idx = pform_modules.begin() - ; idx != pform_modules.end() ; idx ++) { + ; idx != pform_modules.end() ; ++ idx ) { delete (*idx).second; (*idx).second = 0; @@ -1158,8 +1154,7 @@ int main(int argc, char*argv[]) map::const_iterator idx; for (idx = missing_modules.begin() - ; idx != missing_modules.end() - ; idx ++) + ; idx != missing_modules.end() ; ++ idx ) cerr << " " << (*idx).first << " referenced " << (*idx).second << " times."<< endl; @@ -1174,7 +1169,7 @@ static void find_module_mention(map&check_map, Module*mod) { list gates = mod->get_gates(); list::const_iterator gate; - for (gate = gates.begin(); gate != gates.end(); gate++) { + for (gate = gates.begin(); gate != gates.end(); ++ gate ) { PGModule*tmp = dynamic_cast(*gate); if (tmp) { // Note that this module has been instantiated @@ -1184,7 +1179,7 @@ static void find_module_mention(map&check_map, Module*mod) list::const_iterator cur; for (cur = mod->generate_schemes.begin() - ; cur != mod->generate_schemes.end() ; cur ++) { + ; cur != mod->generate_schemes.end() ; ++ cur ) { find_module_mention(check_map, *cur); } } @@ -1192,7 +1187,7 @@ static void find_module_mention(map&check_map, Module*mod) static void find_module_mention(map&check_map, PGenerate*schm) { list::const_iterator gate; - for (gate = schm->gates.begin(); gate != schm->gates.end(); gate++) { + for (gate = schm->gates.begin(); gate != schm->gates.end(); ++ gate ) { PGModule*tmp = dynamic_cast(*gate); if (tmp) { // Note that this module has been instantiated @@ -1202,7 +1197,7 @@ static void find_module_mention(map&check_map, PGenerate*schm) list::const_iterator cur; for (cur = schm->generate_schemes.begin() - ; cur != schm->generate_schemes.end() ; cur ++) { + ; cur != schm->generate_schemes.end() ; ++ cur ) { find_module_mention(check_map, *cur); } } diff --git a/net_design.cc b/net_design.cc index 055e620ed1..8d575ed9cb 100644 --- a/net_design.cc +++ b/net_design.cc @@ -138,7 +138,7 @@ NetScope* Design::find_scope(const std::list&path) const return 0; for (list::const_iterator scope = root_scopes_.begin() - ; scope != root_scopes_.end(); scope++) { + ; scope != root_scopes_.end(); ++ scope ) { NetScope*cur = *scope; if (path.front() != cur->fullname()) @@ -213,14 +213,14 @@ NetScope* Design::find_scope(NetScope*scope, const std::list&path, void Design::run_defparams() { for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->run_defparams(this); } void NetScope::run_defparams(Design*des) { for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->run_defparams(des); while (! defparams.empty()) { @@ -312,7 +312,7 @@ void NetScope::run_defparams_later(Design*des) // All the scopes that this defparam set touched should have // their parameters re-evaluated. for (set::iterator cur = target_scopes.begin() - ; cur != target_scopes.end() ; cur ++ ) + ; cur != target_scopes.end() ; ++ cur ) (*cur)->evaluate_parameters(des); // If there are some scopes that still have missing scopes, @@ -326,7 +326,7 @@ void NetScope::run_defparams_later(Design*des) void Design::evaluate_parameters() { for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->evaluate_parameters(this); } @@ -610,7 +610,7 @@ void NetScope::evaluate_parameter_real_(Design*des, param_ref_t cur) void NetScope::evaluate_parameters(Design*des) { for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->evaluate_parameters(des); if (debug_scopes) @@ -659,7 +659,7 @@ void NetScope::evaluate_parameters(Design*des) void Design::residual_defparams() { for (list::const_iterator scope = root_scopes_.begin(); - scope != root_scopes_.end(); scope++) + scope != root_scopes_.end(); ++ scope ) (*scope)->residual_defparams(this); } @@ -676,7 +676,7 @@ void NetScope::residual_defparams(Design*des) } for (map::const_iterator cur = children_.begin() - ; cur != children_.end() ; cur ++) + ; cur != children_.end() ; ++ cur ) cur->second->residual_defparams(des); } diff --git a/net_event.cc b/net_event.cc index f1d501cea7..b3b2003985 100644 --- a/net_event.cc +++ b/net_event.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -138,7 +138,7 @@ void NetEvent::find_similar_event(list&event_list) probes_->find_similar_probes(first_probes); for (list::iterator idx = first_probes.begin() - ; idx != first_probes.end() ; idx ++) { + ; idx != first_probes.end() ; ++ idx ) { candidate_events.insert( (*idx)->event() ); } @@ -158,7 +158,7 @@ void NetEvent::find_similar_event(list&event_list) set candidate_tmp; for (list::iterator idx = similar_probes.begin() - ; idx != similar_probes.end() ; idx ++) { + ; idx != similar_probes.end() ; ++ idx ) { NetEvent*tmp = (*idx)->event(); if (candidate_events.find(tmp) != candidate_events.end()) @@ -178,7 +178,7 @@ void NetEvent::find_similar_event(list&event_list) for remaining compatibility details and save the survivors in the event_list that the caller passed. */ for (set::iterator idx = candidate_events.begin() - ; idx != candidate_events.end() ; idx ++) { + ; idx != candidate_events.end() ; ++ idx ) { NetEvent*tmp = *idx; @@ -459,4 +459,3 @@ NetProc* NetEvWait::statement() { return statement_; } - diff --git a/net_tran.cc b/net_tran.cc index 43c6439892..79d9c50f03 100644 --- a/net_tran.cc +++ b/net_tran.cc @@ -161,7 +161,7 @@ void join_island(NetPins*obj) // process, and thus they will join my island. This process // will recurse until all the connected branches join this island. for (list::iterator cur = uncommitted_neighbors.begin() - ; cur != uncommitted_neighbors.end() ; cur ++ ) { + ; cur != uncommitted_neighbors.end() ; ++ cur ) { join_island(*cur); } } diff --git a/netmisc.cc b/netmisc.cc index 73d1f3b58c..08445a337f 100644 --- a/netmisc.cc +++ b/netmisc.cc @@ -579,7 +579,7 @@ std::list eval_scope_path(Design*des, NetScope*scope, typedef pform_name_t::const_iterator pform_path_it; - for (pform_path_it cur = path.begin() ; cur != path.end(); cur++) { + for (pform_path_it cur = path.begin() ; cur != path.end(); ++ cur ) { const name_component_t&comp = *cur; res.push_back( eval_path_component(des,scope,comp) ); } diff --git a/nodangle.cc b/nodangle.cc index 68c2118ee6..1bd98e930f 100644 --- a/nodangle.cc +++ b/nodangle.cc @@ -113,7 +113,7 @@ void nodangle_f::event(Design*des, NetEvent*ev) list match; ev->find_similar_event(match); for (list::iterator idx = match.begin() - ; idx != match.end() ; idx ++) { + ; idx != match.end() ; ++ idx ) { NetEvent*tmp = *idx; assert(tmp != ev); diff --git a/parse.y b/parse.y index cc1e8118d5..c833d7226f 100644 --- a/parse.y +++ b/parse.y @@ -2283,12 +2283,12 @@ module_item | K_output var_type unsigned_signed_opt range_opt list_of_port_identifiers ';' { list >::const_iterator pp; list*tmp = new list; - for (pp = $5->begin(); pp != $5->end(); pp++) { + for (pp = $5->begin(); pp != $5->end(); ++ pp ) { tmp->push_back((*pp).first); } pform_makewire(@1, $4, $3, tmp, $2, NetNet::POUTPUT, IVL_VT_NO_TYPE, 0, SR_BOTH); - for (pp = $5->begin(); pp != $5->end(); pp++) { + for (pp = $5->begin(); pp != $5->end(); ++ pp ) { if ((*pp).second) { pform_make_reginit(@1, (*pp).first, (*pp).second); } diff --git a/pform.cc b/pform.cc index 6591622e6a..a9c9890a14 100644 --- a/pform.cc +++ b/pform.cc @@ -448,7 +448,7 @@ void pform_set_timescale(int unit, int prec, /* Look to see if we have any modules without a timescale. */ bool have_no_ts = false; map::iterator mod; - for (mod = pform_modules.begin(); mod != pform_modules.end(); mod++) { + for (mod = pform_modules.begin(); mod != pform_modules.end(); ++ mod ) { const Module*mp = (*mod).second; if (mp->time_from_timescale || mp->timescale_warn_done) continue; @@ -466,7 +466,7 @@ void pform_set_timescale(int unit, int prec, << endl; for (mod = pform_modules.begin() - ; mod != pform_modules.end() ; mod++) { + ; mod != pform_modules.end() ; ++ mod ) { Module*mp = (*mod).second; if (mp->time_from_timescale || mp->timescale_warn_done) continue; @@ -1078,8 +1078,7 @@ static void process_udp_table(PUdp*udp, list*table, svector output (table->size()); { unsigned idx = 0; for (list::iterator cur = table->begin() - ; cur != table->end() - ; cur ++, idx += 1) { + ; cur != table->end() ; ++ cur , idx += 1) { string tmp = *cur; /* Pull the input values from the string. */ @@ -1435,8 +1434,7 @@ void pform_set_net_range(list*names, assert((range == 0) || (range->count() == 2)); for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_set_net_range(txt, range, signed_flag, dt, rt); } @@ -1469,7 +1467,7 @@ static void pform_make_event(perm_string name, const char*fn, unsigned ln) void pform_make_events(list*names, const char*fn, unsigned ln) { list::iterator cur; - for (cur = names->begin() ; cur != names->end() ; cur++) { + for (cur = names->begin() ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_make_event(txt, fn, ln); } @@ -1930,8 +1928,7 @@ void pform_makewire(const vlltype&li, PWSRType rt) { for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_makewire(li, txt, type, pt, dt, attr); /* This has already been done for real variables. */ @@ -2066,7 +2063,7 @@ svector*pform_make_task_ports(NetNet::PortType pt, assert(names); svector*res = new svector(0); for (list::iterator cur = names->begin() - ; cur != names->end() ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string name = *cur; @@ -2355,8 +2352,7 @@ void pform_set_port_type(const struct vlltype&li, NetNet::PortType pt) { for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_set_port_type(txt, pt, li.text, li.first_line); pform_set_net_range(txt, range, signed_flag, IVL_VT_NO_TYPE, @@ -2393,8 +2389,7 @@ static void pform_set_reg_integer(perm_string name) void pform_set_reg_integer(list*names) { for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_set_reg_integer(txt); } @@ -2423,8 +2418,7 @@ static void pform_set_reg_time(perm_string name) void pform_set_reg_time(list*names) { for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_set_reg_time(txt); } @@ -2455,8 +2449,7 @@ static void pform_set_integer_2atom(uint64_t width, bool signed_flag, perm_strin void pform_set_integer_2atom(uint64_t width, bool signed_flag, list*names) { for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; pform_set_integer_2atom(width, signed_flag, txt); } @@ -2469,8 +2462,7 @@ svector* pform_make_udp_input_ports(list*names) unsigned idx = 0; for (list::iterator cur = names->begin() - ; cur != names->end() - ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { perm_string txt = *cur; PWire*pp = new PWire(txt, NetNet::IMPLICIT, diff --git a/pform_disciplines.cc b/pform_disciplines.cc index c05ff1373e..91f6193fef 100644 --- a/pform_disciplines.cc +++ b/pform_disciplines.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -188,7 +188,7 @@ void pform_attach_discipline(const struct vlltype&loc, ivl_discipline_t discipline, list*names) { for (list::iterator cur = names->begin() - ; cur != names->end() ; cur ++ ) { + ; cur != names->end() ; ++ cur ) { PWire* cur_net = pform_get_wire_in_scope(*cur); if (cur_net == 0) { diff --git a/pform_dump.cc b/pform_dump.cc index cbef88cc15..a5af4a48c0 100644 --- a/pform_dump.cc +++ b/pform_dump.cc @@ -89,7 +89,7 @@ ostream& operator<< (ostream&out, const name_component_t&that) typedef std::list::const_iterator index_it_t; for (index_it_t idx = that.index.begin() - ; idx != that.index.end() ; idx++) { + ; idx != that.index.end() ; ++ idx ) { out << *idx; } @@ -103,10 +103,10 @@ ostream& operator<< (ostream&o, const pform_name_t&that) cur = that.begin(); o << *cur; - cur++; + ++ cur; while (cur != that.end()) { o << "." << *cur; - cur++; + ++ cur; } return o; @@ -149,7 +149,7 @@ static void dump_attributes_map(ostream&out, int ind) { for (map::const_iterator idx = attributes.begin() - ; idx != attributes.end() ; idx++ ) { + ; idx != attributes.end() ; ++ idx ) { out << setw(ind) << "" << "(* " << (*idx).first; if ((*idx).second) { @@ -1005,28 +1005,28 @@ void PGenerate::dump(ostream&out, unsigned indent) const dump_wires_(out, indent+2); for (list::const_iterator idx = gates.begin() - ; idx != gates.end() ; idx++) { + ; idx != gates.end() ; ++ idx ) { (*idx)->dump(out, indent+2); } for (list::const_iterator idx = behaviors.begin() - ; idx != behaviors.end() ; idx++) { + ; idx != behaviors.end() ; ++ idx ) { (*idx)->dump(out, indent+2); } for (list::const_iterator idx = analog_behaviors.begin() - ; idx != analog_behaviors.end() ; idx++) { + ; idx != analog_behaviors.end() ; ++ idx ) { (*idx)->dump(out, indent+2); } typedef map::const_iterator genvar_iter_t; for (genvar_iter_t cur = genvars.begin() - ; cur != genvars.end() ; cur++) { + ; cur != genvars.end() ; ++ cur ) { out << setw(indent+2) << "" << "genvar " << ((*cur).first) << ";" << endl; } for (list::const_iterator idx = generate_schemes.begin() - ; idx != generate_schemes.end() ; idx++) { + ; idx != generate_schemes.end() ; ++ idx ) { (*idx)->dump(out, indent+2); } @@ -1041,7 +1041,7 @@ void LexicalScope::dump_parameters_(ostream&out, unsigned indent) const { typedef map::const_iterator parm_iter_t; for (parm_iter_t cur = parameters.begin() - ; cur != parameters.end() ; cur ++) { + ; cur != parameters.end() ; ++ cur ) { out << setw(indent) << "" << "parameter " << (*cur).second.type << " "; if ((*cur).second.signed_flag) @@ -1090,7 +1090,7 @@ void LexicalScope::dump_localparams_(ostream&out, unsigned indent) const { typedef map::const_iterator parm_iter_t; for (parm_iter_t cur = localparams.begin() - ; cur != localparams.end() ; cur ++) { + ; cur != localparams.end() ; ++ cur ) { out << setw(indent) << "" << "localparam "; if ((*cur).second.msb) out << "[" << *(*cur).second.msb << ":" @@ -1106,7 +1106,7 @@ void LexicalScope::dump_localparams_(ostream&out, unsigned indent) const void LexicalScope::dump_events_(ostream&out, unsigned indent) const { for (map::const_iterator cur = events.begin() - ; cur != events.end() ; cur ++ ) { + ; cur != events.end() ; ++ cur ) { PEvent*ev = (*cur).second; out << setw(indent) << "" << "event " << ev->name() << "; // " << ev->get_fileline() << endl; @@ -1117,7 +1117,7 @@ void LexicalScope::dump_wires_(ostream&out, unsigned indent) const { // Iterate through and display all the wires. for (map::const_iterator wire = wires.begin() - ; wire != wires.end() ; wire ++ ) { + ; wire != wires.end() ; ++ wire ) { (*wire).second->dump(out, indent); } @@ -1128,7 +1128,7 @@ void Module::dump(ostream&out) const if (attributes.begin() != attributes.end()) { out << "(* "; for (map::const_iterator idx = attributes.begin() - ; idx != attributes.end() ; idx++ ) { + ; idx != attributes.end() ; ++ idx ) { if (idx != attributes.begin()) { out << " , "; } @@ -1166,26 +1166,26 @@ void Module::dump(ostream&out) const typedef map::const_iterator genvar_iter_t; for (genvar_iter_t cur = genvars.begin() - ; cur != genvars.end() ; cur++) { + ; cur != genvars.end() ; ++ cur ) { out << " genvar " << ((*cur).first) << ";" << endl; } typedef list::const_iterator genscheme_iter_t; for (genscheme_iter_t cur = generate_schemes.begin() - ; cur != generate_schemes.end() ; cur++) { + ; cur != generate_schemes.end() ; ++ cur ) { (*cur)->dump(out, 4); } typedef map::const_iterator specparm_iter_t; for (specparm_iter_t cur = specparams.begin() - ; cur != specparams.end() ; cur ++) { + ; cur != specparams.end() ; ++ cur ) { out << " specparam " << (*cur).first << " = " << *(*cur).second << ";" << endl; } typedef list::const_iterator parm_hiter_t; for (parm_hiter_t cur = defparms.begin() - ; cur != defparms.end() ; cur ++) { + ; cur != defparms.end() ; ++ cur ) { out << " defparam " << (*cur).first << " = "; if ((*cur).second) out << *(*cur).second << ";" << endl; @@ -1201,7 +1201,7 @@ void Module::dump(ostream&out) const // Dump the task definitions. typedef map::const_iterator task_iter_t; for (task_iter_t cur = tasks.begin() - ; cur != tasks.end() ; cur ++) { + ; cur != tasks.end() ; ++ cur ) { out << " task " << (*cur).first << ";" << endl; (*cur).second->dump(out, 6); out << " endtask;" << endl; @@ -1210,7 +1210,7 @@ void Module::dump(ostream&out) const // Dump the function definitions. typedef map::const_iterator func_iter_t; for (func_iter_t cur = funcs.begin() - ; cur != funcs.end() ; cur ++) { + ; cur != funcs.end() ; ++ cur ) { out << " function " << (*cur).first << ";" << endl; (*cur).second->dump(out, 6); out << " endfunction;" << endl; @@ -1219,28 +1219,25 @@ void Module::dump(ostream&out) const // Iterate through and display all the gates for (list::const_iterator gate = gates_.begin() - ; gate != gates_.end() - ; gate ++ ) { + ; gate != gates_.end() ; ++ gate ) { (*gate)->dump(out); } for (list::const_iterator behav = behaviors.begin() - ; behav != behaviors.end() - ; behav ++ ) { + ; behav != behaviors.end() ; ++ behav ) { (*behav)->dump(out, 4); } for (list::const_iterator idx = analog_behaviors.begin() - ; idx != analog_behaviors.end() ; idx++) { + ; idx != analog_behaviors.end() ; ++ idx) { (*idx)->dump(out, 4); } for (list::const_iterator spec = specify_paths.begin() - ; spec != specify_paths.end() - ; spec ++ ) { + ; spec != specify_paths.end() ; ++ spec ) { (*spec)->dump(out, 4); } @@ -1283,8 +1280,7 @@ void PUdp::dump(ostream&out) const // Dump the attributes for the primitive as attribute // statements. for (map::const_iterator idx = attributes.begin() - ; idx != attributes.end() - ; idx ++) { + ; idx != attributes.end() ; ++ idx ) { out << " attribute " << (*idx).first; if ((*idx).second) out << " = " << *(*idx).second; diff --git a/t-dll-api.cc b/t-dll-api.cc index 81d5bf6699..436b1e5070 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -1644,7 +1644,7 @@ extern "C" int ivl_scope_children(ivl_scope_t net, void*cd) { for (map::iterator cur = net->children.begin() - ; cur != net->children.end() ; cur ++) { + ; cur != net->children.end() ; ++ cur ) { int rc = func(cur->second, cd); if (rc != 0) return rc; diff --git a/t-dll.cc b/t-dll.cc index 2eff9604ef..baddd1af73 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -468,7 +468,7 @@ void dll_target::make_scope_parameters(ivl_scope_t scop, const NetScope*net) typedef map::const_iterator pit_t; for (pit_t cur_pit = net->parameters.begin() - ; cur_pit != net->parameters.end() ; cur_pit ++) { + ; cur_pit != net->parameters.end() ; ++ cur_pit ) { assert(idx < scop->nparam_); ivl_parameter_t cur_par = scop->param_ + idx; @@ -482,7 +482,7 @@ void dll_target::make_scope_parameters(ivl_scope_t scop, const NetScope*net) idx += 1; } for (pit_t cur_pit = net->localparams.begin() - ; cur_pit != net->localparams.end() ; cur_pit ++) { + ; cur_pit != net->localparams.end() ; ++ cur_pit ) { assert(idx < scop->nparam_); ivl_parameter_t cur_par = scop->param_ + idx; @@ -603,7 +603,7 @@ bool dll_target::start_design(const Design*des) des_.disciplines.resize(disciplines.size()); unsigned idx = 0; for (map::const_iterator cur = disciplines.begin() - ; cur != disciplines.end() ; cur ++) { + ; cur != disciplines.end() ; ++ cur ) { des_.disciplines[idx] = cur->second; idx += 1; } @@ -611,7 +611,7 @@ bool dll_target::start_design(const Design*des) root_scopes = des->find_root_scopes(); for (list::const_iterator scop = root_scopes.begin(); - scop != root_scopes.end(); scop++) + scop != root_scopes.end(); ++ scop ) add_root(des_, *scop); diff --git a/vvp/delay.cc b/vvp/delay.cc index ab91b9fabc..cfb0077d82 100644 --- a/vvp/delay.cc +++ b/vvp/delay.cc @@ -617,7 +617,7 @@ void vvp_fun_modpath::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit, out_at[idx] -= now; } - for (cur ++ ; cur != candidate_list.end() ; cur ++) { + for (cur ++ ; cur != candidate_list.end() ; ++ cur ) { src = *cur; for (unsigned idx = 0 ; idx < 12 ; idx += 1) { vvp_time64_t tmp = src->wake_time_ + src->delay_[idx]; diff --git a/vvp/island_tran.cc b/vvp/island_tran.cc index 091e648e14..072f2cac25 100644 --- a/vvp/island_tran.cc +++ b/vvp/island_tran.cc @@ -161,7 +161,7 @@ bool vvp_island_branch_tran::run_test_enabled() static void island_send_value(list&connections, const vvp_vector8_t&val) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_island_branch*tmp_ptr = idx->ptr(); @@ -173,7 +173,7 @@ static void island_send_value(list&connections, const vvp_vect static void mark_done_flags(list&connections) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_island_branch*tmp_ptr = idx->ptr(); vvp_island_branch_tran*cur = dynamic_cast(tmp_ptr); @@ -186,7 +186,7 @@ static void mark_done_flags(list&connections) static void mark_visited_flags(list&connections) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_island_branch*tmp_ptr = idx->ptr(); vvp_island_branch_tran*cur = dynamic_cast(tmp_ptr); @@ -200,7 +200,7 @@ static void mark_visited_flags(list&connections) static void clear_visited_flags(list&connections) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_island_branch_tran*tmp_ptr = BRANCH_TRAN(idx->ptr()); @@ -215,7 +215,7 @@ static void resolve_values_from_connections(vvp_vector8_t&val, list&connections) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_vector8_t tmp = get_value_from_branch(*idx); if (val.size() == 0) val = tmp; @@ -287,7 +287,7 @@ static void push_value_through_branches(const vvp_vector8_t&val, list&connections) { for (list::iterator idx = connections.begin() - ; idx != connections.end() ; idx ++ ) { + ; idx != connections.end() ; ++ idx ) { vvp_island_branch_tran*tmp_ptr = BRANCH_TRAN(idx->ptr()); unsigned tmp_ab = idx->port(); diff --git a/vvp/main.cc b/vvp/main.cc index 49df4a98c5..a81664e722 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -203,7 +203,7 @@ static void final_cleanup() #ifdef CHECK_WITH_VALGRIND /* Clean up the file name table. */ for (vector::iterator cur = file_names.begin(); - cur != file_names.end() ; cur++) { + cur != file_names.end() ; ++ cur ) { delete[] *cur; } /* Clear the static result buffer. */ diff --git a/vvp/ufunc.cc b/vvp/ufunc.cc index 5ad7c6ccd6..7a9d33f2ab 100644 --- a/vvp/ufunc.cc +++ b/vvp/ufunc.cc @@ -234,7 +234,7 @@ void exec_ufunc_delete(vvp_code_t euf_code) void ufunc_pool_delete(void) { map::iterator iter; - for (iter = ufunc_map.begin(); iter != ufunc_map.end(); iter++) { + for (iter = ufunc_map.begin(); iter != ufunc_map.end(); ++ iter ) { delete iter->first; } } diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index 1fe98b023a..8f277e9ef4 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -636,7 +636,7 @@ static void thread_word_delete_real(vpiHandle item) void vpi_handle_delete() { map::iterator iter; - for (iter = handle_map.begin(); iter != handle_map.end(); iter++) { + for (iter = handle_map.begin(); iter != handle_map.end(); ++ iter ) { if (iter->second) thread_vthr_delete_real(iter->first); else thread_word_delete_real(iter->first); } diff --git a/vvp/vthread.cc b/vvp/vthread.cc index fe3a07ec94..af75ced8aa 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -456,7 +456,7 @@ static void child_delete(vthread_t base) void vthreads_delete(struct __vpiScope*scope) { for (std::set::iterator cur = scope->threads.begin() - ; cur != scope->threads.end() ; cur ++) { + ; cur != scope->threads.end() ; ++ cur ) { delete *cur; } scope->threads.clear(); diff --git a/vvp/vvp_net.cc b/vvp/vvp_net.cc index 40e978cfbe..9715f83c9b 100644 --- a/vvp/vvp_net.cc +++ b/vvp/vvp_net.cc @@ -116,14 +116,14 @@ void vvp_net_pool_delete() local_net_pool_count = 0; map::iterator iter; - for (iter = vvp_net_map.begin(); iter != vvp_net_map.end(); iter++) { + for (iter = vvp_net_map.begin(); iter != vvp_net_map.end(); ++ iter ) { vvp_nets_del += 1; VALGRIND_MEMPOOL_FREE(iter->first->pool, iter->first); } vvp_net_map.clear(); map::iterator siter; - for (siter = sfunc_map.begin(); siter != sfunc_map.end(); siter++) { + for (siter = sfunc_map.begin(); siter != sfunc_map.end(); ++ siter ) { delete siter->first; } sfunc_map.clear();