# HG changeset patch # User Chris Cannam # Date 1403016927 -3600 # Node ID e4773943c9c179a4b29ced5b53f3ea21dbd0c739 # Parent 4c8ca536b54f84102a5461e97d3a318fe3b10e7b More unsigned/long and warning fixes diff -r 4c8ca536b54f -r e4773943c9c1 widgets/CSVFormatDialog.cpp --- a/widgets/CSVFormatDialog.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/CSVFormatDialog.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -130,13 +130,13 @@ m_sampleRateLabel = new QLabel(tr("Audio sample rate (Hz):")); layout->addWidget(m_sampleRateLabel, row, 0); - size_t sampleRates[] = { + int sampleRates[] = { 8000, 11025, 12000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000 }; m_sampleRateCombo = new QComboBox; - for (size_t i = 0; i < sizeof(sampleRates) / sizeof(sampleRates[0]); ++i) { + for (int i = 0; i < int(sizeof(sampleRates) / sizeof(sampleRates[0])); ++i) { m_sampleRateCombo->addItem(QString("%1").arg(sampleRates[i])); if (sampleRates[i] == m_format.getSampleRate()) { m_sampleRateCombo->setCurrentIndex(i); diff -r 4c8ca536b54f -r e4773943c9c1 widgets/IconLoader.cpp --- a/widgets/IconLoader.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/IconLoader.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -80,8 +80,8 @@ } if (pmap.isNull()) return pmap; - for (int i = 0; i < sizeof(autoInvertExceptions)/ - sizeof(autoInvertExceptions[0]); ++i) { + for (int i = 0; i < int(sizeof(autoInvertExceptions)/ + sizeof(autoInvertExceptions[0])); ++i) { if (autoInvertExceptions[i] == name) { return pmap; } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/ItemEditDialog.cpp --- a/widgets/ItemEditDialog.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/ItemEditDialog.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -28,7 +28,7 @@ #include // for FLT_MIN/MAX -ItemEditDialog::ItemEditDialog(size_t sampleRate, int options, +ItemEditDialog::ItemEditDialog(int sampleRate, int options, QString valueUnits, QWidget *parent) : QDialog(parent), m_sampleRate(sampleRate), @@ -50,7 +50,7 @@ int row = 0, subrow = 0; - size_t singleStep = RealTime::frame2RealTime(2, sampleRate).usec() - 1; + int singleStep = RealTime::frame2RealTime(2, sampleRate).usec() - 1; if ((options & ShowTime) || (options & ShowDuration)) { @@ -190,7 +190,7 @@ } void -ItemEditDialog::setFrameTime(long frame) +ItemEditDialog::setFrameTime(int frame) { if (!m_frameTimeSpinBox) return; @@ -202,7 +202,7 @@ m_resetButton->setEnabled(false); } -long +int ItemEditDialog::getFrameTime() const { return m_frameTimeSpinBox->value(); @@ -221,7 +221,7 @@ } void -ItemEditDialog::setFrameDuration(long duration) +ItemEditDialog::setFrameDuration(int duration) { if (!m_frameDurationSpinBox) return; @@ -233,7 +233,7 @@ m_resetButton->setEnabled(false); } -long +int ItemEditDialog::getFrameDuration() const { return m_frameDurationSpinBox->value(); @@ -303,7 +303,7 @@ { RealTime rt = getRealTime(); rt.sec = i; - size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); + int frame = RealTime::realTime2Frame(rt, m_sampleRate); m_frameTimeSpinBox->setValue(frame); m_resetButton->setEnabled(true); } @@ -313,7 +313,7 @@ { RealTime rt = getRealTime(); rt.nsec = i * 1000; - size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); + int frame = RealTime::realTime2Frame(rt, m_sampleRate); m_frameTimeSpinBox->setValue(frame); m_resetButton->setEnabled(true); } @@ -338,7 +338,7 @@ { RealTime rt = getRealDuration(); rt.sec = i; - size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); + int frame = RealTime::realTime2Frame(rt, m_sampleRate); m_frameDurationSpinBox->setValue(frame); m_resetButton->setEnabled(true); } @@ -348,7 +348,7 @@ { RealTime rt = getRealDuration(); rt.nsec = i * 1000; - size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); + int frame = RealTime::realTime2Frame(rt, m_sampleRate); m_frameDurationSpinBox->setValue(frame); m_resetButton->setEnabled(true); } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/ItemEditDialog.h --- a/widgets/ItemEditDialog.h Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/ItemEditDialog.h Tue Jun 17 15:55:27 2014 +0100 @@ -37,17 +37,17 @@ ShowText = 1 << 3 }; - ItemEditDialog(size_t sampleRate, int options, QString valueUnits = "", + ItemEditDialog(int sampleRate, int options, QString valueUnits = "", QWidget *parent = 0); - void setFrameTime(long frame); - long getFrameTime() const; + void setFrameTime(int frame); + int getFrameTime() const; void setRealTime(RealTime rt); RealTime getRealTime() const; - void setFrameDuration(long frame); - long getFrameDuration() const; + void setFrameDuration(int frame); + int getFrameDuration() const; void setRealDuration(RealTime rt); RealTime getRealDuration() const; @@ -70,9 +70,9 @@ void reset(); protected: - size_t m_sampleRate; - long m_defaultFrame; - long m_defaultDuration; + int m_sampleRate; + int m_defaultFrame; + int m_defaultDuration; float m_defaultValue; QString m_defaultText; QSpinBox *m_frameTimeSpinBox; diff -r 4c8ca536b54f -r e4773943c9c1 widgets/LayerTree.cpp --- a/widgets/LayerTree.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/LayerTree.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -155,12 +155,12 @@ } void -ModelMetadataModel::propertyContainerPropertyChanged(PropertyContainer *pc) +ModelMetadataModel::propertyContainerPropertyChanged(PropertyContainer *) { } void -ModelMetadataModel::playParametersAudibilityChanged(bool a) +ModelMetadataModel::playParametersAudibilityChanged(bool ) { } @@ -169,7 +169,7 @@ { if (!index.isValid()) return QVariant(); - QObject *obj = static_cast(index.internalPointer()); +// QObject *obj = static_cast(index.internalPointer()); int row = index.row(), col = index.column(); //!!! not exactly the ideal use of a std::set @@ -206,13 +206,13 @@ } bool -ModelMetadataModel::setData(const QModelIndex &index, const QVariant &value, int role) +ModelMetadataModel::setData(const QModelIndex &, const QVariant &, int ) { return false; } Qt::ItemFlags -ModelMetadataModel::flags(const QModelIndex &index) const +ModelMetadataModel::flags(const QModelIndex &) const { Qt::ItemFlags flags = Qt::ItemIsEnabled; return flags; @@ -237,7 +237,7 @@ ModelMetadataModel::index(int row, int column, const QModelIndex &parent) const { if (!parent.isValid()) { - if (row >= m_models.size()) return QModelIndex(); + if (row >= (int)m_models.size()) return QModelIndex(); return createIndex(row, column, (void *)0); } @@ -245,7 +245,7 @@ } QModelIndex -ModelMetadataModel::parent(const QModelIndex &index) const +ModelMetadataModel::parent(const QModelIndex &) const { return QModelIndex(); } @@ -258,7 +258,7 @@ } int -ModelMetadataModel::columnCount(const QModelIndex &parent) const +ModelMetadataModel::columnCount(const QModelIndex &) const { return m_columnCount; } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/ModelDataTableDialog.cpp --- a/widgets/ModelDataTableDialog.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/ModelDataTableDialog.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -168,14 +168,14 @@ } void -ModelDataTableDialog::userScrolledToFrame(unsigned long frame) +ModelDataTableDialog::userScrolledToFrame(int frame) { QModelIndex index = m_table->getModelIndexForFrame(frame); makeCurrent(index.row()); } void -ModelDataTableDialog::playbackScrolledToFrame(unsigned long frame) +ModelDataTableDialog::playbackScrolledToFrame(int frame) { if (m_trackPlayback) { QModelIndex index = m_table->getModelIndexForFrame(frame); @@ -248,14 +248,14 @@ } void -ModelDataTableDialog::viewPressed(const QModelIndex &index) +ModelDataTableDialog::viewPressed(const QModelIndex &) { // SVDEBUG << "ModelDataTableDialog::viewPressed: " << index.row() << ", " << index.column() << endl; } void ModelDataTableDialog::currentChanged(const QModelIndex ¤t, - const QModelIndex &previous) + const QModelIndex &) { // SVDEBUG << "ModelDataTableDialog::currentChanged: from " // << previous.row() << ", " << previous.column() diff -r 4c8ca536b54f -r e4773943c9c1 widgets/ModelDataTableDialog.h --- a/widgets/ModelDataTableDialog.h Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/ModelDataTableDialog.h Tue Jun 17 15:55:27 2014 +0100 @@ -38,11 +38,11 @@ QToolBar *getPlayToolbar() { return m_playToolbar; } signals: - void scrollToFrame(unsigned long frame); + void scrollToFrame(int frame); public slots: - void userScrolledToFrame(unsigned long frame); - void playbackScrolledToFrame(unsigned long frame); + void userScrolledToFrame(int frame); + void playbackScrolledToFrame(int frame); void addCommand(Command *); protected slots: diff -r 4c8ca536b54f -r e4773943c9c1 widgets/PluginParameterBox.cpp --- a/widgets/PluginParameterBox.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/PluginParameterBox.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -331,10 +331,10 @@ value = min + step * qtz; } - int imax = 100; +// int imax = 100; if (qtz > 0.0) { - imax = lrintf((max - min) / qtz); +// imax = lrintf((max - min) / qtz); } else { qtz = (max - min) / 100.0; } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/PluginParameterDialog.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -51,7 +51,7 @@ m_blockSize(0), m_windowType(HanningWindow), m_parameterBox(0), - m_selectionOnly(false) + m_currentSelectionOnly(false) { setWindowTitle(tr("Plugin Parameters")); @@ -540,15 +540,15 @@ } void -PluginParameterDialog::getProcessingParameters(size_t &blockSize) const +PluginParameterDialog::getProcessingParameters(int &blockSize) const { blockSize = m_blockSize; return; } void -PluginParameterDialog::getProcessingParameters(size_t &stepSize, - size_t &blockSize, +PluginParameterDialog::getProcessingParameters(int &stepSize, + int &blockSize, WindowType &windowType) const { stepSize = m_stepSize; diff -r 4c8ca536b54f -r e4773943c9c1 widgets/PluginParameterDialog.h --- a/widgets/PluginParameterDialog.h Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/PluginParameterDialog.h Tue Jun 17 15:55:27 2014 +0100 @@ -70,8 +70,8 @@ //!!! merge with PluginTransform::ExecutionContext - void getProcessingParameters(size_t &blockSize) const; - void getProcessingParameters(size_t &stepSize, size_t &blockSize, + void getProcessingParameters(int &blockSize) const; + void getProcessingParameters(int &stepSize, int &blockSize, WindowType &windowType) const; int exec(); @@ -96,8 +96,8 @@ Vamp::PluginBase *m_plugin; int m_channel; - size_t m_stepSize; - size_t m_blockSize; + int m_stepSize; + int m_blockSize; WindowType m_windowType; PluginParameterBox *m_parameterBox; diff -r 4c8ca536b54f -r e4773943c9c1 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/PropertyBox.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -517,6 +517,7 @@ break; } + case PropertyContainer::InvalidProperty: default: break; } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/PropertyStack.cpp --- a/widgets/PropertyStack.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/PropertyStack.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -96,7 +96,7 @@ } m_boxes.clear(); - for (size_t i = 0; i < m_client->getPropertyContainerCount(); ++i) { + for (int i = 0; i < m_client->getPropertyContainerCount(); ++i) { PropertyContainer *container = m_client->getPropertyContainer(i); QString name = container->getPropertyContainerName(); @@ -147,7 +147,7 @@ bool PropertyStack::containsContainer(PropertyContainer *pc) const { - for (size_t i = 0; i < m_client->getPropertyContainerCount(); ++i) { + for (int i = 0; i < m_client->getPropertyContainerCount(); ++i) { PropertyContainer *container = m_client->getPropertyContainer(i); if (pc == container) return true; } diff -r 4c8ca536b54f -r e4773943c9c1 widgets/SubdividingMenu.cpp --- a/widgets/SubdividingMenu.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/SubdividingMenu.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -22,7 +22,7 @@ using std::set; using std::map; -SubdividingMenu::SubdividingMenu(size_t lowerLimit, size_t upperLimit, +SubdividingMenu::SubdividingMenu(int lowerLimit, int upperLimit, QWidget *parent) : QMenu(parent), m_lowerLimit(lowerLimit ? lowerLimit : 14), @@ -31,8 +31,8 @@ { } -SubdividingMenu::SubdividingMenu(const QString &title, size_t lowerLimit, - size_t upperLimit, QWidget *parent) : +SubdividingMenu::SubdividingMenu(const QString &title, int lowerLimit, + int upperLimit, QWidget *parent) : QMenu(title, parent), m_lowerLimit(lowerLimit ? lowerLimit : 14), m_upperLimit(upperLimit ? upperLimit : (m_lowerLimit * 5) / 2), @@ -53,11 +53,11 @@ { m_entriesSet = true; - size_t total = entries.size(); + int total = entries.size(); if (total < m_upperLimit) return; - size_t count = 0; + int count = 0; QMenu *chunkMenu = new QMenu(); chunkMenu->setTearOffEnabled(isTearOffEnabled()); diff -r 4c8ca536b54f -r e4773943c9c1 widgets/SubdividingMenu.h --- a/widgets/SubdividingMenu.h Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/SubdividingMenu.h Tue Jun 17 15:55:27 2014 +0100 @@ -39,10 +39,10 @@ Q_OBJECT public: - SubdividingMenu(size_t lowerLimit = 0, size_t upperLimit = 0, + SubdividingMenu(int lowerLimit = 0, int upperLimit = 0, QWidget *parent = 0); - SubdividingMenu(const QString &title, size_t lowerLimit = 0, - size_t upperLimit = 0, QWidget *parent = 0); + SubdividingMenu(const QString &title, int lowerLimit = 0, + int upperLimit = 0, QWidget *parent = 0); virtual ~SubdividingMenu(); void setEntries(const std::set &entries); @@ -65,8 +65,8 @@ protected: std::map m_nameToChunkMenuMap; - size_t m_lowerLimit; - size_t m_upperLimit; + int m_lowerLimit; + int m_upperLimit; bool m_entriesSet; std::map m_pendingEntries; diff -r 4c8ca536b54f -r e4773943c9c1 widgets/TransformFinder.cpp --- a/widgets/TransformFinder.cpp Tue Jun 17 15:36:56 2014 +0100 +++ b/widgets/TransformFinder.cpp Tue Jun 17 15:55:27 2014 +0100 @@ -201,7 +201,7 @@ j != sorted.begin(); ) { --j; m_sortedResults.push_back(*j); - if (m_sortedResults.size() == maxResults) break; + if ((int)m_sortedResults.size() == maxResults) break; } if (m_sortedResults.empty()) m_selectedTransform = ""; @@ -209,7 +209,7 @@ m_upToDateCount = 0; - for (int j = m_labels.size(); j > m_sortedResults.size(); ) { + for (int j = (int)m_labels.size(); j > (int)m_sortedResults.size(); ) { m_labels[--j]->hide(); } @@ -235,9 +235,9 @@ return; } - if (m_upToDateCount >= m_sortedResults.size()) return; + if (m_upToDateCount >= (int)m_sortedResults.size()) return; - while (m_upToDateCount < m_sortedResults.size()) { + while (m_upToDateCount < (int)m_sortedResults.size()) { int i = m_upToDateCount; @@ -302,7 +302,7 @@ } selectedText += tr(""); - if (i >= m_labels.size()) { + if (i >= (int)m_labels.size()) { SelectableLabel *label = new SelectableLabel(m_resultsFrame); m_resultsLayout->addWidget(label); connect(label, SIGNAL(selectionChanged()), this, @@ -338,7 +338,7 @@ { QObject *s = sender(); m_selectedTransform = ""; - for (int i = 0; i < m_labels.size(); ++i) { + for (int i = 0; i < (int)m_labels.size(); ++i) { if (!m_labels[i]->isVisible()) continue; if (m_labels[i] == s) { if (m_labels[i]->isSelected()) { @@ -374,7 +374,7 @@ void TransformFinder::up() { - for (int i = 0; i < m_labels.size(); ++i) { + for (int i = 0; i < (int)m_labels.size(); ++i) { if (!m_labels[i]->isVisible()) continue; if (m_labels[i]->objectName() == m_selectedTransform) { if (i > 0) { @@ -390,10 +390,10 @@ void TransformFinder::down() { - for (int i = 0; i < m_labels.size(); ++i) { + for (int i = 0; i < (int)m_labels.size(); ++i) { if (!m_labels[i]->isVisible()) continue; if (m_labels[i]->objectName() == m_selectedTransform) { - if (i+1 < m_labels.size() && + if (i+1 < (int)m_labels.size() && m_labels[i+1]->isVisible()) { m_labels[i]->setSelected(false); m_labels[i+1]->setSelected(true);