Commit 8253e1d4 authored by Jan Möbius's avatar Jan Möbius

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
parent d49f713f
...@@ -196,9 +196,9 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -196,9 +196,9 @@ void Core::readApplicationOptions(INIFile& _ini) {
else else
{ {
std::vector<float> set (9,0.0); std::vector<float> set (9,0.0);
set[0] = 0.299; set[0] = 0.299f;
set[3] = 0.587; set[3] = 0.587f;
set[6] = 0.114; set[6] = 0.114f;
OpenFlipper::Options::anaglyphLeftEyeColorMatrix(set); OpenFlipper::Options::anaglyphLeftEyeColorMatrix(set);
} }
......
...@@ -246,7 +246,7 @@ class PreloadThread : public QThread ...@@ -246,7 +246,7 @@ class PreloadThread : public QThread
*/ */
class PluginInitializationOrder { class PluginInitializationOrder {
public: public:
int getTypeOrdinal(const QString &name) const { size_t getTypeOrdinal(const QString &name) const {
const QString basename = QFileInfo(name).baseName(); const QString basename = QFileInfo(name).baseName();
if (basename.contains("Plugin-Type")) if (basename.contains("Plugin-Type"))
return 0; return 0;
...@@ -259,8 +259,8 @@ class PluginInitializationOrder { ...@@ -259,8 +259,8 @@ class PluginInitializationOrder {
} }
bool operator() (const QString &a, const QString &b) const { bool operator() (const QString &a, const QString &b) const {
const int typeA = getTypeOrdinal(a); const size_t typeA = getTypeOrdinal(a);
const int typeB = getTypeOrdinal(b); const size_t typeB = getTypeOrdinal(b);
if (typeA != typeB) { return typeA < typeB; } if (typeA != typeB) { return typeA < typeB; }
return a < b; return a < b;
} }
...@@ -335,7 +335,7 @@ void Core::loadPlugins() ...@@ -335,7 +335,7 @@ void Core::loadPlugins()
* Note: This call is not necessary, anymore. Initialization order * Note: This call is not necessary, anymore. Initialization order
* is determined later. * 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 ) for ( int i = 0 ; i < dontLoadPlugins.size(); ++i )
emit log(LOGWARN,tr("Skipping Plugins :\t %1").arg( dontLoadPlugins[i] ) ); emit log(LOGWARN,tr("Skipping Plugins :\t %1").arg( dontLoadPlugins[i] ) );
...@@ -535,7 +535,7 @@ void Core::loadPlugins() ...@@ -535,7 +535,7 @@ void Core::loadPlugins()
emit pluginsInitialized(); 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 /** @brief slot for loading Plugins
......
...@@ -341,7 +341,7 @@ int Core::loadObject( DataType _type, QString _filename) { ...@@ -341,7 +341,7 @@ int Core::loadObject( DataType _type, QString _filename) {
} }
// load file with plugins // load file with plugins
int nPlugins = typeIds.size(); size_t nPlugins = typeIds.size();
if (nPlugins > 0) { if (nPlugins > 0) {
int i = -1; int i = -1;
...@@ -351,7 +351,7 @@ int Core::loadObject( DataType _type, QString _filename) { ...@@ -351,7 +351,7 @@ int Core::loadObject( DataType _type, QString _filename) {
// let the user choose the plugin for loading // let the user choose the plugin for loading
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
QStringList items; 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 // only add the plugin name if it does not already exist in the itemlist
if (items.indexOf(supportedTypes()[typeIds[j]].name) == -1) if (items.indexOf(supportedTypes()[typeIds[j]].name) == -1)
items << supportedTypes()[typeIds[j]].name; items << supportedTypes()[typeIds[j]].name;
......
...@@ -286,11 +286,11 @@ void Core::saveSettings(QString complete_name, bool is_saveObjectInfo, bool is_t ...@@ -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, // If a file with the same name already has been saved,
// rename it. // rename it.
unsigned int c = originalFiles.count(filename); size_t c = originalFiles.count(filename);
if(c > 1) { if(c > 1) {
QFileInfo finfo(filename); QFileInfo finfo(filename);
filename = finfo.absolutePath() + OpenFlipper::Options::dirSeparator(); 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(); filename += finfo.completeSuffix();
} }
......
...@@ -258,8 +258,8 @@ void CoreWidget::slotRegisterKey(int _key, Qt::KeyboardModifiers _modifiers, QSt ...@@ -258,8 +258,8 @@ void CoreWidget::slotRegisterKey(int _key, Qt::KeyboardModifiers _modifiers, QSt
coreKeys_.push_back( kb ); coreKeys_.push_back( kb );
keys_.insert( std::make_pair( std::make_pair(_key, _modifiers) , std::make_pair ((QObject*)0, coreKeys_.size()-1 ) )) ; 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, coreKeys_.size()-1 ) , std::make_pair(_key, _modifiers) ) ); invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) , std::make_pair(_key, _modifiers) ) );
return; return;
} }
...@@ -310,8 +310,8 @@ void CoreWidget::slotRegisterSlotKeyBindings(){ ...@@ -310,8 +310,8 @@ void CoreWidget::slotRegisterSlotKeyBindings(){
coreKeys_.push_back( kb ); coreKeys_.push_back( kb );
keys_.insert( std::make_pair( std::make_pair(-1, (QFlags<Qt::KeyboardModifier>)0) , std::make_pair ((QObject*)0, coreKeys_.size()-1 ) )) ; keys_.insert( std::make_pair( std::make_pair(-1, (QFlags<Qt::KeyboardModifier>)0) , std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) )) ;
invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, coreKeys_.size()-1 ) , std::make_pair(-1, (QFlags<Qt::KeyboardModifier>)0) ) ); invKeys_.insert( std::make_pair( std::make_pair ((QObject*)0, int(coreKeys_.size()-1) ) , std::make_pair(-1, (QFlags<Qt::KeyboardModifier>)0) ) );
} }
//check all plugins //check all plugins
......
...@@ -424,7 +424,7 @@ void OptionsWidget::updateVersionsTable() { ...@@ -424,7 +424,7 @@ void OptionsWidget::updateVersionsTable() {
} }
updateList->clear(); updateList->clear();
updateList->setRowCount( 1 + plugins_.size() ); updateList->setRowCount( int(1 + plugins_.size()) );
updateList->setColumnCount(3); updateList->setColumnCount(3);
QStringList header; QStringList header;
......
...@@ -108,7 +108,7 @@ class ProcessManagerWidget : public QWidget, public Ui::ProcessManagerWidget ...@@ -108,7 +108,7 @@ class ProcessManagerWidget : public QWidget, public Ui::ProcessManagerWidget
void removeJob(QString _jobName); void removeJob(QString _jobName);
int getNumJobs() { return processMap_.size(); } size_t getNumJobs() { return processMap_.size(); }
private slots: private slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment