Pre-increment (rather than post-increment) STL iterators in for loops… (#1692)

* Pre-increment (rather than post-increment) STL iterators in for loops. #1594

* Fix a goof. #1594
This commit is contained in:
jmpenn 2024-04-18 11:41:35 -05:00 committed by GitHub
parent e515144252
commit 5065d96a15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 118 additions and 118 deletions

View File

@ -61,7 +61,7 @@ namespace Trick {
*/ */
void print_nonzero_diffs() { void print_nonzero_diffs() {
std::map<std::string, ClassSizeDiffInfo>::iterator it ; std::map<std::string, ClassSizeDiffInfo>::iterator it ;
for ( it = name_to_diff.begin() ; it != name_to_diff.end() ; it++ ) { for ( it = name_to_diff.begin() ; it != name_to_diff.end() ; ++it ) {
int curr_diff = it->second.diff ; int curr_diff = it->second.diff ;
ATTRIBUTES * attr = Trick::AttributesMap::attributes_map()->get_attr(it->first) ; ATTRIBUTES * attr = Trick::AttributesMap::attributes_map()->get_attr(it->first) ;
unsigned int ii ; unsigned int ii ;

View File

@ -64,7 +64,7 @@ int checkpoint_sequence_i(STL & in_stl , std::string object_name , std::string v
//message_publish(1, "CHECKPOINT_SEQUENCE_STL with %s\n", var_declare) ; //message_publish(1, "CHECKPOINT_SEQUENCE_STL with %s\n", var_declare) ;
/* copy the contents of the stl */ /* copy the contents of the stl */
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; it++ , ii++ ) { for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; ++it , ii++ ) {
items[ii] = *it ; items[ii] = *it ;
} }
} }
@ -103,7 +103,7 @@ int checkpoint_sequence_s(STL & in_stl , std::string object_name , std::string v
//message_publish(1, "CHECKPOINT_SEQUENCE_STL_STL with %s\n", temp_str.c_str()) ; //message_publish(1, "CHECKPOINT_SEQUENCE_STL_STL with %s\n", temp_str.c_str()) ;
/* create the names of the sub stl checkpoint names we're going to be using */ /* create the names of the sub stl checkpoint names we're going to be using */
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; it++ , ii++ ) { for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; ++it , ii++ ) {
std::ostringstream sub_elements ; std::ostringstream sub_elements ;
sub_elements << object_name << "_" << var_name << "_" << ii ; sub_elements << object_name << "_" << var_name << "_" << ii ;
items[ii] = sub_elements.str() ; items[ii] = sub_elements.str() ;

View File

@ -19,7 +19,7 @@ int Trick::SegmentedExecutive::add_segment( Trick::Segment * ps ) {
// Gets the job class to job queue map for this segment and adds the job classes to the executive. // Gets the job class to job queue map for this segment and adds the job classes to the executive.
std::map < std::string , Trick::ScheduledJobQueue * >::iterator it ; std::map < std::string , Trick::ScheduledJobQueue * >::iterator it ;
for ( it = ps->get_job_queues().begin() ; it != ps->get_job_queues().end() ; it++ ) { for ( it = ps->get_job_queues().begin() ; it != ps->get_job_queues().end() ; ++it ) {
class_map[(*it).first] = num_classes ; class_map[(*it).first] = num_classes ;
class_to_queue[num_classes++] = (*it).second ; class_to_queue[num_classes++] = (*it).second ;
} }
@ -41,7 +41,7 @@ int Trick::SegmentedExecutive::gather_segmented_jobs() {
std::map < std::string , Trick::Segment * >::iterator mit ; std::map < std::string , Trick::Segment * >::iterator mit ;
std::set< std::string > segment_tags ; std::set< std::string > segment_tags ;
for ( mit = segment_map.begin() ; mit != segment_map.end() ; mit++ ) { for ( mit = segment_map.begin() ; mit != segment_map.end() ; ++mit ) {
segment_tags.insert((*mit).first) ; segment_tags.insert((*mit).first) ;
} }
@ -129,7 +129,7 @@ int Trick::SegmentedExecutive::segment_set_jobs_onoff() {
Trick::JobData * job ; Trick::JobData * job ;
std::set < Trick::JobData * >::iterator it ; std::set < Trick::JobData * >::iterator it ;
for ( it = all_segmented_jobs.begin() ; it != all_segmented_jobs.end() ; it++ ) { for ( it = all_segmented_jobs.begin() ; it != all_segmented_jobs.end() ; ++it ) {
job = *it ; job = *it ;
// Test to see if the next segment is present in the job tags. // Test to see if the next segment is present in the job tags.
// Set the disabled flag to the negation of the tag's presence // Set the disabled flag to the negation of the tag's presence
@ -164,10 +164,10 @@ int Trick::SegmentedExecutive::write_s_job_execution(FILE *fp) {
fprintf(fp, "Segment Jobs:\n") ; fprintf(fp, "Segment Jobs:\n") ;
std::map < std::string , Trick::Segment * >::iterator pmit ; std::map < std::string , Trick::Segment * >::iterator pmit ;
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) { for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
Trick::Segment * pb = (*pmit).second ; Trick::Segment * pb = (*pmit).second ;
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ; std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) { for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
(*jqit).second->write_non_sched_queue(fp) ; (*jqit).second->write_non_sched_queue(fp) ;
} }
} }
@ -187,10 +187,10 @@ int Trick::SegmentedExecutive::instrument_job_before( Trick::JobData * instrumen
//go through all of the segmented jobs and instrument them. //go through all of the segmented jobs and instrument them.
std::map < std::string , Trick::Segment * >::iterator pmit ; std::map < std::string , Trick::Segment * >::iterator pmit ;
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) { for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
Trick::Segment * pb = (*pmit).second ; Trick::Segment * pb = (*pmit).second ;
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ; std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) { for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
(*jqit).second->instrument_before(instrument_job) ; (*jqit).second->instrument_before(instrument_job) ;
} }
} }
@ -209,10 +209,10 @@ int Trick::SegmentedExecutive::instrument_job_after( Trick::JobData * instrument
//go through all of the segmented jobs and instrument them. //go through all of the segmented jobs and instrument them.
std::map < std::string , Trick::Segment * >::iterator pmit ; std::map < std::string , Trick::Segment * >::iterator pmit ;
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) { for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
Trick::Segment * pb = (*pmit).second ; Trick::Segment * pb = (*pmit).second ;
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ; std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) { for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
(*jqit).second->instrument_after(instrument_job) ; (*jqit).second->instrument_after(instrument_job) ;
} }
} }
@ -226,10 +226,10 @@ int Trick::SegmentedExecutive::instrument_job_remove(std::string in_job) {
Trick::Executive::instrument_job_remove( in_job ) ; Trick::Executive::instrument_job_remove( in_job ) ;
std::map < std::string , Trick::Segment * >::iterator pmit ; std::map < std::string , Trick::Segment * >::iterator pmit ;
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) { for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
Trick::Segment * pb = (*pmit).second ; Trick::Segment * pb = (*pmit).second ;
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ; std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) { for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
(*jqit).second->instrument_remove(in_job) ; (*jqit).second->instrument_remove(in_job) ;
} }
} }

View File

@ -13,14 +13,14 @@ void DrawStuff::start() {
void DrawStuff::step(int) { void DrawStuff::step(int) {
std::vector<DrawStuffObject *>::iterator it ; std::vector<DrawStuffObject *>::iterator it ;
for( it = objects.begin() ; it != objects.end() ; it++ ) { for( it = objects.begin() ; it != objects.end() ; ++it ) {
(*it)->draw() ; (*it)->draw() ;
} }
} }
void DrawStuff::command(int cmd) { void DrawStuff::command(int cmd) {
std::vector<DrawStuffObject *>::iterator it ; std::vector<DrawStuffObject *>::iterator it ;
for( it = objects.begin() ; it != objects.end() ; it++ ) { for( it = objects.begin() ; it != objects.end() ; ++it ) {
(*it)->command(cmd) ; (*it)->command(cmd) ;
} }
} }

View File

@ -22,7 +22,7 @@ ClassValues::ClassValues() :
ClassValues::~ClassValues() { ClassValues::~ClassValues() {
std::vector<FieldDescription *>::iterator fdit ; std::vector<FieldDescription *>::iterator fdit ;
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) { for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
delete (*fdit) ; delete (*fdit) ;
} }
} }
@ -57,7 +57,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
std::vector<FieldDescription *>::iterator fdit ; std::vector<FieldDescription *>::iterator fdit ;
// Loop through the incoming inherited variable names // Loop through the incoming inherited variable names
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) { for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; ++fdit ) {
(*fdit)->setBaseClassOffset( class_offset ) ; (*fdit)->setBaseClassOffset( class_offset ) ;
(*fdit)->setInherited( true ) ; (*fdit)->setInherited( true ) ;
@ -72,7 +72,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
#else #else
{ {
#endif #endif
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) { for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; ++fdit ) {
std::string in_name = (*fdit)->getName() ; std::string in_name = (*fdit)->getName() ;
// search existing names for incoming inherited variable name. // search existing names for incoming inherited variable name.
@ -113,7 +113,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
void ClassValues::saveInheritAncestry( ClassValues * in_cv ) { void ClassValues::saveInheritAncestry( ClassValues * in_cv ) {
std::map< std::string , unsigned int >::iterator mit ; std::map< std::string , unsigned int >::iterator mit ;
for ( mit = in_cv->all_inherited_class_names_map.begin() ; mit != in_cv->all_inherited_class_names_map.end() ; mit++ ) { for ( mit = in_cv->all_inherited_class_names_map.begin() ; mit != in_cv->all_inherited_class_names_map.end() ; ++mit ) {
all_inherited_class_names_map[(*mit).first] += (*mit).second ; all_inherited_class_names_map[(*mit).first] += (*mit).second ;
} }
@ -123,7 +123,7 @@ void ClassValues::saveInheritAncestry( ClassValues * in_cv ) {
void ClassValues::setContainerClassForFields() { void ClassValues::setContainerClassForFields() {
std::vector<FieldDescription *>::iterator fdit ; std::vector<FieldDescription *>::iterator fdit ;
// Loop through all fields // Loop through all fields
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) { for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
// Prepend the field container class with the current class name. // Prepend the field container class with the current class name.
(*fdit)->setContainerClass( name + "::" + (*fdit)->getContainerClass() ) ; (*fdit)->setContainerClass( name + "::" + (*fdit)->getContainerClass() ) ;
} }
@ -134,13 +134,13 @@ void ClassValues::clearAmbiguousVariables() {
std::map< std::string , unsigned int >::iterator mit ; std::map< std::string , unsigned int >::iterator mit ;
std::vector<FieldDescription *>::iterator fdit ; std::vector<FieldDescription *>::iterator fdit ;
for ( mit = all_inherited_class_names_map.begin() ; mit != all_inherited_class_names_map.end() ; mit++ ) { for ( mit = all_inherited_class_names_map.begin() ; mit != all_inherited_class_names_map.end() ; ++mit ) {
// If a class in inherited more than once we have a diamond. We'll need to modify variables that were // If a class in inherited more than once we have a diamond. We'll need to modify variables that were
// inherited from that class. // inherited from that class.
if ( (*mit).second > 1 ) { if ( (*mit).second > 1 ) {
std::string str = (*mit).first + "::" ; std::string str = (*mit).first + "::" ;
// Loop through all fields testing for the diamond inherited class in the name. // Loop through all fields testing for the diamond inherited class in the name.
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) { for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
std::string fdit_name = (*fdit)->getName() ; std::string fdit_name = (*fdit)->getName() ;
size_t f = fdit_name.find(str) ; size_t f = fdit_name.find(str) ;
// If the variable contains the diamond class string, remove the diamond class qualification. // If the variable contains the diamond class string, remove the diamond class qualification.

View File

@ -210,7 +210,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
} else { } else {
// Test all constructors to see if any of those are the default and public // Test all constructors to see if any of those are the default and public
clang::CXXRecordDecl::ctor_iterator cit ; clang::CXXRecordDecl::ctor_iterator cit ;
for ( cit = rec->ctor_begin() ; cit != rec->ctor_end() ; cit++ ) { for ( cit = rec->ctor_begin() ; cit != rec->ctor_end() ; ++cit ) {
if ( ( !(*cit)->isDeleted() ) and (*cit)->isDefaultConstructor() and (*cit)->getAccess() == clang::AS_public ) { if ( ( !(*cit)->isDeleted() ) and (*cit)->isDefaultConstructor() and (*cit)->getAccess() == clang::AS_public ) {
cval.setHasDefaultConstructor(true) ; cval.setHasDefaultConstructor(true) ;
} }
@ -234,7 +234,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
//std::cout << "parsing " << cval.getName() << std::endl ; //std::cout << "parsing " << cval.getName() << std::endl ;
//std::cout << " processing inheritance " << rec->getNumBases() << " " << rec->getNumVBases() << "" << std::endl ; //std::cout << " processing inheritance " << rec->getNumBases() << " " << rec->getNumVBases() << "" << std::endl ;
clang::CXXRecordDecl::base_class_iterator bcii ; clang::CXXRecordDecl::base_class_iterator bcii ;
for ( bcii = rec->bases_begin() ; bcii != rec->bases_end() ; bcii++ ) { for ( bcii = rec->bases_begin() ; bcii != rec->bases_end() ; ++bcii ) {
if ( !bcii->isVirtual() ) { if ( !bcii->isVirtual() ) {
const clang::Type * temp = bcii->getType().getTypePtr() ; const clang::Type * temp = bcii->getType().getTypePtr() ;
//std::cout << "\ninherited Type = " << temp->getTypeClassName() << "" << std::endl ; //std::cout << "\ninherited Type = " << temp->getTypeClassName() << "" << std::endl ;
@ -282,7 +282,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
// When processing inherited classes include_virtual_base will be set to true // When processing inherited classes include_virtual_base will be set to true
// so we don't process virtual inherited classes multiple times. // so we don't process virtual inherited classes multiple times.
if ( include_virtual_base ) { if ( include_virtual_base ) {
for ( bcii = rec->vbases_begin() ; bcii != rec->vbases_end() ; bcii++ ) { for ( bcii = rec->vbases_begin() ; bcii != rec->vbases_end() ; ++bcii ) {
const clang::Type * temp = bcii->getType().getTypePtr() ; const clang::Type * temp = bcii->getType().getTypePtr() ;
//std::cout << "\ninherited Type = " << temp->getTypeClassName() << "" << std::endl ; //std::cout << "\ninherited Type = " << temp->getTypeClassName() << "" << std::endl ;
const clang::RecordType * rt = temp->getAs<clang::RecordType>() ; const clang::RecordType * rt = temp->getAs<clang::RecordType>() ;

View File

@ -60,7 +60,7 @@ std::string CommentSaver::getTrickHeaderComment( std::string file_name ) {
if ( resolved_path != NULL ) { if ( resolved_path != NULL ) {
if ( trick_header_comments.find(resolved_path) == trick_header_comments.end() ) { if ( trick_header_comments.find(resolved_path) == trick_header_comments.end() ) {
trick_header_comments[resolved_path] = std::string() ; trick_header_comments[resolved_path] = std::string() ;
for ( cit = comment_map[resolved_path].begin() ; cit != comment_map[resolved_path].end() ; cit++ ) { for ( cit = comment_map[resolved_path].begin() ; cit != comment_map[resolved_path].end() ; ++cit ) {
std::string comment_str = getComment((*cit).second) ; std::string comment_str = getComment((*cit).second) ;
if ( comment_str.find("@trick_parse") != std::string::npos or if ( comment_str.find("@trick_parse") != std::string::npos or
comment_str.find("\\trick_parse") != std::string::npos ) { comment_str.find("\\trick_parse") != std::string::npos ) {

View File

@ -304,7 +304,7 @@ void FieldDescription::parseComment(std::string comment) {
// escape special characters, convert tabs and newlines to spaces, remove multiple spaces. // escape special characters, convert tabs and newlines to spaces, remove multiple spaces.
std::ostringstream ss ; std::ostringstream ss ;
bool is_space = false ; bool is_space = false ;
for (std::string::iterator it = comment.begin(); it != comment.end(); it++) { for (std::string::iterator it = comment.begin(); it != comment.end(); ++it) {
switch (*it) { switch (*it) {
case '\\': ss << "\\\\"; is_space = false ; break; case '\\': ss << "\\\\"; is_space = false ; break;
case '"': ss << "\\\""; is_space = false ; break; case '"': ss << "\\\""; is_space = false ; break;

View File

@ -442,7 +442,7 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
// Test if we have some type from STL. // Test if we have some type from STL.
if (!tst_string.compare( 0 , 5 , "std::")) { if (!tst_string.compare( 0 , 5 , "std::")) {
// If we have some type from std, figure out if it is one we support. // If we have some type from std, figure out if it is one we support.
for ( std::map<std::string, bool>::iterator it = stl_classes.begin() ; it != stl_classes.end() ; it++ ) { for ( std::map<std::string, bool>::iterator it = stl_classes.begin() ; it != stl_classes.end() ; ++it ) {
/* Mark STL types that are not strings and exit */ /* Mark STL types that are not strings and exit */
if (!tst_string.compare( 0 , (*it).first.size() , (*it).first)) { if (!tst_string.compare( 0 , (*it).first.size() , (*it).first)) {

View File

@ -80,7 +80,7 @@ void FindTrickICG::If(clang::SourceLocation Loc, clang::SourceRange ConditionRan
if ( ref.str().find("TRICK_ICG") != std::string::npos ) { if ( ref.str().find("TRICK_ICG") != std::string::npos ) {
// for each header in the stack, mark them as being exposed to TRICK_ICG // for each header in the stack, mark them as being exposed to TRICK_ICG
std::vector<std::string>::iterator it ; std::vector<std::string>::iterator it ;
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) { for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
hsd.addTrickICGFoundFile(*it) ; hsd.addTrickICGFoundFile(*it) ;
} }
// print warning messages. // print warning messages.
@ -124,7 +124,7 @@ void FindTrickICG::Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNam
if ( (loc_str.find("S_source.hh") == std::string::npos) ) { if ( (loc_str.find("S_source.hh") == std::string::npos) ) {
// for each header in the stack, mark them as being exposed to TRICK_ICG // for each header in the stack, mark them as being exposed to TRICK_ICG
std::vector<std::string>::iterator it ; std::vector<std::string>::iterator it ;
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) { for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
hsd.addTrickICGFoundFile(*it) ; hsd.addTrickICGFoundFile(*it) ;
} }
// print warning messages. // print warning messages.
@ -149,7 +149,7 @@ void FindTrickICG::Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNa
std::string loc_str = Loc.printToString(ci.getSourceManager()) ; std::string loc_str = Loc.printToString(ci.getSourceManager()) ;
// for each header in the stack, mark them as being exposed to TRICK_ICG // for each header in the stack, mark them as being exposed to TRICK_ICG
std::vector<std::string>::iterator it ; std::vector<std::string>::iterator it ;
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) { for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
hsd.addTrickICGFoundFile(*it) ; hsd.addTrickICGFoundFile(*it) ;
} }
// print warning messages. // print warning messages.

View File

@ -186,13 +186,13 @@ void HeaderSearchDirs::ApplyHeaderSearchOptions () {
clang::ApplyHeaderSearchOptions( hs , hso , pp.getLangOpts() , pp.getTargetInfo().getTriple() ) ; clang::ApplyHeaderSearchOptions( hs , hso , pp.getLangOpts() , pp.getTargetInfo().getTriple() ) ;
//clang::HeaderSearch::search_dir_iterator sdi ; //clang::HeaderSearch::search_dir_iterator sdi ;
/* /*
for ( sdi = hs.quoted_dir_begin() ; sdi != hs.quoted_dir_end() ; sdi++ ) { for ( sdi = hs.quoted_dir_begin() ; sdi != hs.quoted_dir_end() ; ++sdi ) {
std::cout << "quoted dir " << (*sdi).getName() << std::endl ; std::cout << "quoted dir " << (*sdi).getName() << std::endl ;
} }
for ( sdi = hs.angled_dir_begin() ; sdi != hs.angled_dir_end() ; sdi++ ) { for ( sdi = hs.angled_dir_begin() ; sdi != hs.angled_dir_end() ; ++sdi ) {
std::cout << "angled dir " << (*sdi).getName() << std::endl ; std::cout << "angled dir " << (*sdi).getName() << std::endl ;
} }
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) { for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi ) {
std::cout << "system dir " << (*sdi).getName() << std::endl ; std::cout << "system dir " << (*sdi).getName() << std::endl ;
} }
*/ */
@ -229,7 +229,7 @@ bool HeaderSearchDirs::isPathInUserDir (const std::string& in_dir ) {
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) ) for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
#else #else
clang::HeaderSearch::search_dir_iterator sdi ; clang::HeaderSearch::search_dir_iterator sdi ;
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi )
#endif #endif
{ {
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported #if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
@ -261,7 +261,7 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) {
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) ) for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
#else #else
clang::HeaderSearch::search_dir_iterator sdi ; clang::HeaderSearch::search_dir_iterator sdi ;
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi )
#endif #endif
{ {
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported #if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
@ -279,7 +279,7 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) {
bool HeaderSearchDirs::isPathInExclude (const std::string& in_dir ) { bool HeaderSearchDirs::isPathInExclude (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; vit++ ) { for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return true ; return true ;
} }
@ -291,7 +291,7 @@ bool HeaderSearchDirs::isPathInExclude (const std::string& in_dir ) {
bool HeaderSearchDirs::isPathInICGExclude (const std::string& in_dir ) { bool HeaderSearchDirs::isPathInICGExclude (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; vit++ ) { for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return true ; return true ;
} }
@ -303,7 +303,7 @@ bool HeaderSearchDirs::isPathInICGExclude (const std::string& in_dir ) {
bool HeaderSearchDirs::isPathInExtLib (const std::string& in_dir ) { bool HeaderSearchDirs::isPathInExtLib (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; vit++ ) { for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return true ; return true ;
} }
@ -318,7 +318,7 @@ bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
} }
else { else {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; vit++ ) { for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
icg_nocomment_files[in_dir] = true ; icg_nocomment_files[in_dir] = true ;
return true; return true;
@ -332,7 +332,7 @@ bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) { bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = compat15_dirs.begin() ; vit != compat15_dirs.end() ; vit++ ) { for ( vit = compat15_dirs.begin() ; vit != compat15_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return true ; return true ;
} }
@ -347,7 +347,7 @@ bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {
std::string HeaderSearchDirs::getPathInExclude (const std::string& in_dir ) { std::string HeaderSearchDirs::getPathInExclude (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; vit++ ) { for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return (*vit) ; return (*vit) ;
} }
@ -359,7 +359,7 @@ std::string HeaderSearchDirs::getPathInExclude (const std::string& in_dir ) {
std::string HeaderSearchDirs::getPathInICGExclude (const std::string& in_dir ) { std::string HeaderSearchDirs::getPathInICGExclude (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; vit++ ) { for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return (*vit) ; return (*vit) ;
} }
@ -371,7 +371,7 @@ std::string HeaderSearchDirs::getPathInICGExclude (const std::string& in_dir ) {
std::string HeaderSearchDirs::getPathInExtLib (const std::string& in_dir ) { std::string HeaderSearchDirs::getPathInExtLib (const std::string& in_dir ) {
std::vector<std::string>::iterator vit ; std::vector<std::string>::iterator vit ;
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; vit++ ) { for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; ++vit ) {
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) { if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
return (*vit) ; return (*vit) ;
} }

View File

@ -449,7 +449,7 @@ void PrintAttributes::printIOMakefile() {
<< "IO_OBJECTS =" ; << "IO_OBJECTS =" ;
std::map< std::string , std::string >::iterator mit ; std::map< std::string , std::string >::iterator mit ;
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) { for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; ++mit ) {
size_t found ; size_t found ;
found = (*mit).second.find_last_of(".") ; found = (*mit).second.find_last_of(".") ;
makefile_io_src << " \\\n " << (*mit).second.substr(0,found) << ".o" ; makefile_io_src << " \\\n " << (*mit).second.substr(0,found) << ".o" ;
@ -487,7 +487,7 @@ void PrintAttributes::printIOMakefile() {
ICG_processed.open("build/ICG_processed") ; ICG_processed.open("build/ICG_processed") ;
makefile_ICG << "build/Makefile_io_src:" ; makefile_ICG << "build/Makefile_io_src:" ;
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) { for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; ++mit ) {
makefile_ICG << " \\\n " << (*mit).first ; makefile_ICG << " \\\n " << (*mit).first ;
size_t found ; size_t found ;
found = (*mit).second.find_last_of(".") ; found = (*mit).second.find_last_of(".") ;
@ -518,7 +518,7 @@ void PrintAttributes::printICGNoFiles() {
if ( ! sim_services_flag ) { if ( ! sim_services_flag ) {
std::vector< std::string >::iterator it ; std::vector< std::string >::iterator it ;
std::ofstream icg_no_outfile("build/ICG_no_found") ; std::ofstream icg_no_outfile("build/ICG_no_found") ;
for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; it++ ) { for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; ++it ) {
icg_no_outfile << (*it) << std::endl ; icg_no_outfile << (*it) << std::endl ;
} }
icg_no_outfile.close() ; icg_no_outfile.close() ;

View File

@ -182,7 +182,7 @@ void Trick::DataRecordDispatcher::remove_all_groups() {
Trick::DataRecordGroup * Trick::DataRecordDispatcher::get_group(std::string in_name) { Trick::DataRecordGroup * Trick::DataRecordDispatcher::get_group(std::string in_name) {
std::vector <Trick::DataRecordGroup *>::iterator it ; std::vector <Trick::DataRecordGroup *>::iterator it ;
for ( it = groups.begin() ; it != groups.end() ; it++ ) { for ( it = groups.begin() ; it != groups.end() ; ++it ) {
if ( ! (*it)->get_group_name().compare(in_name) ) if ( ! (*it)->get_group_name().compare(in_name) )
return *it ; return *it ;
} }

View File

@ -512,7 +512,7 @@ int Trick::DataRecordGroup::restart() {
std::vector <Trick::DataRecordBuffer *>::iterator drb_it ; std::vector <Trick::DataRecordBuffer *>::iterator drb_it ;
/* delete the current rec_buffer */ /* delete the current rec_buffer */
for ( drb_it = rec_buffer.begin() ; drb_it != rec_buffer.end() ; drb_it++ ) { for ( drb_it = rec_buffer.begin() ; drb_it != rec_buffer.end() ; ++drb_it ) {
delete *drb_it ; delete *drb_it ;
} }
rec_buffer.clear() ; rec_buffer.clear() ;
@ -520,7 +520,7 @@ int Trick::DataRecordGroup::restart() {
add_time_variable() ; add_time_variable() ;
/* delete the current change_buffer contents */ /* delete the current change_buffer contents */
for ( drb_it = change_buffer.begin() ; drb_it != change_buffer.end() ; drb_it++ ) { for ( drb_it = change_buffer.begin() ; drb_it != change_buffer.end() ; ++drb_it ) {
delete *drb_it ; delete *drb_it ;
} }
change_buffer.clear() ; change_buffer.clear() ;

View File

@ -44,7 +44,7 @@ int Trick::Environment::print_vars( FILE * fp ) {
std::map<std::string, std::string >::iterator it ; std::map<std::string, std::string >::iterator it ;
for ( it = local_env.begin() ; it != local_env.end() ; it++ ) { for ( it = local_env.begin() ; it != local_env.end() ; ++it ) {
fprintf(fp, "%s = %s\n", it->first.c_str(), it->second.c_str()); fprintf(fp, "%s = %s\n", it->first.c_str(), it->second.c_str());
} }

View File

@ -30,7 +30,7 @@ void Trick::EventProcessor::add_event(Trick::Event * in_event) {
*/ */
void Trick::EventProcessor::remove_event(Trick::Event * in_event) { void Trick::EventProcessor::remove_event(Trick::Event * in_event) {
std::multiset< Trick::Event *, CompareEventPtrs >::iterator sit = event_set.begin() ; std::multiset< Trick::Event *, CompareEventPtrs >::iterator sit = event_set.begin() ;
for (sit=event_set.begin(); sit!=event_set.end(); sit++) { for (sit=event_set.begin(); sit!=event_set.end(); ++sit) {
if ((*sit) == in_event) { if ((*sit) == in_event) {
event_set.erase(sit) ; event_set.erase(sit) ;
break; break;

View File

@ -148,7 +148,7 @@ int Trick::Executive::add_job_to_queue( Trick::JobData * job ) {
/* Add job to convienience constructs for easy retrival */ /* Add job to convienience constructs for easy retrival */
all_jobs.insert(std::pair<std::string, JobData *>(job->name,job)) ; all_jobs.insert(std::pair<std::string, JobData *>(job->name,job)) ;
all_jobs_vector.push_back(job) ; all_jobs_vector.push_back(job) ;
for ( it = job->tags_begin() ; it != job->tags_end() ; it++ ) { for ( it = job->tags_begin() ; it != job->tags_end() ; ++it ) {
all_tagged_jobs.insert(std::pair<std::string, JobData *>(*it,job)) ; all_tagged_jobs.insert(std::pair<std::string, JobData *>(*it,job)) ;
} }

View File

@ -15,7 +15,7 @@ Trick::JobData * Trick::Executive::get_job(std::string job_name, unsigned int j_
range = all_jobs.equal_range(job_name) ; range = all_jobs.equal_range(job_name) ;
/** @li Move to the j_instance-th item in the list */ /** @li Move to the j_instance-th item in the list */
for ( it = range.first , ii = 1 ; (it != range.second) && (ii < j_instance) ; it++ , ii++ ) ; for ( it = range.first , ii = 1 ; (it != range.second) && (ii < j_instance) ; ++it , ii++ ) ;
/** @li If the j_instance-th item doesn't exist return NULL */ /** @li If the j_instance-th item doesn't exist return NULL */
if ( it == range.second ) { if ( it == range.second ) {

View File

@ -40,7 +40,7 @@ int Trick::Executive::remove_jobs( Trick::SimObject * in_sim_object ) {
} }
/* search the executive queues for the job and remove it if found */ /* search the executive queues for the job and remove it if found */
for ( std::vector <Trick::JobData *>::iterator jit = in_sim_object->jobs.begin() ; jit != in_sim_object->jobs.end() ; jit++ ) { for ( std::vector <Trick::JobData *>::iterator jit = in_sim_object->jobs.begin() ; jit != in_sim_object->jobs.end() ; ++jit ) {
std::map<std::string, int>::iterator class_id_it ; std::map<std::string, int>::iterator class_id_it ;
std::map<int, Trick::ScheduledJobQueue *>::iterator queue_it ; std::map<int, Trick::ScheduledJobQueue *>::iterator queue_it ;
Trick::ScheduledJobQueue * curr_queue ; Trick::ScheduledJobQueue * curr_queue ;

View File

@ -17,7 +17,7 @@ int Trick::Executive::delete_sim_object( Trick::SimObject * in_object ) {
std::vector <Trick::SimObject *>::iterator so_it ; std::vector <Trick::SimObject *>::iterator so_it ;
std::vector <Trick::Scheduler *>::iterator sched_it ; std::vector <Trick::Scheduler *>::iterator sched_it ;
for ( so_it = in_object->pre_component_objects.begin() ; so_it != in_object->pre_component_objects.end() ; so_it++ ) { for ( so_it = in_object->pre_component_objects.begin() ; so_it != in_object->pre_component_objects.end() ; ++so_it ) {
delete_sim_object((*so_it)) ; delete_sim_object((*so_it)) ;
} }
@ -31,11 +31,11 @@ int Trick::Executive::delete_sim_object( Trick::SimObject * in_object ) {
remove_jobs( in_object ) ; remove_jobs( in_object ) ;
for ( sched_it = other_schedulers.begin() ; sched_it != other_schedulers.end() ; sched_it++ ) { for ( sched_it = other_schedulers.begin() ; sched_it != other_schedulers.end() ; ++sched_it ) {
(*sched_it)->delete_sim_object(in_object) ; (*sched_it)->delete_sim_object(in_object) ;
} }
for ( so_it = in_object->post_component_objects.begin() ; so_it != in_object->post_component_objects.end() ; so_it++ ) { for ( so_it = in_object->post_component_objects.begin() ; so_it != in_object->post_component_objects.end() ; ++so_it ) {
delete_sim_object((*so_it)) ; delete_sim_object((*so_it)) ;
} }

View File

@ -44,8 +44,8 @@ int Trick::Executive::restart() {
all_tagged_jobs.clear() ; all_tagged_jobs.clear() ;
/* Create a temporary all_jobs map to use to restore job data from all_jobs_for_checkpoint */ /* Create a temporary all_jobs map to use to restore job data from all_jobs_for_checkpoint */
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; sit++ ) { for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; ++sit ) {
for ( jit = (*sit)->jobs.begin() ; jit != (*sit)->jobs.end() ; jit++ ) { for ( jit = (*sit)->jobs.begin() ; jit != (*sit)->jobs.end() ; ++jit ) {
/* Dynamically created sim_objects, like data_recording objects, require that /* Dynamically created sim_objects, like data_recording objects, require that
some of the job class data be repopulated before we start some of the job class data be repopulated before we start
copying job data back into the sim. */ copying job data back into the sim. */
@ -67,7 +67,7 @@ int Trick::Executive::restart() {
message_publish(MSG_ERROR, "Could not find job %s\n", all_jobs_for_checkpoint[ii].name.c_str()) ; message_publish(MSG_ERROR, "Could not find job %s\n", all_jobs_for_checkpoint[ii].name.c_str()) ;
exec_terminate_with_return( -1 , __FILE__ , __LINE__ , "Job in checkpoint file does not exist in current sim." ) ; exec_terminate_with_return( -1 , __FILE__ , __LINE__ , "Job in checkpoint file does not exist in current sim." ) ;
} else { } else {
for ( it = ret.first ; it != ret.second ; it++ ) { for ( it = ret.first ; it != ret.second ; ++it ) {
// The JobData::id and JobData::sim_object_id together uniquely identify a job. // The JobData::id and JobData::sim_object_id together uniquely identify a job.
if (( it->second->id == all_jobs_for_checkpoint[ii].id ) && if (( it->second->id == all_jobs_for_checkpoint[ii].id ) &&
( it->second->sim_object_id == all_jobs_for_checkpoint[ii].sim_object_id )) { ( it->second->sim_object_id == all_jobs_for_checkpoint[ii].sim_object_id )) {
@ -80,7 +80,7 @@ int Trick::Executive::restart() {
/* restore the executive sim_objects vector from the checkpoint and add back all of /* restore the executive sim_objects vector from the checkpoint and add back all of
the jobs to the schedulers */ the jobs to the schedulers */
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; sit++ ) { for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; ++sit ) {
add_jobs_to_queue(*sit, true) ; add_jobs_to_queue(*sit, true) ;
for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) { for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) {
other_schedulers[ii]->add_sim_object(*sit) ; other_schedulers[ii]->add_sim_object(*sit) ;

View File

@ -27,7 +27,7 @@ int Trick::Executive::set_job_cycle(std::string job_name, int instance_num, doub
range = all_tagged_jobs.equal_range(job_name) ; range = all_tagged_jobs.equal_range(job_name) ;
if (range.first != range.second) { if (range.first != range.second) {
// set cycle for all jobs with this tag // set cycle for all jobs with this tag
for ( it = range.first; it != range.second ; it++ ) { for ( it = range.first; it != range.second ; ++it ) {
(*it).second->set_cycle(in_cycle) ; (*it).second->set_cycle(in_cycle) ;
(*it).second->set_next_call_time(time_tics) ; (*it).second->set_next_call_time(time_tics) ;
} }

View File

@ -21,7 +21,7 @@ int Trick::Executive::set_job_onoff(std::string job_name, int instance_num , int
range = all_tagged_jobs.equal_range(job_name) ; range = all_tagged_jobs.equal_range(job_name) ;
if (range.first != range.second) { if (range.first != range.second) {
// set disabled flag accordingly for all jobs with this tag // set disabled flag accordingly for all jobs with this tag
for ( it = range.first; it != range.second ; it++ ) { for ( it = range.first; it != range.second ; ++it ) {
it->second->disabled = !on ; it->second->disabled = !on ;
} }
} else { } else {

View File

@ -33,7 +33,7 @@ int Trick::FrameDataRecordGroup::frame_log_clear() {
return 0 ; return 0 ;
} }
std::vector< Trick::JobData *>::iterator it ; std::vector< Trick::JobData *>::iterator it ;
for ( it = rec_jobs.begin() ; it != rec_jobs.end() ; it++ ) { for ( it = rec_jobs.begin() ; it != rec_jobs.end() ; ++it ) {
(*it)->frame_time = 0 ; (*it)->frame_time = 0 ;
(*it)->frame_time_seconds = 0.0; (*it)->frame_time_seconds = 0.0;
} }

View File

@ -177,7 +177,7 @@ void Trick::FrameLog::add_recording_vars_for_jobs() {
/* set the recoring job be and end of frame job. Set each recording group to it's proper thread. */ /* set the recoring job be and end of frame job. Set each recording group to it's proper thread. */
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() , ii = 0 ; fdrg_it != drg_users.end() ; fdrg_it++ , ii++ ) { for ( fdrg_it = drg_users.begin() , ii = 0 ; fdrg_it != drg_users.end() ; ++fdrg_it , ii++ ) {
(*fdrg_it)->set_job_class("end_of_frame") ; (*fdrg_it)->set_job_class("end_of_frame") ;
(*fdrg_it)->set_phase(65533); (*fdrg_it)->set_phase(65533);
(*fdrg_it)->set_thread(ii); (*fdrg_it)->set_thread(ii);
@ -251,7 +251,7 @@ void Trick::FrameLog::add_recording_vars_for_frame() {
*/ */
void Trick::FrameLog::add_recording_groups_to_sim() { void Trick::FrameLog::add_recording_groups_to_sim() {
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) { for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
add_data_record_group( *fdrg_it , Trick::DR_Ring_Buffer) ; add_data_record_group( *fdrg_it , Trick::DR_Ring_Buffer) ;
} }
add_data_record_group(drg_trick, Trick::DR_Ring_Buffer) ; add_data_record_group(drg_trick, Trick::DR_Ring_Buffer) ;
@ -267,7 +267,7 @@ void Trick::FrameLog::add_recording_groups_to_sim() {
*/ */
void Trick::FrameLog::remove_recording_groups_from_sim() { void Trick::FrameLog::remove_recording_groups_from_sim() {
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) { for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
remove_data_record_group( *fdrg_it) ; remove_data_record_group( *fdrg_it) ;
} }
remove_data_record_group(drg_trick) ; remove_data_record_group(drg_trick) ;
@ -283,7 +283,7 @@ void Trick::FrameLog::remove_recording_groups_from_sim() {
*/ */
void Trick::FrameLog::enable_recording_groups() { void Trick::FrameLog::enable_recording_groups() {
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) { for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
(*fdrg_it)->enable() ; (*fdrg_it)->enable() ;
} }
drg_trick->enable() ; drg_trick->enable() ;
@ -299,7 +299,7 @@ void Trick::FrameLog::enable_recording_groups() {
*/ */
void Trick::FrameLog::disable_recording_groups() { void Trick::FrameLog::disable_recording_groups() {
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) { for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
(*fdrg_it)->disable() ; (*fdrg_it)->disable() ;
} }
drg_trick->disable() ; drg_trick->disable() ;
@ -315,7 +315,7 @@ void Trick::FrameLog::disable_recording_groups() {
*/ */
void Trick::FrameLog::init_recording_groups() { void Trick::FrameLog::init_recording_groups() {
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ; std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) { for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
(*fdrg_it)->init() ; (*fdrg_it)->init() ;
} }
drg_trick->init() ; drg_trick->init() ;
@ -481,7 +481,7 @@ int Trick::FrameLog::set_max_samples(int num) {
timeline_other[ii] = (Trick::timeline_t *)realloc( timeline_other[ii], tl_max_samples*sizeof(Trick::timeline_t)); timeline_other[ii] = (Trick::timeline_t *)realloc( timeline_other[ii], tl_max_samples*sizeof(Trick::timeline_t));
} }
std::vector< Trick::FrameDataRecordGroup *>::iterator it ; std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) { for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
(*it)->set_max_buffer_size(num) ; (*it)->set_max_buffer_size(num) ;
} }
drg_trick->set_max_buffer_size(num) ; drg_trick->set_max_buffer_size(num) ;
@ -527,7 +527,7 @@ int Trick::FrameLog::clear_data_record_info() {
remove_recording_groups_from_sim() ; remove_recording_groups_from_sim() ;
std::vector< Trick::FrameDataRecordGroup *>::iterator it ; std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) { for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
(*it)->clear_checkpoint_vars() ; (*it)->clear_checkpoint_vars() ;
} }
drg_trick->clear_checkpoint_vars() ; drg_trick->clear_checkpoint_vars() ;
@ -549,7 +549,7 @@ clear_data_record_info.
int Trick::FrameLog::restart() { int Trick::FrameLog::restart() {
// removing the data record groups removed the restart jobs too. call them here. // removing the data record groups removed the restart jobs too. call them here.
std::vector< Trick::FrameDataRecordGroup *>::iterator it ; std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) { for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
(*it)->restart() ; (*it)->restart() ;
} }
drg_trick->restart() ; drg_trick->restart() ;
@ -844,7 +844,7 @@ int Trick::FrameLog::create_DP_job_files() {
total_plots = drg_users[ii]->rec_buffer.size(); total_plots = drg_users[ii]->rec_buffer.size();
std::vector <Trick::DataRecordBuffer *>::iterator drb_it ; std::vector <Trick::DataRecordBuffer *>::iterator drb_it ;
bg_color = (char *)"cornsilk2"; bg_color = (char *)"cornsilk2";
for ( drb_it = drg_users[ii]->rec_buffer.begin() + 1 ; drb_it != drg_users[ii]->rec_buffer.end() ; drb_it++ ) { for ( drb_it = drg_users[ii]->rec_buffer.begin() + 1 ; drb_it != drg_users[ii]->rec_buffer.end() ; ++drb_it ) {
if ( ! (*drb_it)->name.compare(0, 5, "frame") ) continue ; if ( ! (*drb_it)->name.compare(0, 5, "frame") ) continue ;
// plots_per_page job plots per page // plots_per_page job plots per page
if ((plots == 0) || (plots > plots_per_page)) { if ((plots == 0) || (plots > plots_per_page)) {

View File

@ -46,7 +46,7 @@ static PyThreadState *_save = NULL;
void Trick::IPPython::get_TMM_named_variables() { void Trick::IPPython::get_TMM_named_variables() {
//std::cout << "top level names at initialization" << std::endl ; //std::cout << "top level names at initialization" << std::endl ;
Trick::ALLOC_INFO_MAP_ITER aim_it ; Trick::ALLOC_INFO_MAP_ITER aim_it ;
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; aim_it++ ) { for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; ++aim_it ) {
ALLOC_INFO * alloc_info = (*aim_it).second ; ALLOC_INFO * alloc_info = (*aim_it).second ;
if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) { if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) {
std::stringstream ss ; std::stringstream ss ;

View File

@ -264,7 +264,7 @@ int Trick::JITInputFile::add_library(std::string lib_name) {
void * Trick::JITInputFile::find_symbol(std::string sym) { void * Trick::JITInputFile::find_symbol(std::string sym) {
std::map< std::string , JITLibInfo >::iterator it ; std::map< std::string , JITLibInfo >::iterator it ;
for ( it = file_to_libinfo_map.begin() ; it != file_to_libinfo_map.end() ; it++ ) { for ( it = file_to_libinfo_map.begin() ; it != file_to_libinfo_map.end() ; ++it ) {
void * ret = (*it).second.find_symbol(sym) ; void * ret = (*it).second.find_symbol(sym) ;
if (ret != NULL) { if (ret != NULL) {
return ret ; return ret ;

View File

@ -225,7 +225,7 @@ int Trick::JSONVariableServerThread::get_vars( std::stringstream & body , char *
if ( path[0] == '\0' ) { if ( path[0] == '\0' ) {
Trick::ALLOC_INFO_MAP_ITER aim_it ; Trick::ALLOC_INFO_MAP_ITER aim_it ;
bool first_item = true ; bool first_item = true ;
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; aim_it++ ) { for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; ++aim_it ) {
ALLOC_INFO * alloc_info = (*aim_it).second ; ALLOC_INFO * alloc_info = (*aim_it).second ;
if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) { if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) {
if ( first_item == true ) { if ( first_item == true ) {

View File

@ -80,7 +80,7 @@ Trick::MemoryManager::~MemoryManager() {
delete defaultCheckPointAgent ; delete defaultCheckPointAgent ;
for ( ait = alloc_info_map.begin() ; ait != alloc_info_map.end() ; ait++ ) { for ( ait = alloc_info_map.begin() ; ait != alloc_info_map.end() ; ++ait ) {
ALLOC_INFO * ai_ptr = (*ait).second ; ALLOC_INFO * ai_ptr = (*ait).second ;
if (ai_ptr->stcl == TRICK_LOCAL) { if (ai_ptr->stcl == TRICK_LOCAL) {
if ( ai_ptr->alloc_type == TRICK_ALLOC_MALLOC ) { if ( ai_ptr->alloc_type == TRICK_ALLOC_MALLOC ) {

View File

@ -1294,7 +1294,7 @@ TEST_F(MM_stl_checkpoint, recursive_nightmare ) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
int j = 0; int j = 0;
for (auto it = recursive_nightmare_copy[i].begin(); it != recursive_nightmare_copy[i].end(); it++, j++) { for (auto it = recursive_nightmare_copy[i].begin(); it != recursive_nightmare_copy[i].end(); ++it, j++) {
std::pair<int,int> key = it->first; std::pair<int,int> key = it->first;
std::vector<std::stack<std::string>> val = it->second; std::vector<std::stack<std::string>> val = it->second;

View File

@ -63,7 +63,7 @@ int Trick::MessagePublisher::publish(int level , std::string message) {
/** @li Go through all its subscribers and send a message update to the subscriber that is enabled. */ /** @li Go through all its subscribers and send a message update to the subscriber that is enabled. */
if ( ! subscribers.empty() ) { if ( ! subscribers.empty() ) {
for ( p = subscribers.begin() ; p != subscribers.end() ; p++ ) { for ( p = subscribers.begin() ; p != subscribers.end() ; ++p ) {
if ( (*p)->enabled ) { if ( (*p)->enabled ) {
(*p)->update(level , header , message) ; (*p)->update(level , header , message) ;
} }
@ -81,7 +81,7 @@ int Trick::MessagePublisher::publish(int level , std::string message) {
Trick::MessageSubscriber * Trick::MessagePublisher::getSubscriber( std::string sub_name ) { Trick::MessageSubscriber * Trick::MessagePublisher::getSubscriber( std::string sub_name ) {
std::list<Trick::MessageSubscriber *>::iterator lit ; std::list<Trick::MessageSubscriber *>::iterator lit ;
for ( lit = subscribers.begin() ; lit != subscribers.end() ; lit++ ) { for ( lit = subscribers.begin() ; lit != subscribers.end() ; ++lit ) {
if ( ! (*lit)->name.compare(sub_name) ) { if ( ! (*lit)->name.compare(sub_name) ) {
return *lit ; return *lit ;
} }

View File

@ -40,7 +40,7 @@ int Trick::RtiExec::Exec () {
// use trylock so we don't block if the mutex is in use. // use trylock so we don't block if the mutex is in use.
if ( pthread_mutex_trylock(&list_mutex) == 0 ) { if ( pthread_mutex_trylock(&list_mutex) == 0 ) {
std::vector < RtiList * >::iterator rlit ; std::vector < RtiList * >::iterator rlit ;
for ( rlit = fire_list.begin() ; rlit != fire_list.end() ; rlit++ ) { for ( rlit = fire_list.begin() ; rlit != fire_list.end() ; ++rlit ) {
(*rlit)->execute(debug) ; (*rlit)->execute(debug) ;
delete (*rlit) ; delete (*rlit) ;
} }

View File

@ -7,7 +7,7 @@
void Trick::RtiList::execute( bool debug ) { void Trick::RtiList::execute( bool debug ) {
std::vector<RtiEventBase * >::iterator rebit ; std::vector<RtiEventBase * >::iterator rebit ;
for ( rebit = event_list.begin() ; rebit != event_list.end() ; rebit++ ) { for ( rebit = event_list.begin() ; rebit != event_list.end() ; ++rebit ) {
if ( debug ) { if ( debug ) {
message_publish(MSG_DEBUG, "Executing RTI: %s = %s\n", message_publish(MSG_DEBUG, "Executing RTI: %s = %s\n",
(*rebit)->ref->reference , (*rebit)->print_val().c_str() ); (*rebit)->ref->reference , (*rebit)->print_val().c_str() );
@ -20,7 +20,7 @@ void Trick::RtiList::execute( bool debug ) {
void Trick::RtiList::print_list() { void Trick::RtiList::print_list() {
std::vector<RtiEventBase * >::iterator rebit ; std::vector<RtiEventBase * >::iterator rebit ;
for ( rebit = event_list.begin() ; rebit != event_list.end() ; rebit++ ) { for ( rebit = event_list.begin() ; rebit != event_list.end() ; ++rebit ) {
(*rebit)->print_rti() ; (*rebit)->print_rti() ;
} }
} }

View File

@ -76,7 +76,7 @@ int Trick::RtiStager::List () {
int Trick::RtiStager::SetDebug( bool on_off ) { int Trick::RtiStager::SetDebug( bool on_off ) {
debug = on_off ; debug = on_off ;
std::vector < RtiExec * >::iterator reit ; std::vector < RtiExec * >::iterator reit ;
for ( reit = executors.begin() ; reit != executors.end() ; reit++ ) { for ( reit = executors.begin() ; reit != executors.end() ; ++reit ) {
(*reit)->SetDebug(on_off) ; (*reit)->SetDebug(on_off) ;
} }
return 0 ; return 0 ;

View File

@ -60,7 +60,7 @@ void Trick::AttributesMap::print_xml(std::ofstream & sie_out ) {
std::map<std::string, ATTRIBUTES *>::iterator it ; std::map<std::string, ATTRIBUTES *>::iterator it ;
int jj ; int jj ;
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) { for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
ATTRIBUTES * attr = (*it).second ; ATTRIBUTES * attr = (*it).second ;
std::string class_name = (*it).first; std::string class_name = (*it).first;
std::replace(class_name.begin(), class_name.end(), ':', '_'); std::replace(class_name.begin(), class_name.end(), ':', '_');
@ -102,7 +102,7 @@ void Trick::AttributesMap::print_json(std::ofstream & sie_out ) {
std::map<std::string, ATTRIBUTES *>::iterator it ; std::map<std::string, ATTRIBUTES *>::iterator it ;
int jj ; int jj ;
sie_out << " \"classes\": [\n" ; sie_out << " \"classes\": [\n" ;
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) { for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
ATTRIBUTES * attr = (*it).second ; ATTRIBUTES * attr = (*it).second ;
std::string class_name = (*it).first; std::string class_name = (*it).first;
std::replace(class_name.begin(), class_name.end(), ':', '_'); std::replace(class_name.begin(), class_name.end(), ':', '_');

View File

@ -14,7 +14,7 @@ void Trick::EnumAttributesMap::print_xml(std::ofstream & sie_out ) {
std::map<std::string, ENUM_ATTR *>::iterator it ; std::map<std::string, ENUM_ATTR *>::iterator it ;
ENUM_ATTR * enum_attr ; ENUM_ATTR * enum_attr ;
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) { for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
enum_attr = (*it).second ; enum_attr = (*it).second ;
if ( enum_attr != NULL ) { if ( enum_attr != NULL ) {
@ -35,7 +35,7 @@ void Trick::EnumAttributesMap::print_json(std::ofstream & sie_out ) {
std::map<std::string, ENUM_ATTR *>::iterator it ; std::map<std::string, ENUM_ATTR *>::iterator it ;
ENUM_ATTR * enum_attr ; ENUM_ATTR * enum_attr ;
sie_out << " \"enumerations\": [\n" ; sie_out << " \"enumerations\": [\n" ;
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) { for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
enum_attr = (*it).second ; enum_attr = (*it).second ;
if ( enum_attr != NULL ) { if ( enum_attr != NULL ) {

View File

@ -62,7 +62,7 @@ void Trick::Sie::top_level_objects_print(std::ofstream & sie_out) {
Trick::VARIABLE_MAP_ITER vit ; Trick::VARIABLE_MAP_ITER vit ;
int jj ; int jj ;
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) { for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
ALLOC_INFO * alloc_info = (*vit).second ; ALLOC_INFO * alloc_info = (*vit).second ;
if ( alloc_info != NULL ) { if ( alloc_info != NULL ) {
@ -88,7 +88,7 @@ void Trick::Sie::runtime_objects_print(std::fstream & sie_out) {
Trick::VARIABLE_MAP_ITER vit ; Trick::VARIABLE_MAP_ITER vit ;
int jj ; int jj ;
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) { for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
ALLOC_INFO * alloc_info = (*vit).second ; ALLOC_INFO * alloc_info = (*vit).second ;
if ( alloc_info != NULL && alloc_info->alloced_in_memory_init == 0) { if ( alloc_info != NULL && alloc_info->alloced_in_memory_init == 0) {
@ -114,7 +114,7 @@ void Trick::Sie::top_level_objects_json(std::ofstream & sie_out) {
Trick::VARIABLE_MAP_ITER vit ; Trick::VARIABLE_MAP_ITER vit ;
int jj ; int jj ;
sie_out << " \"top_level_objects\": [\n"; sie_out << " \"top_level_objects\": [\n";
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) { for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
ALLOC_INFO * alloc_info = (*vit).second ; ALLOC_INFO * alloc_info = (*vit).second ;
if ( alloc_info != NULL ) { if ( alloc_info != NULL ) {

View File

@ -13,7 +13,7 @@ Trick::SimObject::~SimObject() {
int Trick::SimObject::add_tag( std::string job_tag ) { int Trick::SimObject::add_tag( std::string job_tag ) {
std::vector <Trick::JobData *>::iterator it ; std::vector <Trick::JobData *>::iterator it ;
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) { for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
(*it)->add_tag(job_tag) ; (*it)->add_tag(job_tag) ;
} }
return(0) ; return(0) ;
@ -72,7 +72,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
std::vector <Trick::JobData *>::iterator it ; std::vector <Trick::JobData *>::iterator it ;
// Look for the name // Look for the name
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) { for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
if ( ! (*it)->name.compare(job_name) ) { if ( ! (*it)->name.compare(job_name) ) {
if ( j_instance == 1 ) { if ( j_instance == 1 ) {
return *it ; return *it ;
@ -87,7 +87,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
job_name = name + "." + job_name ; job_name = name + "." + job_name ;
} }
// Look for the job with the sim object name prepended. // Look for the job with the sim object name prepended.
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) { for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
if ( ! (*it)->name.compare(job_name) ) { if ( ! (*it)->name.compare(job_name) ) {
if ( j_instance == 1 ) { if ( j_instance == 1 ) {
return *it ; return *it ;
@ -102,7 +102,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
void Trick::SimObject::enable_all_jobs() { void Trick::SimObject::enable_all_jobs() {
std::vector <Trick::JobData *>::iterator it ; std::vector <Trick::JobData *>::iterator it ;
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) { for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
(*it)->enable() ; (*it)->enable() ;
} }
} }
@ -115,7 +115,7 @@ void Trick::SimObject::enable() {
void Trick::SimObject::disable_all_jobs() { void Trick::SimObject::disable_all_jobs() {
std::vector <Trick::JobData *>::iterator it ; std::vector <Trick::JobData *>::iterator it ;
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) { for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
(*it)->disable() ; (*it)->disable() ;
} }
} }

View File

@ -73,7 +73,7 @@ std::string map_trick_units_to_udunits( std::string orig_units ) {
std::vector<std::string> tokens ; std::vector<std::string> tokens ;
std::vector<std::string>::iterator it ; std::vector<std::string>::iterator it ;
tokenize_units(orig_units, tokens, "*/^()") ; tokenize_units(orig_units, tokens, "*/^()") ;
for( it = tokens.begin() ; it != tokens.end() ; it++ ) { for( it = tokens.begin() ; it != tokens.end() ; ++it ) {
char last_char = *((*it).rbegin()) ; char last_char = *((*it).rbegin()) ;
// tokens can end in powers of 2 or 3 in the old system. // tokens can end in powers of 2 or 3 in the old system.
// save the power if it is the last character // save the power if it is the last character

View File

@ -47,7 +47,7 @@ int Trick::TestSuite::add_test_requirements(std::string test_case , std::string
void Trick::TestSuite::delete_test_results() { void Trick::TestSuite::delete_test_results() {
std::vector <Trick::TestCase *>::iterator it ; std::vector <Trick::TestCase *>::iterator it ;
for ( it = test_results.begin() ; it != test_results.end() ; it++ ) { for ( it = test_results.begin() ; it != test_results.end() ; ++it ) {
delete (*it) ; delete (*it) ;
} }
test_results.clear() ; test_results.clear() ;
@ -63,7 +63,7 @@ Trick::UnitTest::UnitTest() {
Trick::UnitTest::~UnitTest() { Trick::UnitTest::~UnitTest() {
std::map< std::string , TestSuite >::iterator it ; std::map< std::string , TestSuite >::iterator it ;
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) { for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
(it->second).delete_test_results() ; (it->second).delete_test_results() ;
} }
} }
@ -121,7 +121,7 @@ int Trick::UnitTest::write_output() {
unsigned int jj ; unsigned int jj ;
if ( enabled ) { if ( enabled ) {
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) { for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
curr_suite = &(it->second) ; curr_suite = &(it->second) ;
num_tests += curr_suite->test_results.size() ; num_tests += curr_suite->test_results.size() ;
num_failures += curr_suite->num_failures ; num_failures += curr_suite->num_failures ;
@ -133,7 +133,7 @@ int Trick::UnitTest::write_output() {
out << "<testsuites tests=\"" << num_tests << "\" failures=\"" << num_failures << out << "<testsuites tests=\"" << num_tests << "\" failures=\"" << num_failures <<
"\" disabled=\"0\" errors=\"0\" time=\"0.0\" name=\"" << name << "\">" << std::endl ; "\" disabled=\"0\" errors=\"0\" time=\"0.0\" name=\"" << name << "\">" << std::endl ;
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) { for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
curr_suite = &(it->second) ; curr_suite = &(it->second) ;
out << " <testsuite name=\"" << it->first << "\" tests=\"" << curr_suite->test_results.size() ; out << " <testsuite name=\"" << it->first << "\" tests=\"" << curr_suite->test_results.size() ;
out << "\" failures=\"" << num_failures << "\" disabled=\"0\" errors=\"0\" time=\"0.0\">" << std::endl ; out << "\" failures=\"" << num_failures << "\" disabled=\"0\" errors=\"0\" time=\"0.0\">" << std::endl ;

View File

@ -21,7 +21,7 @@ Trick::UnitsMap::~UnitsMap() {
std::map<std::string, char * >::iterator pit ; std::map<std::string, char * >::iterator pit ;
for ( pit = param_units.begin() ; pit != param_units.end() ; pit++ ) { for ( pit = param_units.begin() ; pit != param_units.end() ; ++pit ) {
free((*pit).second) ; free((*pit).second) ;
} }
param_units.clear() ; param_units.clear() ;

View File

@ -29,7 +29,7 @@ std::ostream& Trick::operator<< (std::ostream& s, Trick::VariableServer& vs) {
s << "{\"variable_server_connections\":[\n"; s << "{\"variable_server_connections\":[\n";
int count = 0; int count = 0;
int n_connections = (int)vs.var_server_threads.size(); int n_connections = (int)vs.var_server_threads.size();
for ( it = vs.var_server_threads.begin() ; it != vs.var_server_threads.end() ; it++ ) { for ( it = vs.var_server_threads.begin() ; it != vs.var_server_threads.end() ; ++it ) {
s << "{\n"; s << "{\n";
s << *(*it).second; s << *(*it).second;
s << "}"; s << "}";

View File

@ -4,7 +4,7 @@
int Trick::VariableServer::copy_and_write_freeze() { int Trick::VariableServer::copy_and_write_freeze() {
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
(*it).second->copy_and_write_freeze(exec_get_freeze_frame_count()) ; (*it).second->copy_and_write_freeze(exec_get_freeze_frame_count()) ;
} }
pthread_mutex_unlock(&map_mutex) ; pthread_mutex_unlock(&map_mutex) ;

View File

@ -10,7 +10,7 @@ int Trick::VariableServer::copy_and_write_freeze_scheduled() {
long long next_call_tics = TRICK_MAX_LONG_LONG ; long long next_call_tics = TRICK_MAX_LONG_LONG ;
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
VariableServerSession * session = (*it).second ; VariableServerSession * session = (*it).second ;
session->copy_and_write_freeze_scheduled(copy_and_write_freeze_job->next_tics) ; session->copy_and_write_freeze_scheduled(copy_and_write_freeze_job->next_tics) ;
if ( session->get_freeze_next_tics() < next_call_tics ) { if ( session->get_freeze_next_tics() < next_call_tics ) {

View File

@ -10,7 +10,7 @@ int Trick::VariableServer::copy_and_write_scheduled() {
long long next_call_tics = TRICK_MAX_LONG_LONG; long long next_call_tics = TRICK_MAX_LONG_LONG;
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
VariableServerSession * session = (*it).second ; VariableServerSession * session = (*it).second ;
session->copy_and_write_scheduled(copy_data_job->next_tics) ; session->copy_and_write_scheduled(copy_data_job->next_tics) ;
if ( session->get_next_tics() < next_call_tics ) { if ( session->get_next_tics() < next_call_tics ) {

View File

@ -4,7 +4,7 @@
int Trick::VariableServer::copy_and_write_top() { int Trick::VariableServer::copy_and_write_top() {
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
(*it).second->copy_and_write_top(exec_get_frame_count()) ; (*it).second->copy_and_write_top(exec_get_frame_count()) ;
} }
pthread_mutex_unlock(&map_mutex) ; pthread_mutex_unlock(&map_mutex) ;

View File

@ -12,7 +12,7 @@ int Trick::VariableServer::freeze_init() {
long long next_call_tics = TRICK_MAX_LONG_LONG ; long long next_call_tics = TRICK_MAX_LONG_LONG ;
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
VariableServerSession * session = (*it).second ; VariableServerSession * session = (*it).second ;
session->freeze_init() ; session->freeze_init() ;
if ( session->get_freeze_next_tics() < next_call_tics ) { if ( session->get_freeze_next_tics() < next_call_tics ) {

View File

@ -9,7 +9,7 @@ int Trick::VariableServer::get_next_freeze_call_time() {
long long next_call_tics = TRICK_MAX_LONG_LONG; long long next_call_tics = TRICK_MAX_LONG_LONG;
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
VariableServerSession * session = (*it).second ; VariableServerSession * session = (*it).second ;
if ( session->get_freeze_next_tics() < next_call_tics ) { if ( session->get_freeze_next_tics() < next_call_tics ) {
next_call_tics = session->get_freeze_next_tics() ; next_call_tics = session->get_freeze_next_tics() ;

View File

@ -9,7 +9,7 @@ int Trick::VariableServer::get_next_sync_call_time() {
long long next_call_tics = TRICK_MAX_LONG_LONG ; long long next_call_tics = TRICK_MAX_LONG_LONG ;
pthread_mutex_lock(&map_mutex) ; pthread_mutex_lock(&map_mutex) ;
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) { for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
VariableServerSession * session = (*it).second ; VariableServerSession * session = (*it).second ;
if ( session->get_next_tics() < next_call_tics ) { if ( session->get_next_tics() < next_call_tics ) {
next_call_tics = session->get_next_tics() ; next_call_tics = session->get_next_tics() ;

View File

@ -27,7 +27,7 @@ Trick::PrimitiveAttributesMap::PrimitiveAttributesMap() {
Trick::PrimitiveAttributesMap::~PrimitiveAttributesMap() { Trick::PrimitiveAttributesMap::~PrimitiveAttributesMap() {
std::map<std::string, ATTRIBUTES * >::iterator pit ; std::map<std::string, ATTRIBUTES * >::iterator pit ;
for ( pit = param_attr.begin() ; pit != param_attr.end() ; pit++ ) { for ( pit = param_attr.begin() ; pit != param_attr.end() ; ++pit ) {
delete(pit->second) ; delete(pit->second) ;
} }
param_attr.clear() ; param_attr.clear() ;

View File

@ -60,7 +60,7 @@ void VariableServerSession::sendMessage() {
ss << " \"time\" : " << std::setprecision(16) << stageTime << ",\n"; ss << " \"time\" : " << std::setprecision(16) << stageTime << ",\n";
ss << " \"values\" : [\n"; ss << " \"values\" : [\n";
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) { for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
if (it != sessionVariables.begin()) ss << ",\n"; if (it != sessionVariables.begin()) ss << ",\n";
(*it)->writeValue(ss); (*it)->writeValue(ss);
} }
@ -83,7 +83,7 @@ int VariableServerSession::handleMessage(const std::string& client_msg) {
std::string pycode; std::string pycode;
int period; int period;
for (it = members.begin(); it != members.end(); it++ ) { for (it = members.begin(); it != members.end(); ++it ) {
if (strcmp((*it)->key, "cmd") == 0) { if (strcmp((*it)->key, "cmd") == 0) {
cmd = (*it)->valText; cmd = (*it)->valText;
} else if (strcmp((*it)->key, "var_name") == 0) { } else if (strcmp((*it)->key, "var_name") == 0) {
@ -172,7 +172,7 @@ void VariableServerSession::addVariable(char* vname){
void VariableServerSession::stageValues() { void VariableServerSession::stageValues() {
stageTime = (double)(exec_get_time_tics()) / exec_get_time_tic_value(); stageTime = (double)(exec_get_time_tics()) / exec_get_time_tic_value();
std::vector<VariableServerVariable*>::iterator it; std::vector<VariableServerVariable*>::iterator it;
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) { for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
(*it)->stageValue(); (*it)->stageValue();
} }
dataStaged = true; dataStaged = true;
@ -251,7 +251,7 @@ int VariableServerSession::sendUnitsMessage(const char* vname) {
std::vector<VariableServerVariable*>::iterator it; std::vector<VariableServerVariable*>::iterator it;
std::stringstream ss; std::stringstream ss;
ss << "{ \"msg_type\": \"units\", \"var_name\": \"" << vname << "\", \"data\": \""; ss << "{ \"msg_type\": \"units\", \"var_name\": \"" << vname << "\", \"data\": \"";
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) { for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
if(!strcmp((*it)->getName(), vname)) { if(!strcmp((*it)->getName(), vname)) {
ss << ( ss << (
( (