Commit e409667c authored by hybrid's avatar hybrid

Fixed some warnings and minor coding things.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1084 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7e0bcfcf
...@@ -560,7 +560,7 @@ namespace quake3 ...@@ -560,7 +560,7 @@ namespace quake3
for ( u32 i = 0; i != size; ++i ) for ( u32 i = 0; i != size; ++i )
{ {
group = &shader->VarGroup->VariableGroup[ i ]; group = &shader->VarGroup->VariableGroup[ i ];
dumpVarGroup ( dest, group, core::clamp ( (s32) i, 0, 2 ) ); dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) );
} }
if ( size <= 1 ) if ( size <= 1 )
......
...@@ -167,7 +167,7 @@ namespace video ...@@ -167,7 +167,7 @@ namespace video
//! Class representing a 32 bit ARGB color. //! Class representing a 32 bit ARGB color.
/** The color values for alpha, red, green, and blue are /** The color values for alpha, red, green, and blue are
stored in a single s32. So all four values may be between 0 and 255. stored in a single u32. So all four values may be between 0 and 255.
This class is used by most parts of the Irrlicht Engine This class is used by most parts of the Irrlicht Engine
to specify a color. Another way is using the class Colorf, which to specify a color. Another way is using the class Colorf, which
stores the color values in 4 floats. stores the color values in 4 floats.
......
...@@ -220,6 +220,11 @@ namespace video ...@@ -220,6 +220,11 @@ namespace video
{ {
if (i<MATERIAL_MAX_TEXTURES) if (i<MATERIAL_MAX_TEXTURES)
return TextureLayer[i].getTextureMatrix(); return TextureLayer[i].getTextureMatrix();
else // this should not happen
{
_IRR_DEBUG_BREAK_IF(true)
return TextureLayer[0].getTextureMatrix();
}
} }
//! Gets the immutable texture transformation matrix for level i //! Gets the immutable texture transformation matrix for level i
......
...@@ -36,11 +36,8 @@ inline u32 strtol10(const char* in, const char** out=0) ...@@ -36,11 +36,8 @@ inline u32 strtol10(const char* in, const char** out=0)
{ {
u32 value = 0; u32 value = 0;
while ( 1 ) while ( ( *in >= '0') && ( *in <= '9' ))
{ {
if ( *in < '0' || *in > '9' )
break;
value = ( value * 10 ) + ( *in - '0' ); value = ( value * 10 ) + ( *in - '0' );
++in; ++in;
} }
......
...@@ -405,12 +405,12 @@ public: ...@@ -405,12 +405,12 @@ public:
left = m + 1; left = m + 1;
} while((element < data[m] || data[m] < element) && left<=right); } while((element < data[m] || data[m] < element) && left<=right);
// this last line equals to: // this last line equals to:
// " while((element != array[m]) && left<=right);" // " while((element != array[m]) && left<=right);"
// but we only want to use the '<' operator. // but we only want to use the '<' operator.
// the same in next line, it is "(element == array[m])" // the same in next line, it is "(element == array[m])"
if (!(element < data[m]) && !(data[m] < element)) if (!(element < data[m]) && !(data[m] < element))
return m; return m;
......
...@@ -247,7 +247,8 @@ public: ...@@ -247,7 +247,8 @@ public:
//! Typedef for integer 2d vector. //! Typedef for integer 2d vector.
typedef vector2d<s32> vector2di; typedef vector2d<s32> vector2di;
template<class S, class T> vector2d<T> operator*(const S scalar, const vector2d<T>& vector) { return vector*scalar; } template<class S, class T>
vector2d<T> operator*(const S scalar, const vector2d<T>& vector) { return vector*scalar; }
} // end namespace core } // end namespace core
} // end namespace irr } // end namespace irr
......
...@@ -277,7 +277,8 @@ namespace core ...@@ -277,7 +277,8 @@ namespace core
//! Typedef for an integer 3d vector. //! Typedef for an integer 3d vector.
typedef vector3d<s32> vector3di; typedef vector3d<s32> vector3di;
template<class S, class T> vector3d<T> operator*(const S scalar, const vector3d<T>& vector) { return vector*scalar; } template<class S, class T>
vector3d<T> operator*(const S scalar, const vector3d<T>& vector) { return vector*scalar; }
} // end namespace core } // end namespace core
} // end namespace irr } // end namespace irr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment