Commit a5325964 authored by cutealien's avatar cutealien

Do return references local statics instead of references to 0 in error cases...

Do return references local statics instead of references to 0 in error cases (was undefined in c++). 
Thx @floriang for reporting at http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=50877



git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5112 dfc29bdd-3216-0410-991c-e03cc46cb475
parent fbd31749
...@@ -1026,7 +1026,11 @@ const SLight& CNullDriver::getDynamicLight(u32 idx) const ...@@ -1026,7 +1026,11 @@ const SLight& CNullDriver::getDynamicLight(u32 idx) const
if ( idx < Lights.size() ) if ( idx < Lights.size() )
return Lights[idx]; return Lights[idx];
else else
return *((SLight*)0); {
_IRR_DEBUG_BREAK_IF(true)
static const SLight dummy;
return dummy;
}
} }
......
...@@ -1174,10 +1174,10 @@ void CSceneManager::render() ...@@ -1174,10 +1174,10 @@ void CSceneManager::render()
//! returns the axis aligned bounding box of this node //! returns the axis aligned bounding box of this node
const core::aabbox3d<f32>& CSceneManager::getBoundingBox() const const core::aabbox3d<f32>& CSceneManager::getBoundingBox() const
{ {
_IRR_DEBUG_BREAK_IF(true) // Bounding Box of Scene Manager wanted. _IRR_DEBUG_BREAK_IF(true) // Bounding Box of Scene Manager should never be used.
// should never be used. static const core::aabbox3d<f32> dummy;
return *((core::aabbox3d<f32>*)0); return dummy;
} }
...@@ -2549,13 +2549,13 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type) ...@@ -2549,13 +2549,13 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type)
#else #else
return 0; return 0;
#endif #endif
case EMWT_B3D: case EMWT_B3D:
#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ #ifdef _IRR_COMPILE_WITH_B3D_WRITER_
return new CB3DMeshWriter(FileSystem); return new CB3DMeshWriter(FileSystem);
#else #else
return 0; return 0;
#endif #endif
} }
return 0; return 0;
......
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