Commit b3b79196 authored by unknown's avatar unknown Committed by jean-pierre charras

coverity common folder fixes (mainly not initialized members).

parent f16e083e
......@@ -374,14 +374,10 @@ const char* ${LEXERCLASS}::TokenName( T aTok )
{
const char* ret;
if( (unsigned) aTok < keyword_count )
{
ret = keywords[aTok].name;
}
else if( aTok < 0 )
{
if( aTok < 0 )
ret = DSNLEXER::Syntax( aTok );
}
else if( (unsigned) aTok < keyword_count )
ret = keywords[aTok].name;
else
ret = \"token too big\";
......
......@@ -35,10 +35,10 @@
#include <class_layer_box_selector.h>
LAYER_SELECTOR::LAYER_SELECTOR()
LAYER_SELECTOR::LAYER_SELECTOR() :
m_layerhotkeys( true ),
m_hotkeys( NULL )
{
m_layerhotkeys = true;
m_hotkeys = NULL;
}
......@@ -81,8 +81,6 @@ LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id,
{
if( choices != NULL )
ResyncBitmapOnly();
m_hotkeys = NULL;
}
......
......@@ -203,8 +203,10 @@ static const double PLUsPERDECIMIL = 0.102041;
HPGL_PLOTTER::HPGL_PLOTTER()
{
SetPenSpeed( 40 ); // Default pen speed = 40 cm/s
SetPenSpeed( 40 ); // Default pen speed = 40 cm/s; Pen speed is *always* in cm
SetPenNumber( 1 ); // Default pen num = 1
SetPenDiameter( 0.0 );
SetPenOverlap( 0.0 );
}
void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
......
......@@ -76,6 +76,10 @@ void DSNLEXER::init()
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
FILE* aFile, const wxString& aFilename ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
......@@ -88,6 +92,10 @@ DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
const std::string& aClipboardTxt, const wxString& aSource ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
......@@ -101,6 +109,10 @@ DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
LINE_READER* aLineReader ) :
iOwnReaders( false ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
......@@ -114,6 +126,10 @@ static const KEYWORD empty_keywords[1] = {};
DSNLEXER::DSNLEXER( const std::string& aSExpression, const wxString& aSource ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
keywords( empty_keywords ),
keywordCount( 0 )
{
......
......@@ -120,18 +120,15 @@ void PARSE_ERROR::init( const char* aThrowersFile, const char* aThrowersLoc,
//-----<LINE_READER>------------------------------------------------------
LINE_READER::LINE_READER( unsigned aMaxLineLength )
LINE_READER::LINE_READER( unsigned aMaxLineLength ) :
length( 0 ),
lineNum( 0 ),
line( NULL ),
capacity( 0 ),
maxLineLength( aMaxLineLength )
{
lineNum = 0;
if( aMaxLineLength == 0 )
{
line = 0;
}
else
if( aMaxLineLength != 0 )
{
maxLineLength = aMaxLineLength;
// start at the INITIAL size, expand as needed up to the MAX size in maxLineLength
capacity = LINE_READER_LINE_INITIAL_SIZE;
......@@ -143,8 +140,6 @@ LINE_READER::LINE_READER( unsigned aMaxLineLength )
line[0] = '\0';
}
length = 0;
}
......
......@@ -42,6 +42,9 @@ struct TOOL_DISPATCHER::BUTTON_STATE
{
BUTTON_STATE( TOOL_MOUSE_BUTTONS aButton, const wxEventType& aDownEvent,
const wxEventType& aUpEvent, const wxEventType& aDblClickEvent ) :
dragging( false ),
pressed( false ),
dragMaxDelta( 0.0f ),
button( aButton ),
downEvent( aDownEvent ),
upEvent( aUpEvent ),
......
......@@ -195,7 +195,11 @@ private:
TOOL_MANAGER::TOOL_MANAGER() :
m_model( NULL ), m_view( NULL ), m_viewControls( NULL ), m_editFrame( NULL )
m_model( NULL ),
m_view( NULL ),
m_viewControls( NULL ),
m_editFrame( NULL ),
m_passEvent( false )
{
m_actionMgr = new ACTION_MANAGER( this );
......
......@@ -35,13 +35,17 @@
#include "wx_unit_binder.h"
WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl* aTextInput, wxStaticText* aUnitLabel, wxSpinButton* aSpinButton )
WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl* aTextInput,
wxStaticText* aUnitLabel, wxSpinButton* aSpinButton ) :
m_textCtrl( aTextInput ),
m_unitLabel( aUnitLabel ),
m_units( g_UserUnit ),
m_step( 1 ),
m_min( 0 ),
m_max( 1 )
{
// Use the currently selected units
m_units = g_UserUnit;
m_textCtrl = aTextInput;
m_textCtrl->SetValue( wxT( "0" ) );
m_unitLabel = aUnitLabel;
m_unitLabel->SetLabel( GetAbbreviatedUnitsLabel( m_units ) );
}
......
......@@ -459,6 +459,8 @@ void SCH_EDIT_FRAME::OnMoveItem( wxCommandEvent& aEvent )
// Moving a marker has no sense
wxFAIL_MSG( wxString::Format( wxT( "Cannot move item type %s" ),
GetChars( item->GetClass() ) ) );
break;
default:
// Unknown items cannot be moved
wxFAIL_MSG( wxString::Format(
......
......@@ -99,7 +99,7 @@ void DIALOG_PNS_LENGTH_TUNING_SETTINGS::OnOkClick( wxCommandEvent& aEvent )
m_settings.m_targetLength = m_targetLength.GetValue();
if( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
m_settings.m_maxAmplitude = m_settings.m_maxAmplitude;
m_settings.m_maxAmplitude = m_settings.m_minAmplitude;
m_settings.m_cornerType = m_miterStyle->GetSelection() ? PNS_MEANDER_SETTINGS::CHAMFER : PNS_MEANDER_SETTINGS::ROUND;
......
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