Fix compil warnings and minor Coverity warnings (uninitialized variables).

This commit is contained in:
jean-pierre charras 2024-10-01 18:38:41 +02:00
parent 37a656fae7
commit 56b50e1600
4 changed files with 19 additions and 13 deletions

View File

@ -485,8 +485,8 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
// Solder mask and Solder paste have the same Z position
for( PCB_LAYER_ID layer_id : { B_Adhes, B_Mask, B_Paste, F_Adhes, F_Mask, F_Paste, B_SilkS, F_SilkS } )
{
float zposTop;
float zposBottom;
float zposTop = 0.0;
float zposBottom = 0.0;
switch( layer_id )
{

View File

@ -29,7 +29,7 @@
struct KICOMMON_API JOBSET_JOB
{
JOBSET_JOB() {}
JOBSET_JOB() : m_job( nullptr ) {}
JOBSET_JOB( wxString id, wxString type, JOB* job ) : m_id( id ), m_type( type ), m_job( job ) {}
@ -48,7 +48,9 @@ enum class JOBSET_OUTPUT_TYPE
struct KICOMMON_API JOBSET_OUTPUT
{
JOBSET_OUTPUT() {}
JOBSET_OUTPUT() :
m_type( JOBSET_OUTPUT_TYPE::FOLDER ), m_outputHandler( nullptr )
{}
JOBSET_OUTPUT( wxString id, JOBSET_OUTPUT_TYPE type, JOBS_OUTPUT_HANDLER* outputHandler ) :
m_id( id ), m_type( type ), m_outputHandler( outputHandler )

View File

@ -45,10 +45,10 @@
struct JOB_TYPE_INFO
{
wxString name;
enum BITMAPS bitmap;
bool outputPathIsFolder;
wxString fileWildcard;
wxString name;
BITMAPS bitmap;
bool outputPathIsFolder;
wxString fileWildcard;
};
@ -434,7 +434,7 @@ void PANEL_JOBS::OnAddJobClick( wxCommandEvent& aEvent )
const JOB_REGISTRY::REGISTRY_MAP_T& jobMap = JOB_REGISTRY::GetRegistry();
for( const std::pair<wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
{
wxArrayString item;
item.Add( wxGetTranslation( entry.second.title ) );
@ -451,7 +451,7 @@ void PANEL_JOBS::OnAddJobClick( wxCommandEvent& aEvent )
wxString jobKey;
if( !selectedString.IsEmpty() )
{
for( const std::pair<wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
{
if( wxGetTranslation( entry.second.title ) == selectedString )
{
@ -479,7 +479,7 @@ void PANEL_JOBS::OnAddOutputClick( wxCommandEvent& aEvent )
headers.Add( _( "Job Types" ) );
for( const std::pair<JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
{
wxArrayString item;
item.Add( wxGetTranslation( jobType.second.name ) );
@ -494,7 +494,7 @@ void PANEL_JOBS::OnAddOutputClick( wxCommandEvent& aEvent )
{
wxString selectedString = dlg.GetTextSelection();
for( const std::pair<JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
{
if( wxGetTranslation( jobType.second.name ) == selectedString )
{

View File

@ -221,7 +221,11 @@ public:
{
public:
PACKAGE( const size_t aIndex, const wxString& afpName ) :
m_index( aIndex ), m_name( afpName )
m_index( aIndex ), m_name( afpName ),
m_pitch( 0 ),
m_xmin( 0 ), m_ymin( 0 ),
m_xmax( 0 ), m_ymax( 0 )
{
}