Code cleanup (and Coverity quieting).

This commit is contained in:
Jeff Young 2024-01-04 11:49:06 +00:00
parent df4e72827b
commit aa4107ce2d
8 changed files with 21 additions and 22 deletions

View File

@ -148,7 +148,7 @@ bool DRC_CACHE_GENERATOR::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / count );
reportProgress( done, count );
status = retn.wait_for( std::chrono::milliseconds( 250 ) );
}
@ -204,7 +204,7 @@ bool DRC_CACHE_GENERATOR::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / allZones.size() );
reportProgress( done, allZones.size() );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -84,11 +84,11 @@ void DRC_TEST_PROVIDER::reportViolation( std::shared_ptr<DRC_ITEM>& item,
}
bool DRC_TEST_PROVIDER::reportProgress( int aCount, int aSize, int aDelta )
bool DRC_TEST_PROVIDER::reportProgress( size_t aCount, size_t aSize, size_t aDelta )
{
if( ( aCount % aDelta ) == 0 || aCount == aSize - 1 )
{
if( !m_drcEngine->ReportProgress( (double) aCount / (double) aSize ) )
if( !m_drcEngine->ReportProgress( static_cast<double>( aCount ) / aSize ) )
return false;
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -110,7 +110,7 @@ protected:
virtual void reportViolation( std::shared_ptr<DRC_ITEM>& item, const VECTOR2I& aMarkerPos,
int aMarkerLayer );
virtual bool reportProgress( int aCount, int aSize, int aDelta );
virtual bool reportProgress( size_t aCount, size_t aSize, size_t aDelta = 1 );
virtual bool reportPhase( const wxString& aStageName );
virtual void reportRuleStatistics();

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 KiCad Developers.
* Copyright (C) 2022-2024 KiCad Developers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -844,7 +844,7 @@ bool DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / total_effort );
reportProgress( done, total_effort );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}
@ -864,7 +864,7 @@ bool DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / total_effort );
reportProgress( done, total_effort );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2022 KiCad Developers.
* Copyright (C) 2004-2024 KiCad Developers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -676,7 +676,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances()
while( done < count )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / count );
reportProgress( done, count );
if( m_drcEngine->IsCancelled() )
{
@ -1005,7 +1005,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances( )
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / count );
reportProgress( done, count );
status = retn.wait_for( std::chrono::milliseconds( 250 ) );
}
}
@ -1157,7 +1157,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testGraphicClearances( )
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / count );
reportProgress( done, count );
status = retn.wait_for( std::chrono::milliseconds( 250 ) );
}
}
@ -1333,7 +1333,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones()
{
result = task.wait_for( std::chrono::milliseconds( 250 ) );
m_drcEngine->ReportProgress( static_cast<double>( done ) / count );
reportProgress( done, count );
if( m_drcEngine->IsCancelled() )
break;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2022 KiCad Developers.
* Copyright (C) 2004-2024 KiCad Developers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -176,7 +176,7 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / toCache.size() );
reportProgress( done, toCache.size() );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021-2022 KiCad Developers.
* Copyright (C) 2021-2024 KiCad Developers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -174,8 +174,7 @@ bool DRC_TEST_PROVIDER_SLIVER_CHECKER::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( zoneLayerCount ) / done );
reportProgress( zoneLayerCount, done );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021-2023 KiCad Developers.
* Copyright (C) 2021-2024 KiCad Developers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -287,7 +287,7 @@ bool DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run()
while( status != std::future_status::ready )
{
m_drcEngine->ReportProgress( static_cast<double>( done ) / total_effort );
reportProgress( done, total_effort );
status = ret.wait_for( std::chrono::milliseconds( 250 ) );
}
}