[rtems-tools commit] TargetFactory.cc: Convert to C++
Joel Sherrill
joel at rtems.org
Fri Dec 10 17:42:52 UTC 2021
Module: rtems-tools
Branch: master
Commit: fa95ae2dadc5d5b44e40b7888b9ce3360c3ff401
Changeset: http://git.rtems.org/rtems-tools/commit/?id=fa95ae2dadc5d5b44e40b7888b9ce3360c3ff401
Author: Ryan Long <ryan.long at oarcorp.com>
Date: Wed Sep 29 13:24:30 2021 -0400
TargetFactory.cc: Convert to C++
---
tester/covoar/TargetFactory.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tester/covoar/TargetFactory.cc b/tester/covoar/TargetFactory.cc
index 57ba686..fa72f05 100644
--- a/tester/covoar/TargetFactory.cc
+++ b/tester/covoar/TargetFactory.cc
@@ -37,7 +37,7 @@ namespace Target {
//!
typedef struct {
//! This is the string found in configuration to match.
- const char *theTarget;
+ std::string theTarget;
//! This is the static wrapper for the constructor.
TargetBase *(*theCtor)(
std::string
@@ -76,10 +76,10 @@ namespace Target {
else
cpu = targetName.substr( 0, i );
- // fprintf( stderr, "%s --> %s\n", targetName.c_str(), cpu.c_str());
+ // 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 ( !strcmp(FactoryTable[i].theTarget, cpu.c_str() ) )
+ if ( FactoryTable[i].theTarget == cpu )
return FactoryTable[i].theCtor( targetName );
}
More information about the vc
mailing list