diff --git a/include/IAnimatedMeshMD3.h b/include/IAnimatedMeshMD3.h index 1e27fbc1..13a42c8f 100644 --- a/include/IAnimatedMeshMD3.h +++ b/include/IAnimatedMeshMD3.h @@ -186,7 +186,7 @@ namespace scene SMD3QuaternionTag* get(const core::stringc& name) { SMD3QuaternionTag search ( name ); - s32 index = Container.linear_search ( search ); + const s32 index = Container.linear_search ( search ); if ( index >= 0 ) return &Container[index]; return 0; @@ -199,7 +199,7 @@ namespace scene void set_used(u32 new_size) { - s32 diff = (s32) new_size - (s32) Container.allocated_size(); + const s32 diff = (s32) new_size - (s32) Container.allocated_size(); if ( diff > 0 ) { SMD3QuaternionTag e(""); diff --git a/include/IGUIElement.h b/include/IGUIElement.h index aa1e8922..9ad61264 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -81,7 +81,7 @@ public: { const core::rect& r2 = Parent->getAbsolutePosition(); - core::dimension2df d((f32)(r2.getSize().Width), (f32)(r2.getSize().Height)); + const core::dimension2df d((f32)(r2.getSize().Width), (f32)(r2.getSize().Height)); if (AlignLeft == EGUIA_SCALE) ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width; @@ -194,9 +194,8 @@ public: if (Parent) { - core::rect r(Parent->getAbsolutePosition()); - - core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height); + const core::rect r(Parent->getAbsolutePosition()); + const core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height); if (AlignLeft == EGUIA_SCALE) ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width; diff --git a/include/IProfiler.h b/include/IProfiler.h index bfc24301..21a5dea4 100644 --- a/include/IProfiler.h +++ b/include/IProfiler.h @@ -293,8 +293,8 @@ void IProfiler::stop(s32 id) { if ( Timer ) { - u32 timeNow = Timer->getRealTime(); - s32 idx = ProfileDatas.binary_search(SProfileData(id)); + const u32 timeNow = Timer->getRealTime(); + const s32 idx = ProfileDatas.binary_search(SProfileData(id)); if ( idx >= 0 ) { SProfileData &data = ProfileDatas[idx]; @@ -303,7 +303,7 @@ void IProfiler::stop(s32 id) { // update data for this id ++data.CountCalls; - u32 diffTime = timeNow - data.LastTimeStarted; + const u32 diffTime = timeNow - data.LastTimeStarted; data.TimeSum += diffTime; if ( diffTime > data.LongestTime ) data.LongestTime = diffTime; @@ -336,7 +336,7 @@ s32 IProfiler::add(const core::stringw &name, const core::stringw &groupName) } else { - s32 id = NextAutoId; + const s32 id = NextAutoId; --NextAutoId; add( id, name, groupName ); return id; @@ -400,7 +400,7 @@ bool IProfiler::findDataIndex(u32 & result, const core::stringw &name) const const SProfileData* IProfiler::getProfileDataById(u32 id) { SProfileData data(id); - s32 idx = ProfileDatas.binary_search(data); + const s32 idx = ProfileDatas.binary_search(data); if ( idx >= 0 ) return &ProfileDatas[idx]; return NULL; diff --git a/include/ISceneNode.h b/include/ISceneNode.h index f26cc8a2..e53d3c60 100644 --- a/include/ISceneNode.h +++ b/include/ISceneNode.h @@ -736,7 +736,7 @@ namespace scene IsVisible = in->getAttributeAsBool("Visible", IsVisible); if (in->existsAttribute("AutomaticCulling")) { - s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling", + const s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling", scene::AutomaticCullingNames); if (tmpState != -1) AutomaticCullingState = (u32)tmpState; diff --git a/include/coreutil.h b/include/coreutil.h index 74e27f15..bf2cb1af 100644 --- a/include/coreutil.h +++ b/include/coreutil.h @@ -47,7 +47,7 @@ inline bool hasFileExtension(const io::path& filename, const io::path& ext0, //! cut the filename extension from a source file path and store it in a dest file path inline io::path& cutFilenameExtension ( io::path &dest, const io::path &source ) { - s32 endPos = source.findLast ( '.' ); + const s32 endPos = source.findLast ( '.' ); dest = source.subString ( 0, endPos < 0 ? source.size () : endPos ); return dest; } @@ -55,7 +55,7 @@ inline io::path& cutFilenameExtension ( io::path &dest, const io::path &source ) //! get the filename extension from a file path inline io::path& getFileNameExtension ( io::path &dest, const io::path &source ) { - s32 endPos = source.findLast ( '.' ); + const s32 endPos = source.findLast ( '.' ); if ( endPos < 0 ) dest = ""; else @@ -176,7 +176,7 @@ static inline io::path mergeFilename(const io::path& path, const io::path& filen if ( !result.empty() ) { - fschar_t last = result.lastChar(); + const fschar_t last = result.lastChar(); if ( last != IRR_TEXT('/') && last != IRR_TEXT('\\') ) result += IRR_TEXT('/'); }