From 8253e1d41b24c250ea35fb36847f309efc7e240e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 22 Jul 2013 14:31:47 +0000 Subject: [PATCH] Fixed various size_t and float conversion warnings git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17116 383ad7c9-94d9-4d36-a494-682f7c89f535 --- Core/ParseIni.cc | 6 +++--- Core/PluginLoader.cc | 10 +++++----- Core/openFunctions.cc | 4 ++-- Core/saveSettings.cc | 4 ++-- widgets/coreWidget/keyHandling.cc | 8 ++++---- widgets/optionsWidget/optionsWidget.cc | 2 +- widgets/processManagerWidget/processManagerWidget.hh | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Core/ParseIni.cc b/Core/ParseIni.cc index 45bd7194..22d3bb0d 100644 --- a/Core/ParseIni.cc +++ b/Core/ParseIni.cc @@ -196,9 +196,9 @@ void Core::readApplicationOptions(INIFile& _ini) { else { std::vector set (9,0.0); - set[0] = 0.299; - set[3] = 0.587; - set[6] = 0.114; + set[0] = 0.299f; + set[3] = 0.587f; + set[6] = 0.114f; OpenFlipper::Options::anaglyphLeftEyeColorMatrix(set); } diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index b2ac42ec..e17111e4 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -246,7 +246,7 @@ class PreloadThread : public QThread */ class PluginInitializationOrder { public: - int getTypeOrdinal(const QString &name) const { + size_t getTypeOrdinal(const QString &name) const { const QString basename = QFileInfo(name).baseName(); if (basename.contains("Plugin-Type")) return 0; @@ -259,8 +259,8 @@ class PluginInitializationOrder { } bool operator() (const QString &a, const QString &b) const { - const int typeA = getTypeOrdinal(a); - const int typeB = getTypeOrdinal(b); + const size_t typeA = getTypeOrdinal(a); + const size_t typeB = getTypeOrdinal(b); if (typeA != typeB) { return typeA < typeB; } return a < b; } @@ -335,7 +335,7 @@ void Core::loadPlugins() * Note: This call is not necessary, anymore. Initialization order * is determined later. */ - std::sort(pluginlist.begin(), pluginlist.end(), PluginInitializationOrder()); + //std::sort(pluginlist.begin(), pluginlist.end(), PluginInitializationOrder()); for ( int i = 0 ; i < dontLoadPlugins.size(); ++i ) emit log(LOGWARN,tr("Skipping Plugins :\t %1").arg( dontLoadPlugins[i] ) ); @@ -535,7 +535,7 @@ void Core::loadPlugins() emit pluginsInitialized(); - emit log(LOGOUT,tr("Loaded %n Plugin(s)","",plugins_.size()) ); + emit log(LOGOUT,tr("Loaded %n Plugin(s)","",int(plugins_.size())) ); } /** @brief slot for loading Plugins diff --git a/Core/openFunctions.cc b/Core/openFunctions.cc index 1f499b3d..ec50937e 100644 --- a/Core/openFunctions.cc +++ b/Core/openFunctions.cc @@ -341,7 +341,7 @@ int Core::loadObject( DataType _type, QString _filename) { } // load file with plugins - int nPlugins = typeIds.size(); + size_t nPlugins = typeIds.size(); if (nPlugins > 0) { int i = -1; @@ -351,7 +351,7 @@ int Core::loadObject( DataType _type, QString _filename) { // let the user choose the plugin for loading if ( OpenFlipper::Options::gui() ) { QStringList items; - for (int j = 0; j < nPlugins; ++j) { + for (size_t j = 0; j < nPlugins; ++j) { // only add the plugin name if it does not already exist in the itemlist if (items.indexOf(supportedTypes()[typeIds[j]].name) == -1) items << supportedTypes()[typeIds[j]].name; diff --git a/Core/saveSettings.cc b/Core/saveSettings.cc index 1484454c..10a45323 100644 --- a/Core/saveSettings.cc +++ b/Core/saveSettings.cc @@ -286,11 +286,11 @@ void Core::saveSettings(QString complete_name, bool is_saveObjectInfo, bool is_t // If a file with the same name already has been saved, // rename it. - unsigned int c = originalFiles.count(filename); + size_t c = originalFiles.count(filename); if(c > 1) { QFileInfo finfo(filename); filename = finfo.absolutePath() + OpenFlipper::Options::dirSeparator(); - filename += finfo.baseName() + QString("_%1").arg((c-1)) + "."; + filename += finfo.baseName() + QString("_%1").arg(c-1) + "."; filename += finfo.completeSuffix(); } diff --git a/widgets/coreWidget/keyHandling.cc b/widgets/coreWidget/keyHandling.cc index 4a6b45c0..8ea5f3a0 100644 --- a/widgets/coreWidget/keyHandling.cc +++ b/widgets/coreWidget/keyHandling.cc @@ -258,8 +258,8 @@ void CoreWidget::slotRegisterKey(int _key, Qt::KeyboardModifiers _modifiers, QSt coreKeys_.push_back( kb ); - keys_.insert( std::make_pair( std::make_pair(_key, _modifiers) , std::make_pair ((QObject*)0, coreKeys_.size()-1 ) )) ; - invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, coreKeys_.size()-1 ) , std::make_pair(_key, _modifiers) ) ); + keys_.insert( std::make_pair( std::make_pair(_key, _modifiers) , std::make_pair ((QObject*)0, int(coreKeys_.size()-1 ) ) )) ; + invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) , std::make_pair(_key, _modifiers) ) ); return; } @@ -310,8 +310,8 @@ void CoreWidget::slotRegisterSlotKeyBindings(){ coreKeys_.push_back( kb ); - keys_.insert( std::make_pair( std::make_pair(-1, (QFlags)0) , std::make_pair ((QObject*)0, coreKeys_.size()-1 ) )) ; - invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, coreKeys_.size()-1 ) , std::make_pair(-1, (QFlags)0) ) ); + keys_.insert( std::make_pair( std::make_pair(-1, (QFlags)0) , std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) )) ; + invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) , std::make_pair(-1, (QFlags)0) ) ); } //check all plugins diff --git a/widgets/optionsWidget/optionsWidget.cc b/widgets/optionsWidget/optionsWidget.cc index 7fd07ec7..20fb7bb6 100644 --- a/widgets/optionsWidget/optionsWidget.cc +++ b/widgets/optionsWidget/optionsWidget.cc @@ -424,7 +424,7 @@ void OptionsWidget::updateVersionsTable() { } updateList->clear(); - updateList->setRowCount( 1 + plugins_.size() ); + updateList->setRowCount( int(1 + plugins_.size()) ); updateList->setColumnCount(3); QStringList header; diff --git a/widgets/processManagerWidget/processManagerWidget.hh b/widgets/processManagerWidget/processManagerWidget.hh index 6b317d3a..5fced50b 100644 --- a/widgets/processManagerWidget/processManagerWidget.hh +++ b/widgets/processManagerWidget/processManagerWidget.hh @@ -108,7 +108,7 @@ class ProcessManagerWidget : public QWidget, public Ui::ProcessManagerWidget void removeJob(QString _jobName); - int getNumJobs() { return processMap_.size(); } + size_t getNumJobs() { return processMap_.size(); } private slots: -- GitLab