From fa95ae2dadc5d5b44e40b7888b9ce3360c3ff401 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Wed, 29 Sep 2021 13:24:30 -0400 Subject: TargetFactory.cc: Convert to C++ --- tester/covoar/TargetFactory.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tester') 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 ); } -- cgit v1.2.3