Browse Source

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.
pull/12/head
Cirilo Bernardo 10 years ago
committed by Chris Pavlina
parent
commit
973786d75d
  1. 4
      3d-viewer/3d_cache/dialogs/panel_prev_model.cpp
  2. 3
      3d-viewer/common_ogl/cogl_att_list.cpp
  3. 2
      include/plugins/3d/3d_plugin.h
  4. 2
      include/plugins/3dapi/ifsg_colors.h
  5. 2
      include/plugins/3dapi/ifsg_coords.h
  6. 15
      include/plugins/3dapi/ifsg_node.h

4
3d-viewer/3d_cache/dialogs/panel_prev_model.cpp

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

3
3d-viewer/common_ogl/cogl_att_list.cpp

@ -56,7 +56,8 @@ const int COGL_ATT_LIST::m_openGL_AttributesList[] = {
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 )

2
include/plugins/3d/3d_plugin.h

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

2
include/plugins/3dapi/ifsg_colors.h

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

2
include/plugins/3dapi/ifsg_coords.h

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

15
include/plugins/3dapi/ifsg_node.h

@ -53,14 +53,6 @@ class SGNODE;
*/
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:
SGNODE* m_node;
@ -68,6 +60,13 @@ public:
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
* deletes the object held by this wrapper

Loading…
Cancel
Save