From 844ae748f2efdef06e7543dc1046b9d430f0e023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 20 May 2010 12:52:39 +0000 Subject: [PATCH] No warning on missing datatype when adding new type git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9355 383ad7c9-94d9-4d36-a494-682f7c89f535 --- common/Types.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/Types.cc b/common/Types.cc index a21fad80..2a47b284 100644 --- a/common/Types.cc +++ b/common/Types.cc @@ -149,7 +149,9 @@ void initializeTypes() { /// Adds a datatype and returns the id for the new type DataType addDataType(QString _name, QString _readableName) { - if ( typeId(_name) != DATA_UNKNOWN ) { + // Check if datatype already exists. + // If so, we return the typeId that is used for it + if ( stringToTypeInfo.find( _name ) != stringToTypeInfo.end() ) { std::cerr << "Redefinition of existing data type!" << std::endl; return typeId(_name); } @@ -174,9 +176,7 @@ DataType typeId(QString _name) { if ( index != stringToTypeInfo.end() ) return types[ index->second ].type; else { - #ifdef DEBUG - std::cerr << "Unknown Data type with name " << _name.toStdString() << std::endl; - #endif + std::cerr << "Unknown Data type with name " << _name.toStdString() << std::endl; return DATA_UNKNOWN; } } -- GitLab