Clang: reduce warnings in various places

main
Adriaan de Groot 7 years ago
parent a06911e9aa
commit bd3786ebeb

@ -46,6 +46,7 @@ void
ViewStepItem::appendChild( ProgressTreeItem* item )
{
Q_ASSERT( false );
Q_UNUSED( item );
}

@ -165,7 +165,7 @@ ExecutionViewStep::appendJobModuleInstanceKey( const QString& instanceKey )
void
ExecutionViewStep::updateFromJobQueue( qreal percent, const QString& message )
{
m_progressBar->setValue( percent * m_progressBar->maximum() );
m_progressBar->setValue( int( percent * m_progressBar->maximum() ) );
m_label->setText( message );
}

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Originally from Tomahawk,
* Copyright 2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
@ -54,7 +55,7 @@ ImageRegistry::icon( const QString& image, CalamaresUtils::ImageMode mode )
qint64
ImageRegistry::cacheKey( const QSize& size, float opacity, QColor tint )
{
return size.width() * 100 + size.height() * 10 + ( opacity * 100.0 ) + tint.value();
return size.width() * 100 + size.height() * 10 + int( opacity * 100.0 ) + tint.value();
}

@ -54,7 +54,7 @@ findLayout( const KeyboardLayoutModel* klm, const QString& currentLayout )
}
KeyboardPage::KeyboardPage( QWidget* parent )
: QWidget()
: QWidget( parent )
, ui( new Ui::Page_Keyboard )
, m_keyboardPreview( new KeyBoardPreview( this ) )
, m_defaultIndex( 0 )
@ -321,6 +321,8 @@ static inline QStringList xkbmap_args( QStringList&& r, const QString& layout, c
void
KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
{
Q_UNUSED( previous );
QPersistentModelIndex layoutIndex = ui->listLayout->currentIndex();
LayoutItem* variantItem = dynamic_cast< LayoutItem* >( current );

@ -134,9 +134,6 @@ KeyboardViewStep::onLeave()
void
KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
// Save the settings to the global settings for the SetKeyboardLayoutJob to use
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
if ( configurationMap.contains( "xOrgConfFileName" ) &&
configurationMap.value( "xOrgConfFileName" ).type() == QVariant::String &&
!configurationMap.value( "xOrgConfFileName" ).toString().isEmpty() )

@ -145,8 +145,12 @@ MoveFileSystemJob::copyBlocks( Report& report, CopyTargetDevice& target, CopySou
qint64 blocksCopied = 0;
void* buffer = malloc( blockSize * source.sectorSize() );
int percent = 0;
Q_ASSERT( blockSize > 0 );
Q_ASSERT( source.sectorSize() > 0 );
Q_ASSERT( blockSize * source.sectorSize() > 0 );
void* buffer = malloc( size_t( blockSize * source.sectorSize() ) );
qint64 percent = 0;
while ( blocksCopied < blocksToCopy )
{
@ -161,7 +165,7 @@ MoveFileSystemJob::copyBlocks( Report& report, CopyTargetDevice& target, CopySou
if ( ++blocksCopied * 100 / blocksToCopy != percent )
{
percent = blocksCopied * 100 / blocksToCopy;
progress( qreal( percent ) / 100. );
progress( percent / 100. );
}
}

@ -53,9 +53,10 @@
RequirementsChecker::RequirementsChecker( QObject* parent )
: QObject( parent )
, m_widget( new QWidget() )
, m_requiredStorageGB( -1 )
, m_requiredRamGB( -1 )
, m_actualWidget( new CheckerWidget() )
, m_verdict( false )
, m_requiredStorageGB( -1 )
{
QBoxLayout* mainLayout = new QHBoxLayout;
m_widget->setLayout( mainLayout );

Loading…
Cancel
Save