[Orxonox-commit 2918] r7621 - in code/branches/ois_update/src: . libraries/core libraries/core/input libraries/tools libraries/util
rgrieder at orxonox.net
rgrieder at orxonox.net
Sat Nov 6 15:05:53 CET 2010
Author: rgrieder
Date: 2010-11-06 15:05:53 +0100 (Sat, 06 Nov 2010)
New Revision: 7621
Modified:
code/branches/ois_update/src/OrxonoxConfig.h.in
code/branches/ois_update/src/libraries/core/Identifier.h
code/branches/ois_update/src/libraries/core/OrxonoxClass.h
code/branches/ois_update/src/libraries/core/input/InputDevice.h
code/branches/ois_update/src/libraries/core/input/InputState.h
code/branches/ois_update/src/libraries/tools/BulletConversions.h
code/branches/ois_update/src/libraries/util/Convert.h
code/branches/ois_update/src/libraries/util/MathConvert.h
code/branches/ois_update/src/libraries/util/SharedPtr.h
Log:
Renamed FORCEINLINE macro to ORX_FORCEINLINE because of conflicts (resulting in a load of warnings with Ogre v1.7 and gcc) with OgrePlatform.h.
Modified: code/branches/ois_update/src/OrxonoxConfig.h.in
===================================================================
--- code/branches/ois_update/src/OrxonoxConfig.h.in 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/OrxonoxConfig.h.in 2010-11-06 14:05:53 UTC (rev 7621)
@@ -87,11 +87,11 @@
// See if we can use __forceinline or if we need to use __inline instead
#cmakedefine HAVE_FORCEINLINE
-#ifndef FORCEINLINE
+#ifndef ORX_FORCEINLINE
# ifdef HAVE_FORCEINLINE
-# define FORCEINLINE __forceinline
+# define ORX_FORCEINLINE __forceinline
# else
-# define FORCEINLINE __inline
+# define ORX_FORCEINLINE __inline
# endif
#endif
Modified: code/branches/ois_update/src/libraries/core/Identifier.h
===================================================================
--- code/branches/ois_update/src/libraries/core/Identifier.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/core/Identifier.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -122,7 +122,7 @@
void setNetworkID(uint32_t id);
/// Returns the unique ID of the class.
- FORCEINLINE unsigned int getClassID() const { return this->classID_; }
+ ORX_FORCEINLINE unsigned int getClassID() const { return this->classID_; }
/// Returns the list of all existing objects of this class.
inline ObjectListBase* getObjects() const { return this->objects_; }
@@ -485,7 +485,7 @@
Also note that the function is implemented differently for GCC/MSVC.
*/
template <class T, class U>
- FORCEINLINE T orxonox_cast(U* source)
+ ORX_FORCEINLINE T orxonox_cast(U* source)
{
#ifdef ORXONOX_COMPILER_MSVC
typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType;
Modified: code/branches/ois_update/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/ois_update/src/libraries/core/OrxonoxClass.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/core/OrxonoxClass.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -135,7 +135,7 @@
@return
Returns NULL if the no pointer was found.
*/
- FORCEINLINE void* getDerivedPointer(unsigned int classID)
+ ORX_FORCEINLINE void* getDerivedPointer(unsigned int classID)
{
for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
{
@@ -146,10 +146,10 @@
}
/// Version of getDerivedPointer with template
- template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
+ template <class T> ORX_FORCEINLINE T* getDerivedPointer(unsigned int classID)
{ return static_cast<T*>(this->getDerivedPointer(classID)); }
/// Const version of getDerivedPointer with template
- template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
+ template <class T> ORX_FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
{ return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); }
protected:
Modified: code/branches/ois_update/src/libraries/core/input/InputDevice.h
===================================================================
--- code/branches/ois_update/src/libraries/core/input/InputDevice.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/core/input/InputDevice.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -183,7 +183,7 @@
protected:
//! Common code for all button pressed events (updates pressed buttons list and calls the input states)
- FORCEINLINE void buttonPressed(ButtonTypeParam button)
+ ORX_FORCEINLINE void buttonPressed(ButtonTypeParam button)
{
// check whether the button already is in the list (can happen when focus was lost)
unsigned int iButton = 0;
@@ -200,7 +200,7 @@
}
//! Common code for all button released events (updates pressed buttons list and calls the input states)
- FORCEINLINE void buttonReleased(ButtonTypeParam button)
+ ORX_FORCEINLINE void buttonReleased(ButtonTypeParam button)
{
// remove the button from the pressedButtons_ list
bool found = false;
Modified: code/branches/ois_update/src/libraries/core/input/InputState.h
===================================================================
--- code/branches/ois_update/src/libraries/core/input/InputState.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/core/input/InputState.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -175,14 +175,14 @@
FunctorPtr leaveFunctor_; //!< Functor to be executed on leave
};
- FORCEINLINE void InputState::update(float dt)
+ ORX_FORCEINLINE void InputState::update(float dt)
{
for (unsigned int i = 0; i < handlers_.size(); ++i)
if (handlers_[i] != NULL)
INPUT_STATE_PUSH_CALL(i, allDevicesUpdated, dt);
}
- FORCEINLINE void InputState::update(float dt, unsigned int device)
+ ORX_FORCEINLINE void InputState::update(float dt, unsigned int device)
{
switch (device)
{
@@ -204,7 +204,7 @@
}
template <typename EventType, class ButtonTypeParam>
- FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
+ ORX_FORCEINLINE void InputState::buttonEvent(unsigned int device, ButtonTypeParam button)
{
assert(device < handlers_.size());
if (handlers_[device] != NULL)
@@ -215,19 +215,19 @@
}
}
- FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
+ ORX_FORCEINLINE void InputState::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
{
if (handlers_[mouseIndex_s] != NULL)
INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseMoved, abs, rel, clippingSize);
}
- FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
+ ORX_FORCEINLINE void InputState::mouseScrolled(int abs, int rel)
{
if (handlers_[mouseIndex_s] != NULL)
INPUT_STATE_PUSH_CALL(mouseIndex_s, mouseScrolled, abs, rel);
}
- FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
+ ORX_FORCEINLINE void InputState::joyStickAxisMoved(unsigned int device, unsigned int axis, float value)
{
assert(device < handlers_.size());
if (handlers_[device] != NULL)
Modified: code/branches/ois_update/src/libraries/tools/BulletConversions.h
===================================================================
--- code/branches/ois_update/src/libraries/tools/BulletConversions.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/tools/BulletConversions.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -42,7 +42,7 @@
template <>
struct ConverterExplicit<orxonox::Vector3, btVector3>
{
- FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
+ ORX_FORCEINLINE static bool convert(btVector3* output, const orxonox::Vector3& input)
{
output->setX(input.x);
output->setY(input.y);
@@ -55,7 +55,7 @@
template <>
struct ConverterExplicit<btVector3, orxonox::Vector3>
{
- FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Vector3* output, const btVector3& input)
{
output->x = input.x();
output->y = input.y();
@@ -68,7 +68,7 @@
template <>
struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
{
- FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
+ ORX_FORCEINLINE static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
{
output->setW(input.w);
output->setX(input.x);
@@ -82,7 +82,7 @@
template <>
struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
{
- FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
{
output->w = input.w();
output->x = input.x();
Modified: code/branches/ois_update/src/libraries/util/Convert.h
===================================================================
--- code/branches/ois_update/src/libraries/util/Convert.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/util/Convert.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -142,7 +142,7 @@
template <class FromType, class ToType>
struct ConverterFallback
{
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
COUT(2) << "Could not convert value of type " << typeid(FromType).name()
<< " to type " << typeid(ToType).name() << std::endl;
@@ -154,7 +154,7 @@
template <class FromType, class ToType>
struct ConverterFallback<FromType*, ToType*>
{
- FORCEINLINE static bool convert(ToType** output, FromType* const input)
+ ORX_FORCEINLINE static bool convert(ToType** output, FromType* const input)
{
ToType* temp = dynamic_cast<ToType*>(input);
if (temp)
@@ -181,7 +181,7 @@
template <class FromType, class ToType>
struct ConverterStringStream
{
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
}
@@ -197,7 +197,7 @@
{
/// Fallback operator <<() (delegates to orxonox::ConverterFallback)
template <class FromType>
- FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input)
+ ORX_FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input)
{
std::string temp;
if (orxonox::ConverterFallback<FromType, std::string>::convert(&temp, input))
@@ -214,7 +214,7 @@
template <class FromType>
struct ConverterStringStream<FromType, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const FromType& input)
{
using namespace fallbackTemplates;
// this operator call only chooses fallbackTemplates::operator<<()
@@ -240,7 +240,7 @@
{
/// Fallback operator >>() (delegates to orxonox::ConverterFallback)
template <class ToType>
- FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
+ ORX_FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
{
std::string input(static_cast<std::istringstream&>(instream).str());
return orxonox::ConverterFallback<std::string, ToType>::convert(&output, input);
@@ -251,7 +251,7 @@
template <class ToType>
struct ConverterStringStream<std::string, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const std::string& input)
{
using namespace fallbackTemplates;
// this operator call chooses fallbackTemplates::operator>>()
@@ -275,14 +275,14 @@
/// %Template delegates to ::ConverterStringStream
template <class FromType, class ToType>
- FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
+ ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)
{
return ConverterStringStream<FromType, ToType>::convert(output, input);
}
/// Makes an implicit cast from \a FromType to \a ToType
template <class FromType, class ToType>
- FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
+ ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)
{
(*output) = static_cast<ToType>(input);
return true;
@@ -302,7 +302,7 @@
struct ConverterExplicit
{
enum { probe = ImplicitConversion<FromType, ToType>::exists };
- FORCEINLINE static bool convert(ToType* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input)
{
// Use the probe's value to delegate to the right function
return convertImplicitely(output, input, Loki::Int2Type<probe>());
@@ -326,7 +326,7 @@
The original value
*/
template <class FromType, class ToType>
- FORCEINLINE bool convertValue(ToType* output, const FromType& input)
+ ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input)
{
return ConverterExplicit<FromType, ToType>::convert(output, input);
}
@@ -347,7 +347,7 @@
A default value that gets written to '*output' if there is no conversion.
*/
template<class FromType, class ToType>
- FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
+ ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
{
if (convertValue(output, input))
return true;
@@ -360,7 +360,7 @@
/// Directly returns the converted value, but uses the fallback on failure. @see convertValue
template<class FromType, class ToType>
- FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
+ ORX_FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
{
ToType output;
convertValue(&output, input, fallback);
@@ -379,7 +379,7 @@
The original value
*/
template<class ToType, class FromType>
- FORCEINLINE ToType multi_cast(const FromType& input)
+ ORX_FORCEINLINE ToType multi_cast(const FromType& input)
{
ToType output;
convertValue(&output, input);
@@ -394,7 +394,7 @@
template <class ToType>
struct ConverterExplicit<const char*, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const char* input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const char* input)
{
return convertValue<std::string, ToType>(output, input);
}
@@ -404,7 +404,7 @@
template <>
struct ConverterExplicit<char, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const char input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const char input)
{
*output = input;
return true;
@@ -414,7 +414,7 @@
template <>
struct ConverterExplicit<unsigned char, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const unsigned char input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const unsigned char input)
{
*output = input;
return true;
@@ -424,7 +424,7 @@
template <>
struct ConverterExplicit<std::string, char>
{
- FORCEINLINE static bool convert(char* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(char* output, const std::string& input)
{
if (!input.empty())
*output = input[0];
@@ -437,7 +437,7 @@
template <>
struct ConverterExplicit<std::string, unsigned char>
{
- FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
+ ORX_FORCEINLINE static bool convert(unsigned char* output, const std::string& input)
{
if (!input.empty())
*output = input[0];
@@ -452,7 +452,7 @@
template <>
struct ConverterExplicit<bool, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const bool& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const bool& input)
{
if (input)
*output = "true";
Modified: code/branches/ois_update/src/libraries/util/MathConvert.h
===================================================================
--- code/branches/ois_update/src/libraries/util/MathConvert.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/util/MathConvert.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -50,7 +50,7 @@
template <>
struct ConverterExplicit<orxonox::Vector2, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y)
@@ -66,7 +66,7 @@
template <>
struct ConverterExplicit<orxonox::Vector3, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y << ',' << input.z)
@@ -82,7 +82,7 @@
template <>
struct ConverterExplicit<orxonox::Vector4, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
{
std::ostringstream ostream;
if (ostream << input.x << ',' << input.y << ',' << input.z << ',' << input.w)
@@ -98,7 +98,7 @@
template <>
struct ConverterExplicit<orxonox::Quaternion, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
{
std::ostringstream ostream;
if (ostream << input.w << ',' << input.x << ',' << input.y << ',' << input.z)
@@ -114,7 +114,7 @@
template <>
struct ConverterExplicit<orxonox::ColourValue, std::string>
{
- FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
+ ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
{
std::ostringstream ostream;
if (ostream << input.r << ',' << input.g << ',' << input.b << ',' << input.a)
@@ -156,7 +156,7 @@
template <class ToType>
struct ConverterFallback<orxonox::Radian, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
{
return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
}
@@ -166,7 +166,7 @@
template <class ToType>
struct ConverterFallback<orxonox::Degree, ToType>
{
- FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
+ ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
{
return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
}
@@ -176,7 +176,7 @@
template <class FromType>
struct ConverterFallback<FromType, orxonox::Radian>
{
- FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
{
float temp;
if (convertValue(&temp, input))
@@ -193,7 +193,7 @@
template <class FromType>
struct ConverterFallback<FromType, orxonox::Degree>
{
- FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
+ ORX_FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
{
float temp;
if (convertValue(&temp, input))
Modified: code/branches/ois_update/src/libraries/util/SharedPtr.h
===================================================================
--- code/branches/ois_update/src/libraries/util/SharedPtr.h 2010-11-06 13:36:11 UTC (rev 7620)
+++ code/branches/ois_update/src/libraries/util/SharedPtr.h 2010-11-06 14:05:53 UTC (rev 7621)
@@ -186,7 +186,7 @@
_UtilExport SmallObjectAllocator& createSharedCounterPool();
- FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
+ ORX_FORCEINLINE SmallObjectAllocator& getSharedCounterPool()
{
static SmallObjectAllocator& instance = createSharedCounterPool();
return instance;
More information about the Orxonox-commit
mailing list