Fix 3D Coverity issue, other minor fixes

* CID 143740:  Null pointer dereferences  (NULL_RETURNS)
A few minor cut/paste and style issues in the 3D code are also fixed.
This commit is contained in:
Cirilo Bernardo 2016-04-07 18:54:14 -04:00 committed by Chris Pavlina
parent 5e41763d83
commit 973786d75d
6 changed files with 13 additions and 15 deletions

View File

@ -123,9 +123,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, S3D_CACHE* aCacheManager ) :
zoff = NULL; zoff = NULL;
wxBoxSizer* mainBox = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* mainBox = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* vbox = new wxStaticBoxSizer( wxVERTICAL, this, _( "3D Preview" ) );
wxStaticBoxSizer* vbox = new wxStaticBoxSizer( wxVERTICAL, this, _( "3D Model Orientation" ) );
m_FileTree = NULL; m_FileTree = NULL;
if( NULL != aParent ) if( NULL != aParent )

View File

@ -56,7 +56,8 @@ const int COGL_ATT_LIST::m_openGL_AttributesList[] = {
int COGL_ATT_LIST::m_openGL_AttributesList_toUse[ int COGL_ATT_LIST::m_openGL_AttributesList_toUse[
sizeof( COGL_ATT_LIST::m_openGL_AttributesList )] = { 0 }; sizeof( COGL_ATT_LIST::m_openGL_AttributesList ) /
sizeof( COGL_ATT_LIST::m_openGL_AttributesList[0] ) ] = { 0 };
const int *COGL_ATT_LIST::GetAttributesList( bool aUseAntiAliasing ) const int *COGL_ATT_LIST::GetAttributesList( bool aUseAntiAliasing )

View File

@ -43,7 +43,7 @@
#define REVISION 0 #define REVISION 0
#define PATCH 0 #define PATCH 0
#include "../kicad_plugin.h" #include "plugins/kicad_plugin.h"
KICAD_PLUGIN_EXPORT char const* GetKicadPluginClass( void ) KICAD_PLUGIN_EXPORT char const* GetKicadPluginClass( void )

View File

@ -35,7 +35,7 @@
/** /**
* Class IFSG_INDEX * Class IFSG_COLORS
* is the wrapper for SGCOLORS * is the wrapper for SGCOLORS
*/ */
class SGLIB_API IFSG_COLORS : public IFSG_NODE class SGLIB_API IFSG_COLORS : public IFSG_NODE

View File

@ -34,7 +34,7 @@
/** /**
* Class IFSG_INDEX * Class IFSG_COORDS
* is the wrapper for SGCOORDS * is the wrapper for SGCOORDS
*/ */
class SGLIB_API IFSG_COORDS : public IFSG_NODE class SGLIB_API IFSG_COORDS : public IFSG_NODE

View File

@ -53,14 +53,6 @@ class SGNODE;
*/ */
class SGLIB_API IFSG_NODE class SGLIB_API IFSG_NODE
{ {
private:
// hide the copy constructors and assignment operator to avoid accidental misuse
IFSG_NODE( const IFSG_NODE& aParent );
IFSG_NODE( IFSG_NODE& aParent );
IFSG_NODE( volatile const IFSG_NODE& aParent );
IFSG_NODE( volatile IFSG_NODE& aParent );
IFSG_NODE& operator= ( const IFSG_NODE& );
protected: protected:
SGNODE* m_node; SGNODE* m_node;
@ -68,6 +60,13 @@ public:
IFSG_NODE(); IFSG_NODE();
virtual ~IFSG_NODE(); virtual ~IFSG_NODE();
// deleted operators
IFSG_NODE( const IFSG_NODE& aParent ) = delete;
IFSG_NODE( IFSG_NODE& aParent ) = delete;
IFSG_NODE( volatile const IFSG_NODE& aParent ) = delete;
IFSG_NODE( volatile IFSG_NODE& aParent ) = delete;
IFSG_NODE& operator= ( const IFSG_NODE& ) = delete;
/** /**
* Function Destroy * Function Destroy
* deletes the object held by this wrapper * deletes the object held by this wrapper