[PATCH rtems-tools 2/6] TargetFactory.cc: Fix formatting
Ryan Long
ryan.long at oarcorp.com
Mon Dec 13 16:09:29 UTC 2021
---
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;
--
1.8.3.1
More information about the devel
mailing list