3D: fix issues reported by Coverity scan
*** CID 143752: Incorrect expression (USELESS_CALL) *** CID 143751: Incorrect expression (UNUSED_VALUE) *** CID 143749: Uninitialized members (UNINIT_CTOR) *** CID 143748: Uninitialized members (UNINIT_CTOR) *** CID 143747: Uninitialized members (UNINIT_CTOR) *** CID 143746: Uninitialized members (UNINIT_CTOR) *** CID 143745: Uninitialized members (UNINIT_CTOR) *** CID 143744: Uninitialized members (UNINIT_CTOR) *** CID 143740: Null pointer dereferences (NULL_RETURNS) *** CID 143739: Memory - corruptions (MISMATCHED_ITERATOR) *** CID 143735: Integer handling issues (CONSTANT_EXPRESSION_RESULT) *** CID 143734: Error handling issues (CHECKED_RETURN)
This commit is contained in:
parent
e1b308b3b1
commit
c2a60d14d7
|
@ -175,7 +175,7 @@ bool DLG_SELECT_3DMODEL::TransferDataFromWindow()
|
|||
m_model->rotation.z = 0.0;
|
||||
|
||||
m_model->offset = m_model->rotation;
|
||||
m_model->filename.empty();
|
||||
m_model->filename.clear();
|
||||
|
||||
wxString fname = m_FileTree->GetFilePath();
|
||||
|
||||
|
|
|
@ -133,8 +133,19 @@ void SCENEGRAPH::unlinkNode( const SGNODE* aNode, bool isChild )
|
|||
if( NULL == aNode )
|
||||
return;
|
||||
|
||||
UNLINK_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild );
|
||||
UNLINK_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild );
|
||||
switch( aNode->GetNodeType() )
|
||||
{
|
||||
case S3D::SGTYPE_TRANSFORM:
|
||||
UNLINK_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild );
|
||||
break;
|
||||
|
||||
case S3D::SGTYPE_SHAPE:
|
||||
UNLINK_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
|
|
|
@ -82,8 +82,8 @@ class SGCOORDINDEX;
|
|||
std::vector< aType* >::iterator eL; \
|
||||
if( isChild ) { \
|
||||
oSL = &aOwnedList; \
|
||||
sL = aOwnedList.begin(); \
|
||||
eL = aOwnedList.end(); \
|
||||
sL = oSL->begin(); \
|
||||
eL = oSL->end(); \
|
||||
while( sL != eL ) { \
|
||||
if( (SGNODE*)*sL == aNode ) { \
|
||||
oSL->erase( sL ); \
|
||||
|
@ -93,8 +93,8 @@ class SGCOORDINDEX;
|
|||
} \
|
||||
} else { \
|
||||
oSL = &aRefList; \
|
||||
sL = aRefList.begin(); \
|
||||
eL = aRefList.end(); \
|
||||
sL = oSL->begin(); \
|
||||
eL = oSL->end(); \
|
||||
while( sL != eL ) { \
|
||||
if( (SGNODE*)*sL == aNode ) { \
|
||||
delNodeRef( this ); \
|
||||
|
|
|
@ -91,6 +91,7 @@ C3D_MODEL_VIEWER::C3D_MODEL_VIEWER( wxWindow *aParent,
|
|||
m_reload_is_needed = false;
|
||||
m_ogl_3dmodel = NULL;
|
||||
m_3d_model = NULL;
|
||||
m_BiuTo3Dunits = 1.0;
|
||||
|
||||
// Explicitly create a new rendering context instance for this canvas.
|
||||
m_glRC = new wxGLContext( this );
|
||||
|
|
|
@ -42,6 +42,7 @@ C3D_RENDER_OGL_LEGACY::C3D_RENDER_OGL_LEGACY( CINFO3D_VISU &aSettings,
|
|||
m_ogl_disp_lists_layers.clear();
|
||||
m_triangles.clear();
|
||||
m_ogl_disp_list_board = 0;
|
||||
m_ogl_circle_texture = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ C_OGL_3DMODEL::C_OGL_3DMODEL( const S3DMODEL &a3DModel )
|
|||
{
|
||||
m_ogl_idx_list_opaque = 0;
|
||||
m_ogl_idx_list_transparent = 0;
|
||||
m_ogl_idx_list_meshes = 0;
|
||||
m_nr_meshes = 0;
|
||||
m_meshs_bbox = NULL;
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ WRL1SHAPEHINTS::WRL1SHAPEHINTS( NAMEREGISTER* aDictionary ) : WRL1NODE( aDiction
|
|||
{
|
||||
m_order = ORD_UNKNOWN;
|
||||
m_Type = WRL1_SHAPEHINTS;
|
||||
m_crease = 0.5;
|
||||
m_crease = 0.733; // approx 42 degrees; this is larger than VRML spec.
|
||||
return;
|
||||
}
|
||||
|
@ -47,6 +46,7 @@ WRL1SHAPEHINTS::WRL1SHAPEHINTS( NAMEREGISTER* aDictionary, WRL1NODE* aParent ) :
|
|||
{
|
||||
m_order = ORD_UNKNOWN;
|
||||
m_Type = WRL1_SHAPEHINTS;
|
||||
m_crease = 0.733; // approx 42 degrees; this is larger than VRML spec.
|
||||
m_Parent = aParent;
|
||||
|
||||
if( NULL != m_Parent )
|
||||
|
|
|
@ -52,6 +52,7 @@ WRLPROC::WRLPROC( LINE_READER* aLineReader )
|
|||
m_eof = false;
|
||||
m_fileline = 0;
|
||||
m_bufpos = 0;
|
||||
m_file = aLineReader;
|
||||
|
||||
if( NULL == aLineReader )
|
||||
{
|
||||
|
@ -60,8 +61,6 @@ WRLPROC::WRLPROC( LINE_READER* aLineReader )
|
|||
}
|
||||
|
||||
m_error.clear();
|
||||
m_file = aLineReader;
|
||||
|
||||
wxString tname = m_file->GetSource();
|
||||
m_filename = tname.ToUTF8();
|
||||
wxFileName fn( tname );
|
||||
|
@ -166,7 +165,7 @@ bool WRLPROC::getRawLine( void )
|
|||
|
||||
while( sS != eS )
|
||||
{
|
||||
if( '\xff' == ((*sS) & 0x80) )
|
||||
if( ((*sS) & 0x80) )
|
||||
{
|
||||
m_error = " non-ASCII character sequence in VRML1 file";
|
||||
return false;
|
||||
|
|
|
@ -117,11 +117,11 @@ void X3DAPP::readFields( wxXmlNode* aNode )
|
|||
m_MatName = prop->GetValue();
|
||||
m_Dict->AddName( m_MatName, this );
|
||||
}
|
||||
if( pname == "USE" )
|
||||
else if( pname == "USE" )
|
||||
{
|
||||
X3DNODE* np = m_Dict->FindName( prop->GetValue() );
|
||||
|
||||
if( np->GetNodeType() == X3D_APPEARANCE )
|
||||
if( NULL != np && np->GetNodeType() == X3D_APPEARANCE )
|
||||
{
|
||||
X3DAPP* ap = (X3DAPP*) np;
|
||||
diffuseColor = ap->diffuseColor;
|
||||
|
|
|
@ -280,7 +280,6 @@ bool DXF2IDF::WriteOutline( FILE* aFile, bool isInch )
|
|||
void DXF2IDF::addHeader( const DRW_Header* data )
|
||||
{
|
||||
std::map<std::string, DRW_Variant*>::const_iterator it;
|
||||
m_scale = 1.0; // assume no scale factor
|
||||
|
||||
for( it = data->vars.begin(); it != data->vars.end(); ++it )
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ private:
|
|||
void insertArc( const IDF_POINT& aSegStart, const IDF_POINT& aSegEnd, double aBulge );
|
||||
|
||||
public:
|
||||
DXF2IDF() : m_scale( 1.0 ) {};
|
||||
~DXF2IDF();
|
||||
|
||||
bool ReadDxf( const std::string aFile );
|
||||
|
|
Loading…
Reference in New Issue