Coverity fixes.

This commit is contained in:
Jeff Young 2018-03-20 22:44:04 +00:00
parent ff3f229871
commit 99e659ff54
6 changed files with 26 additions and 35 deletions

View File

@ -190,11 +190,12 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
for( EDA_COLOR_T candidate = ::BLACK;
candidate < NBCOLORS; candidate = NextColor( candidate ) )
{
double ch, cs, cv;
double ch;
if( hues[candidate] == 0.0 && values[candidate] == 0.0 )
{
COLOR4D candidate4d( candidate );
double cs, cv;
candidate4d.ToHSV( ch, cs, cv );
@ -205,8 +206,6 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor )
else
{
ch = hues[candidate];
cv = values[candidate];
cv = 0.0;
}
if( fabs( ch - h ) < minDist )

View File

@ -62,6 +62,9 @@ NumericEvaluator :: NumericEvaluator() : pClParser(0)
bClTextInputStorage = true;
bClError = false;
bClParseFinished = false;
init();
}
@ -96,14 +99,14 @@ NumericEvaluator :: init()
}
void
NumericEvaluator :: clear(const void* pObj)
NumericEvaluator :: clear(const void* pObj)
{
free(clToken.token);
clToken.token = nullptr;
clToken.input = nullptr;
bClError = true;
if (bClTextInputStorage && pObj) clObjMap.erase(pObj);
if (bClTextInputStorage && pObj) clObjMap.erase(pObj);
}
void

View File

@ -545,28 +545,13 @@ void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave,
const wxString PART_LIBS::CacheName( const wxString& aFullProjectFilename )
{
/* until apr 2009 the project cache lib was named: <root_name>.cache.lib,
* and after: <root_name>-cache.lib. So if the <name>-cache.lib is not found,
* the old file will be renamed and returned.
*/
wxFileName new_name = aFullProjectFilename;
wxFileName name = aFullProjectFilename;
new_name.SetName( new_name.GetName() + "-cache" );
new_name.SetExt( SchematicLibraryFileExtension );
name.SetName( name.GetName() + "-cache" );
name.SetExt( SchematicLibraryFileExtension );
if( new_name.FileExists() )
return new_name.GetFullPath();
else
{
wxFileName old_name = aFullProjectFilename;
old_name.SetExt( "cache.lib" );
if( old_name.FileExists() )
{
wxRenameFile( old_name.GetFullPath(), new_name.GetFullPath() );
return new_name.GetFullPath();
}
}
if( name.FileExists() )
return name.GetFullPath();
return wxEmptyString;
}

View File

@ -1757,32 +1757,32 @@ void SCH_LEGACY_PLUGIN::Format( SCH_SCREEN* aScreen )
switch( item->Type() )
{
case SCH_COMPONENT_T:
saveComponent( dynamic_cast< SCH_COMPONENT* >( item ) );
saveComponent( static_cast< SCH_COMPONENT* >( item ) );
break;
case SCH_BITMAP_T:
saveBitmap( dynamic_cast< SCH_BITMAP* >( item ) );
saveBitmap( static_cast< SCH_BITMAP* >( item ) );
break;
case SCH_SHEET_T:
saveSheet( dynamic_cast< SCH_SHEET* >( item ) );
saveSheet( static_cast< SCH_SHEET* >( item ) );
break;
case SCH_JUNCTION_T:
saveJunction( dynamic_cast< SCH_JUNCTION* >( item ) );
saveJunction( static_cast< SCH_JUNCTION* >( item ) );
break;
case SCH_NO_CONNECT_T:
saveNoConnect( dynamic_cast< SCH_NO_CONNECT* >( item ) );
saveNoConnect( static_cast< SCH_NO_CONNECT* >( item ) );
break;
case SCH_BUS_WIRE_ENTRY_T:
case SCH_BUS_BUS_ENTRY_T:
saveBusEntry( dynamic_cast< SCH_BUS_ENTRY_BASE* >( item ) );
saveBusEntry( static_cast< SCH_BUS_ENTRY_BASE* >( item ) );
break;
case SCH_LINE_T:
saveLine( dynamic_cast< SCH_LINE* >( item ) );
saveLine( static_cast< SCH_LINE* >( item ) );
break;
case SCH_TEXT_T:
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIERARCHICAL_LABEL_T:
saveText( dynamic_cast< SCH_TEXT* >( item ) );
saveText( static_cast< SCH_TEXT* >( item ) );
break;
default:
wxASSERT( "Unexpected schematic object type in SCH_LEGACY_PLUGIN::Format()" );

View File

@ -35,7 +35,10 @@
class SELECTION : public KIGFX::VIEW_GROUP
{
public:
SELECTION() {};
SELECTION()
{
m_isHover = false;
}
SELECTION( const SELECTION& aOther )
{

View File

@ -84,6 +84,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
m_ZoneMinThickness = aZone.m_ZoneMinThickness;
m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
m_hv45 = aZone.m_hv45;
m_priority = aZone.m_priority;
m_ArcToSegmentsCount = aZone.m_ArcToSegmentsCount;
m_PadConnection = aZone.m_PadConnection;