Skip to content
Snippets Groups Projects
Commit 345058df authored by Markus Frank's avatar Markus Frank
Browse files

Fix warnings

parent 687741d5
No related branches found
No related tags found
No related merge requests found
...@@ -206,10 +206,10 @@ namespace Gaudi { namespace PluginService { ...@@ -206,10 +206,10 @@ namespace Gaudi { namespace PluginService {
class GAUDIPS_API Logger { class GAUDIPS_API Logger {
public: public:
enum Level { Debug=0, Info=1, Warning=2, Error=3 }; enum Level { Debug=0, Info=1, Warning=2, Error=3 };
Logger(Level level = Warning): m_level(level) {} Logger(Level lvl = Warning): m_level(lvl) {}
virtual ~Logger() {} virtual ~Logger() {}
inline Level level() const { return m_level; } inline Level level() const { return m_level; }
inline void setLevel(Level level) { m_level = level; } inline void setLevel(Level lvl) { m_level = lvl; }
inline void info(const std::string& msg) { report(Info, msg); } inline void info(const std::string& msg) { report(Info, msg); }
inline void debug(const std::string& msg) { report(Debug, msg); } inline void debug(const std::string& msg) { report(Debug, msg); }
inline void warning(const std::string& msg) { report(Warning, msg); } inline void warning(const std::string& msg) { report(Warning, msg); }
......
...@@ -188,27 +188,27 @@ namespace Gaudi { namespace PluginService { ...@@ -188,27 +188,27 @@ namespace Gaudi { namespace PluginService {
} }
// read the file // read the file
logger().debug(std::string(" reading ") + name); logger().debug(std::string(" reading ") + name);
std::ifstream factories(fullPath.c_str()); std::ifstream facts(fullPath.c_str());
std::string line; std::string line;
int factoriesCount = 0; int factoriesCount = 0;
int lineCount = 0; int lineCount = 0;
while (!factories.eof()) { while (!facts.eof()) {
++lineCount; ++lineCount;
std::getline(factories, line); std::getline(facts, line);
trim(line); trim(line);
// skip empty lines and lines starting with '#' // skip empty lines and lines starting with '#'
if (line.empty() || line[0] == '#') continue; if (line.empty() || line[0] == '#') continue;
// look for the separator // look for the separator
std::string::size_type pos = line.find(':'); std::string::size_type other_pos = line.find(':');
if (pos == std::string::npos) { if (other_pos == std::string::npos) {
std::ostringstream o; std::ostringstream o;
o << "failed to parse line " << fullPath o << "failed to parse line " << fullPath
<< ':' << lineCount; << ':' << lineCount;
logger().warning(o.str()); logger().warning(o.str());
continue; continue;
} }
const std::string lib(line, 0, pos); const std::string lib(line, 0, other_pos);
const std::string fact(line, pos+1); const std::string fact(line, other_pos+1);
m_factories.insert(std::make_pair(fact, FactoryInfo(lib))); m_factories.insert(std::make_pair(fact, FactoryInfo(lib)));
#ifdef GAUDI_REFLEX_COMPONENT_ALIASES #ifdef GAUDI_REFLEX_COMPONENT_ALIASES
// add an alias for the factory using the Reflex convention // add an alias for the factory using the Reflex convention
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment