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) {
else
{
std::vector<float> 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);
}
......
......@@ -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
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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<Qt::KeyboardModifier>)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<Qt::KeyboardModifier>)0) ) );
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, int(coreKeys_.size()-1) ) , std::make_pair(-1, (QFlags<Qt::KeyboardModifier>)0) ) );
}
//check all plugins
......
......@@ -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;
......
......@@ -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:
......
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