mirror of
https://github.com/minetest/irrlicht.git
synced 2025-01-12 16:27:33 +01:00
Make some local variables in public headers const
Shutting up code analyser. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6392 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
cc9edcb973
commit
d90d1ae93b
@ -186,7 +186,7 @@ namespace scene
|
|||||||
SMD3QuaternionTag* get(const core::stringc& name)
|
SMD3QuaternionTag* get(const core::stringc& name)
|
||||||
{
|
{
|
||||||
SMD3QuaternionTag search ( name );
|
SMD3QuaternionTag search ( name );
|
||||||
s32 index = Container.linear_search ( search );
|
const s32 index = Container.linear_search ( search );
|
||||||
if ( index >= 0 )
|
if ( index >= 0 )
|
||||||
return &Container[index];
|
return &Container[index];
|
||||||
return 0;
|
return 0;
|
||||||
@ -199,7 +199,7 @@ namespace scene
|
|||||||
|
|
||||||
void set_used(u32 new_size)
|
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 )
|
if ( diff > 0 )
|
||||||
{
|
{
|
||||||
SMD3QuaternionTag e("");
|
SMD3QuaternionTag e("");
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
{
|
{
|
||||||
const core::rect<s32>& r2 = Parent->getAbsolutePosition();
|
const core::rect<s32>& 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)
|
if (AlignLeft == EGUIA_SCALE)
|
||||||
ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width;
|
ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width;
|
||||||
@ -194,9 +194,8 @@ public:
|
|||||||
|
|
||||||
if (Parent)
|
if (Parent)
|
||||||
{
|
{
|
||||||
core::rect<s32> r(Parent->getAbsolutePosition());
|
const core::rect<s32> r(Parent->getAbsolutePosition());
|
||||||
|
const core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height);
|
||||||
core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height);
|
|
||||||
|
|
||||||
if (AlignLeft == EGUIA_SCALE)
|
if (AlignLeft == EGUIA_SCALE)
|
||||||
ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width;
|
ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width;
|
||||||
|
@ -293,8 +293,8 @@ void IProfiler::stop(s32 id)
|
|||||||
{
|
{
|
||||||
if ( Timer )
|
if ( Timer )
|
||||||
{
|
{
|
||||||
u32 timeNow = Timer->getRealTime();
|
const u32 timeNow = Timer->getRealTime();
|
||||||
s32 idx = ProfileDatas.binary_search(SProfileData(id));
|
const s32 idx = ProfileDatas.binary_search(SProfileData(id));
|
||||||
if ( idx >= 0 )
|
if ( idx >= 0 )
|
||||||
{
|
{
|
||||||
SProfileData &data = ProfileDatas[idx];
|
SProfileData &data = ProfileDatas[idx];
|
||||||
@ -303,7 +303,7 @@ void IProfiler::stop(s32 id)
|
|||||||
{
|
{
|
||||||
// update data for this id
|
// update data for this id
|
||||||
++data.CountCalls;
|
++data.CountCalls;
|
||||||
u32 diffTime = timeNow - data.LastTimeStarted;
|
const u32 diffTime = timeNow - data.LastTimeStarted;
|
||||||
data.TimeSum += diffTime;
|
data.TimeSum += diffTime;
|
||||||
if ( diffTime > data.LongestTime )
|
if ( diffTime > data.LongestTime )
|
||||||
data.LongestTime = diffTime;
|
data.LongestTime = diffTime;
|
||||||
@ -336,7 +336,7 @@ s32 IProfiler::add(const core::stringw &name, const core::stringw &groupName)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s32 id = NextAutoId;
|
const s32 id = NextAutoId;
|
||||||
--NextAutoId;
|
--NextAutoId;
|
||||||
add( id, name, groupName );
|
add( id, name, groupName );
|
||||||
return id;
|
return id;
|
||||||
@ -400,7 +400,7 @@ bool IProfiler::findDataIndex(u32 & result, const core::stringw &name) const
|
|||||||
const SProfileData* IProfiler::getProfileDataById(u32 id)
|
const SProfileData* IProfiler::getProfileDataById(u32 id)
|
||||||
{
|
{
|
||||||
SProfileData data(id);
|
SProfileData data(id);
|
||||||
s32 idx = ProfileDatas.binary_search(data);
|
const s32 idx = ProfileDatas.binary_search(data);
|
||||||
if ( idx >= 0 )
|
if ( idx >= 0 )
|
||||||
return &ProfileDatas[idx];
|
return &ProfileDatas[idx];
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -736,7 +736,7 @@ namespace scene
|
|||||||
IsVisible = in->getAttributeAsBool("Visible", IsVisible);
|
IsVisible = in->getAttributeAsBool("Visible", IsVisible);
|
||||||
if (in->existsAttribute("AutomaticCulling"))
|
if (in->existsAttribute("AutomaticCulling"))
|
||||||
{
|
{
|
||||||
s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
|
const s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
|
||||||
scene::AutomaticCullingNames);
|
scene::AutomaticCullingNames);
|
||||||
if (tmpState != -1)
|
if (tmpState != -1)
|
||||||
AutomaticCullingState = (u32)tmpState;
|
AutomaticCullingState = (u32)tmpState;
|
||||||
|
@ -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
|
//! 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 )
|
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 );
|
dest = source.subString ( 0, endPos < 0 ? source.size () : endPos );
|
||||||
return dest;
|
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
|
//! get the filename extension from a file path
|
||||||
inline io::path& getFileNameExtension ( io::path &dest, const io::path &source )
|
inline io::path& getFileNameExtension ( io::path &dest, const io::path &source )
|
||||||
{
|
{
|
||||||
s32 endPos = source.findLast ( '.' );
|
const s32 endPos = source.findLast ( '.' );
|
||||||
if ( endPos < 0 )
|
if ( endPos < 0 )
|
||||||
dest = "";
|
dest = "";
|
||||||
else
|
else
|
||||||
@ -176,7 +176,7 @@ static inline io::path mergeFilename(const io::path& path, const io::path& filen
|
|||||||
|
|
||||||
if ( !result.empty() )
|
if ( !result.empty() )
|
||||||
{
|
{
|
||||||
fschar_t last = result.lastChar();
|
const fschar_t last = result.lastChar();
|
||||||
if ( last != IRR_TEXT('/') && last != IRR_TEXT('\\') )
|
if ( last != IRR_TEXT('/') && last != IRR_TEXT('\\') )
|
||||||
result += IRR_TEXT('/');
|
result += IRR_TEXT('/');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user