From 877d83b57e2e6983484f74970e26ae150f14c283 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 29 Sep 2021 13:39:56 -0400 Subject: TargetFactory.cc: Fix formatting --- tester/covoar/TargetFactory.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tester/covoar/TargetFactory.cc b/tester/covoar/TargetFactory.cc index fa72f05..0b6be52 100644 --- a/tester/covoar/TargetFactory.cc +++ b/tester/covoar/TargetFactory.cc @@ -39,9 +39,7 @@ namespace Target { //! This is the string found in configuration to match. std::string theTarget; //! This is the static wrapper for the constructor. - TargetBase *(*theCtor)( - std::string - ); + TargetBase *(*theCtor)( std::string ); } FactoryEntry_t; //! @@ -60,27 +58,27 @@ namespace Target { { "powerpc", Target_powerpc_Constructor }, { "sparc", Target_sparc_Constructor }, { "riscv", Target_riscv_Constructor }, - { "TBD", NULL }, + { "TBD", NULL } }; - TargetBase* TargetFactory( - std::string targetName - ) + TargetBase* TargetFactory( std::string targetName ) { size_t i; std::string cpu; i = targetName.find( '-' ); - if ( i == targetName.npos ) + if ( i == targetName.npos ) { cpu = targetName; - else + } else { cpu = targetName.substr( 0, i ); + } // std::cerr << targetName << " --> " << cpu << std::endl; // Iterate over the table trying to find an entry with a matching name - for ( i=0 ; i < sizeof(FactoryTable) / sizeof(FactoryEntry_t); i++ ) { - if ( FactoryTable[i].theTarget == cpu ) + for ( i = 0 ; i < sizeof( FactoryTable ) / sizeof( FactoryEntry_t ); i++) { + if ( FactoryTable[i].theTarget == cpu ) { return FactoryTable[i].theCtor( targetName ); + } } std::ostringstream what; -- cgit v1.2.3