[Orxonox-commit 2560] r7265 - in code/branches/consolecommands3/src/libraries: core/command util

landauf at orxonox.net landauf at orxonox.net
Mon Aug 30 13:19:11 CEST 2010


Author: landauf
Date: 2010-08-30 13:19:11 +0200 (Mon, 30 Aug 2010)
New Revision: 7265

Modified:
   code/branches/consolecommands3/src/libraries/core/command/Executor.cc
   code/branches/consolecommands3/src/libraries/util/MultiType.h
Log:
added a missing TypeTrait in MultiType which caused problems on some compilers with explicit conversion


Modified: code/branches/consolecommands3/src/libraries/core/command/Executor.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/Executor.cc	2010-08-29 19:37:38 UTC (rev 7264)
+++ code/branches/consolecommands3/src/libraries/core/command/Executor.cc	2010-08-30 11:19:11 UTC (rev 7265)
@@ -66,6 +66,8 @@
             return MT_Type::Null;
         }
 
+        COUT(5) << "Executor::parse: \"" << arguments.join(delimiter) << "\" -> " << paramCount << " params: " << param[0] << " / " << param[1] << " / " << param[2] << " / " << param[3] << " / " << param[4] << std::endl;
+
         switch (paramCount)
         {
             case 0:  return (*this->functor_)();
@@ -95,7 +97,7 @@
         }
 
         // assign all given arguments to the multitypes
-        for (unsigned int i = 0; i < std::min(argumentCount, MAX_FUNCTOR_ARGUMENTS); i++)
+        for (unsigned int i = 0; i < std::min(std::min(argumentCount, paramCount), MAX_FUNCTOR_ARGUMENTS); i++)
             param[i] = arguments[i];
 
         // fill the remaining multitypes with default values

Modified: code/branches/consolecommands3/src/libraries/util/MultiType.h
===================================================================
--- code/branches/consolecommands3/src/libraries/util/MultiType.h	2010-08-29 19:37:38 UTC (rev 7264)
+++ code/branches/consolecommands3/src/libraries/util/MultiType.h	2010-08-30 11:19:11 UTC (rev 7265)
@@ -320,7 +320,7 @@
             /** @brief Copies the other MultiType by assigning value and type. */
             inline void                       copy(const MultiType& other)    { if (this == &other) { return; } if (this->value_) { delete this->value_; } this->value_ = (other.value_) ? other.value_->clone() : 0; }
 
-            template <typename T> inline bool convert()                       { return this->setValue<T>((T)(*this));  } /** @brief Converts the current value to type T. */
+            template <typename T> inline bool convert()                       { return this->setValue<T>((typename Loki::TypeTraits<T>::UnqualifiedReferredType)(*this));  } /** @brief Converts the current value to type T. */
             inline bool                       convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
             bool                              convert(MT_Type::Value type);
 




More information about the Orxonox-commit mailing list