Reduce compiler warnings.

This commit is contained in:
Jeff Young 2022-12-11 13:32:37 +00:00
parent 3581a9773f
commit 56aae7a147
4 changed files with 17 additions and 18 deletions

View File

@ -575,7 +575,7 @@ BOX2I EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
* At this point the rectangle origin is the text origin (m_Pos). This is correct only for
* left and top justified, non-mirrored, non-overbarred texts. Recalculate for all others.
*/
int italicOffset = IsItalic() ? fontSize.y * ITALIC_TILT : 0;
int italicOffset = IsItalic() ? KiROUND( fontSize.y * ITALIC_TILT ) : 0;
switch( GetHorizJustify() )
{
@ -656,7 +656,7 @@ void EDA_TEXT::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
positions.reserve( strings.Count() );
GetLinePositions( positions, strings.Count() );
GetLinePositions( positions, (int) strings.Count() );
for( unsigned ii = 0; ii < strings.Count(); ii++ )
printOneLineOfText( aSettings, aOffset, aColor, aFillMode, strings[ii], positions[ii] );
@ -987,7 +987,7 @@ bool EDA_TEXT::ValidateHyperlink( const wxString& aURL )
if( uri.Create( aURL ) && uri.HasScheme() )
{
wxString scheme = uri.GetScheme();
const wxString& scheme = uri.GetScheme();
return scheme == wxT( "file" ) || scheme == wxT( "http" ) || scheme == wxT( "https" );
}

View File

@ -197,12 +197,12 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
thisFile.SetPath( dirName ); // Set the base path to the cache folder
int numFilesFound = dir.GetAllFiles( dirName, &fileList, fileSpec );
size_t numFilesFound = wxDir::GetAllFiles( dirName, &fileList, fileSpec );
for( int i = 0; i < numFilesFound; i++ )
for( size_t ii = 0; ii < numFilesFound; ii++ )
{
// Completes path to specific file so we can get its "last access" date
thisFile.SetFullName( fileList[i] );
thisFile.SetFullName( fileList[ii] );
wxRemoveFile( thisFile.GetFullPath() );
}
@ -257,11 +257,8 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
try
{
if( !readRefName( sheet, *symbol, spiceItem, refNames ) )
return false;
readRefName( sheet, *symbol, spiceItem, refNames );
readModel( sheet, *symbol, spiceItem );
readPinNumbers( *symbol, spiceItem );
readPinNetNames( *symbol, spiceItem, ncCounter );
@ -387,7 +384,7 @@ void NETLIST_EXPORTER_SPICE::ReadDirectives( unsigned aNetlistOptions, REPORTER&
}
bool NETLIST_EXPORTER_SPICE::readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol,
void NETLIST_EXPORTER_SPICE::readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol,
SPICE_ITEM& aItem,
std::set<std::string>& aRefNames )
{
@ -395,8 +392,6 @@ bool NETLIST_EXPORTER_SPICE::readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aS
if( !aRefNames.insert( aItem.refName ).second )
wxASSERT( wxT( "Duplicate refdes encountered; what happened to ReadyToNetlist()?" ) );
return true;
}
@ -483,9 +478,8 @@ void NETLIST_EXPORTER_SPICE::writeInclude( OUTPUTFORMATTER& aFormatter, unsigned
if( fullPath.IsEmpty() )
{
DisplayErrorMessage( nullptr,
wxString::Format( _( "Could not find library file '%s'" ),
expandedPath ) );
DisplayErrorMessage( nullptr, wxString::Format( _( "Could not find library file '%s'" ),
expandedPath ) );
fullPath = expandedPath;
}
}

View File

@ -137,7 +137,7 @@ protected:
SCH_SHEET_LIST GetSheets( unsigned aNetlistOptions = 0 ) const;
private:
bool readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
void readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
std::set<std::string>& aRefNames );
void readModel( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem );
void readPinNumbers( SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem );

View File

@ -1666,10 +1666,15 @@ bool SIM_PLOT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
filename.SetFullName( Prj().GetProjectName() + wxT( ".wbk" ) );
}
#if 0 // TODO: Enable once 8.0 opens for dev
wxString msg = _( "Save changes to workbook?" );
#else
wxString fullFilename = filename.GetFullName();
wxString msg = _( "Save changes to '%s' before closing?" );
msg.Printf( msg, fullFilename );
#endif
return HandleUnsavedChanges( this, wxString::Format( msg, fullFilename ),
return HandleUnsavedChanges( this, msg,
[&]() -> bool
{
return saveWorkbook( Prj().AbsolutePath( fullFilename ) );