[rtems-tools commit] TargetFactory.cc: Fix formatting

Joel Sherrill joel at rtems.org
Wed Dec 15 16:35:05 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    877d83b57e2e6983484f74970e26ae150f14c283
Changeset: http://git.rtems.org/rtems-tools/commit/?id=877d83b57e2e6983484f74970e26ae150f14c283

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Wed Sep 29 13:39:56 2021 -0400

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;



More information about the vc mailing list