# HG changeset patch # User Chris Cannam # Date 1543242846 0 # Node ID e2715204feaa72e6aa51c4e7c93f65354a7ded4f # Parent 26a0cb8335e39dd97e503bcfe03c74d9c8769816 Use nullptr throughout diff -r 26a0cb8335e3 -r e2715204feaa audio/AudioCallbackPlaySource.cpp --- a/audio/AudioCallbackPlaySource.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/audio/AudioCallbackPlaySource.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -50,8 +50,8 @@ m_viewManager(manager), m_audioGenerator(new AudioGenerator()), m_clientName(clientName.toUtf8().data()), - m_readBuffers(0), - m_writeBuffers(0), + m_readBuffers(nullptr), + m_writeBuffers(nullptr), m_readBufferFill(0), m_writeBufferFill(0), m_bufferScavenger(1), @@ -61,7 +61,7 @@ m_deviceSampleRate(0), m_deviceChannelCount(0), m_playLatency(0), - m_target(0), + m_target(nullptr), m_lastRetrievalTimestamp(0.0), m_lastRetrievedBlockSize(0), m_trustworthyTimestamps(true), @@ -73,19 +73,19 @@ m_outputLeft(0.0), m_outputRight(0.0), m_levelsSet(false), - m_auditioningPlugin(0), + m_auditioningPlugin(nullptr), m_auditioningPluginBypassed(false), m_playStartFrame(0), m_playStartFramePassed(false), - m_timeStretcher(0), - m_monoStretcher(0), + m_timeStretcher(nullptr), + m_monoStretcher(nullptr), m_stretchRatio(1.0), m_stretchMono(false), m_stretcherInputCount(0), - m_stretcherInputs(0), - m_stretcherInputSizes(0), - m_fillThread(0), - m_resamplerWrapper(0) + m_stretcherInputs(nullptr), + m_stretcherInputSizes(nullptr), + m_fillThread(nullptr), + m_resamplerWrapper(nullptr) { m_viewManager->setAudioPlaySource(this); @@ -258,8 +258,8 @@ delete m_timeStretcher; delete m_monoStretcher; - m_timeStretcher = 0; - m_monoStretcher = 0; + m_timeStretcher = nullptr; + m_monoStretcher = nullptr; if (m_stretchRatio != 1.f) { setTimeStretch(m_stretchRatio); @@ -612,7 +612,7 @@ void AudioCallbackPlaySource::setSystemPlaybackTarget(breakfastquay::SystemPlaybackTarget *target) { - if (target == 0) { + if (target == nullptr) { // reset target-related facts and figures m_deviceSampleRate = 0; m_deviceChannelCount = 0; @@ -1400,7 +1400,7 @@ bool AudioCallbackPlaySource::fillBuffers() { - static float *tmp = 0; + static float *tmp = nullptr; static sv_frame_t tmpSize = 0; sv_frame_t space = 0; @@ -1439,7 +1439,7 @@ int channels = getTargetChannelCount(); - static float **bufferPtrs = 0; + static float **bufferPtrs = nullptr; static int bufferPtrCount = 0; if (bufferPtrCount < channels) { @@ -1539,7 +1539,7 @@ } #endif - static float **chunkBufferPtrs = 0; + static float **chunkBufferPtrs = nullptr; static int chunkBufferPtrCount = 0; if (chunkBufferPtrCount < channels) { diff -r 26a0cb8335e3 -r e2715204feaa audio/AudioCallbackRecordTarget.cpp --- a/audio/AudioCallbackRecordTarget.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/audio/AudioCallbackRecordTarget.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -34,8 +34,8 @@ m_recordSampleRate(44100), m_recordChannelCount(2), m_frameCount(0), - m_model(0), - m_buffers(0), + m_model(nullptr), + m_buffers(nullptr), m_bufferCount(0), m_inputLeft(0.f), m_inputRight(0.f), @@ -51,7 +51,7 @@ AudioCallbackRecordTarget::~AudioCallbackRecordTarget() { - m_viewManager->setAudioRecordTarget(0); + m_viewManager->setAudioRecordTarget(nullptr); QMutexLocker locker(&m_bufPtrMutex); for (int c = 0; c < m_bufferCount; ++c) { @@ -217,7 +217,7 @@ AudioCallbackRecordTarget::modelAboutToBeDeleted() { if (sender() == m_model) { - m_model = 0; + m_model = nullptr; m_recording = false; } } @@ -227,14 +227,14 @@ { if (m_recording) { SVCERR << "WARNING: AudioCallbackRecordTarget::startRecording: We are already recording" << endl; - return 0; + return nullptr; } - m_model = 0; + m_model = nullptr; m_frameCount = 0; QString folder = RecordDirectory::getRecordDirectory(); - if (folder == "") return 0; + if (folder == "") return nullptr; QDir recordedDir(folder); QDateTime now = QDateTime::currentDateTime(); @@ -259,8 +259,8 @@ << endl; //!!! and throw? delete m_model; - m_model = 0; - return 0; + m_model = nullptr; + return nullptr; } m_model->setObjectName(label); @@ -290,7 +290,7 @@ updateModel(); m_model->writeComplete(); - m_model = 0; + m_model = nullptr; emit recordStatusChanged(false); emit recordCompleted(); diff -r 26a0cb8335e3 -r e2715204feaa audio/AudioGenerator.cpp --- a/audio/AudioGenerator.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/audio/AudioGenerator.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -50,7 +50,7 @@ m_targetChannelCount(1), m_waveType(0), m_soloing(false), - m_channelBuffer(0), + m_channelBuffer(nullptr), m_channelBufSiz(0), m_channelBufCount(0) { @@ -216,7 +216,7 @@ QString clipId; const Playable *playable = model; - if (!playable || !playable->canPlay()) return 0; + if (!playable || !playable->canPlay()) return nullptr; PlayParameters *parameters = PlayParameterRepository::getInstance()->getPlayParameters(playable); @@ -230,7 +230,7 @@ if (clipId == "") { SVDEBUG << "AudioGenerator::makeClipMixerFor(" << model << "): no sample, skipping" << endl; - return 0; + return nullptr; } ClipMixer *mixer = new ClipMixer(m_targetChannelCount, @@ -244,7 +244,7 @@ double level = wantsQuieterClips(model) ? 0.5 : 1.0; if (!mixer->loadClipData(clipPath, clipF0, level)) { delete mixer; - return 0; + return nullptr; } #ifdef DEBUG_AUDIO_GENERATOR @@ -258,7 +258,7 @@ AudioGenerator::makeSynthFor(const Model *model) { const Playable *playable = model; - if (!playable || !playable->canPlay()) return 0; + if (!playable || !playable->canPlay()) return nullptr; ContinuousSynth *synth = new ContinuousSynth(m_targetChannelCount, m_sourceSampleRate, diff -r 26a0cb8335e3 -r e2715204feaa audio/ClipMixer.cpp --- a/audio/ClipMixer.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/audio/ClipMixer.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -26,7 +26,7 @@ m_channels(channels), m_sampleRate(sampleRate), m_blockSize(blockSize), - m_clipData(0), + m_clipData(nullptr), m_clipLength(0), m_clipF0(0), m_clipRate(0) diff -r 26a0cb8335e3 -r e2715204feaa framework/Align.cpp --- a/framework/Align.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/Align.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -178,7 +178,7 @@ return false; // but this should have been tested already } - while (!reference->isReady(0) || !rm->isReady(0)) { + while (!reference->isReady(nullptr) || !rm->isReady(nullptr)) { qApp->processEvents(); } @@ -203,7 +203,7 @@ m_error = ""; - AlignmentModel *alignmentModel = new AlignmentModel(reference, other, 0, 0); + AlignmentModel *alignmentModel = new AlignmentModel(reference, other, nullptr, nullptr); rm->setAlignment(alignmentModel); QProcess *process = new QProcess; @@ -223,7 +223,7 @@ << endl; m_error = "Alignment program could not be started"; m_processModels.erase(process); - rm->setAlignment(0); // deletes alignmentModel as well + rm->setAlignment(nullptr); // deletes alignmentModel as well delete process; } diff -r 26a0cb8335e3 -r e2715204feaa framework/Document.cpp --- a/framework/Document.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/Document.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -49,7 +49,7 @@ //!!! still need to handle command history, documentRestored/documentModified Document::Document() : - m_mainModel(0), + m_mainModel(nullptr), m_autoAlignment(false), m_align(new Align()), m_isIncomplete(false) @@ -115,7 +115,7 @@ emit modelAboutToBeDeleted(m_mainModel); } - emit mainModelChanged(0); + emit mainModelChanged(nullptr); delete m_mainModel; } @@ -123,7 +123,7 @@ Document::createLayer(LayerFactory::LayerType type) { Layer *newLayer = LayerFactory::getInstance()->createLayer(type); - if (!newLayer) return 0; + if (!newLayer) return nullptr; newLayer->setObjectName(getUniqueLayerName(newLayer->objectName())); @@ -143,7 +143,7 @@ Document::createMainModelLayer(LayerFactory::LayerType type) { Layer *newLayer = createLayer(type); - if (!newLayer) return 0; + if (!newLayer) return nullptr; setModel(newLayer, m_mainModel); return newLayer; } @@ -156,14 +156,14 @@ if (types.empty()) { cerr << "WARNING: Document::importLayer: no valid display layer for model" << endl; - return 0; + return nullptr; } //!!! for now, just use the first suitable layer type LayerFactory::LayerType type = *types.begin(); Layer *newLayer = LayerFactory::getInstance()->createLayer(type); - if (!newLayer) return 0; + if (!newLayer) return nullptr; newLayer->setObjectName(getUniqueLayerName(newLayer->objectName())); @@ -187,16 +187,16 @@ Layer * Document::createEmptyLayer(LayerFactory::LayerType type) { - if (!m_mainModel) return 0; + if (!m_mainModel) return nullptr; Model *newModel = LayerFactory::getInstance()->createEmptyModel(type, m_mainModel); - if (!newModel) return 0; + if (!newModel) return nullptr; Layer *newLayer = createLayer(type); if (!newLayer) { delete newModel; - return 0; + return nullptr; } addImportedModel(newModel); @@ -210,7 +210,7 @@ TransformId transform) { Layer *newLayer = createLayer(type); - if (!newLayer) return 0; + if (!newLayer) return nullptr; newLayer->setObjectName(getUniqueLayerName (TransformFactory::getInstance()-> @@ -226,7 +226,7 @@ Transforms transforms; transforms.push_back(transform); vector layers = createDerivedLayers(transforms, input); - if (layers.empty()) return 0; + if (layers.empty()) return nullptr; else return layers[0]; } @@ -235,7 +235,7 @@ const ModelTransformer::Input &input) { QString message; - vector newModels = addDerivedModels(transforms, input, message, 0); + vector newModels = addDerivedModels(transforms, input, message, nullptr); if (newModels.empty()) { //!!! This identifier may be wrong! @@ -640,7 +640,7 @@ } ModelRecord rec; - rec.source = 0; + rec.source = nullptr; rec.channel = 0; rec.refcount = 0; rec.additional = false; @@ -676,7 +676,7 @@ } ModelRecord rec; - rec.source = 0; + rec.source = nullptr; rec.channel = 0; rec.refcount = 0; rec.additional = true; @@ -732,8 +732,8 @@ Transforms tt; tt.push_back(transform); - vector mm = addDerivedModels(tt, input, message, 0); - if (mm.empty()) return 0; + vector mm = addDerivedModels(tt, input, message, nullptr); + if (mm.empty()) return nullptr; else return mm[0]; } @@ -783,7 +783,7 @@ void Document::releaseModel(Model *model) // Will _not_ release main model! { - if (model == 0) { + if (model == nullptr) { return; } @@ -818,7 +818,7 @@ for (ModelMap::iterator i = m_models.begin(); i != m_models.end(); ++i) { if (i->second.source == model) { ++sourceCount; - i->second.source = 0; + i->second.source = nullptr; } } @@ -1101,7 +1101,7 @@ // unaligned model just by looking at the model itself, // without also knowing what the main model is SVDEBUG << "Document::alignModel(" << model << "): is main model, setting appropriately" << endl; - rm->setAlignment(new AlignmentModel(model, model, 0, 0)); + rm->setAlignment(new AlignmentModel(model, model, nullptr, nullptr)); return; } diff -r 26a0cb8335e3 -r e2715204feaa framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/MainWindowBase.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -137,32 +137,32 @@ #endif MainWindowBase::MainWindowBase(SoundOptions options) : - m_document(0), - m_paneStack(0), - m_viewManager(0), - m_timeRulerLayer(0), + m_document(nullptr), + m_paneStack(nullptr), + m_viewManager(nullptr), + m_timeRulerLayer(nullptr), m_soundOptions(options), - m_playSource(0), - m_recordTarget(0), - m_resamplerWrapper(0), - m_playTarget(0), - m_audioIO(0), - m_oscQueue(0), - m_oscQueueStarter(0), - m_midiInput(0), + m_playSource(nullptr), + m_recordTarget(nullptr), + m_resamplerWrapper(nullptr), + m_playTarget(nullptr), + m_audioIO(nullptr), + m_oscQueue(nullptr), + m_oscQueueStarter(nullptr), + m_midiInput(nullptr), m_recentFiles("RecentFiles", 20), m_recentTransforms("RecentTransforms", 20), m_documentModified(false), m_openingAudioFile(false), m_abandoning(false), - m_labeller(0), + m_labeller(nullptr), m_lastPlayStatusSec(0), m_initialDarkBackground(false), m_defaultFfwdRwdStep(2, 0), m_audioRecordMode(RecordCreateAdditionalModel), - m_statusLabel(0), + m_statusLabel(nullptr), m_iconsVisibleInMenus(true), - m_menuShortcutMapper(0) + m_menuShortcutMapper(nullptr) { Profiler profiler("MainWindowBase::MainWindowBase"); @@ -219,7 +219,7 @@ } #endif - m_paneStack = new PaneStack(0, m_viewManager); + m_paneStack = new PaneStack(nullptr, m_viewManager); connect(m_paneStack, SIGNAL(currentPaneChanged(Pane *)), this, SLOT(currentPaneChanged(Pane *))); connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)), @@ -328,7 +328,7 @@ delete m_viewManager; delete m_midiInput; - disconnect(m_oscQueueStarter, 0, 0, 0); + disconnect(m_oscQueueStarter, nullptr, nullptr, nullptr); m_oscQueueStarter->wait(1000); if (m_oscQueueStarter->isRunning()) { m_oscQueueStarter->terminate(); @@ -353,7 +353,7 @@ SVDEBUG << "MainWindowBase::finaliseMenus called" << endl; delete m_menuShortcutMapper; - m_menuShortcutMapper = 0; + m_menuShortcutMapper = nullptr; foreach (QShortcut *sc, m_appShortcuts) { delete sc; @@ -524,9 +524,9 @@ FileFinder *ff = FileFinder::getInstance(); if (type == FileFinder::AnyFile) { - if (getMainModel() != 0 && - m_paneStack != 0 && - m_paneStack->getCurrentPane() != 0) { // can import a layer + if (getMainModel() != nullptr && + m_paneStack != nullptr && + m_paneStack->getCurrentPane() != nullptr) { // can import a layer return ff->getOpenFileName(FileFinder::AnyFile, m_sessionFile); } else { return ff->getOpenFileName(FileFinder::SessionOrAudioFile, @@ -584,8 +584,8 @@ void MainWindowBase::updateMenuStates() { - Pane *currentPane = 0; - Layer *currentLayer = 0; + Pane *currentPane = nullptr; + Layer *currentLayer = nullptr; if (m_paneStack) currentPane = m_paneStack->getCurrentPane(); if (currentPane) currentLayer = currentPane->getSelectedLayer(); @@ -612,14 +612,14 @@ } bool haveCurrentPane = - (currentPane != 0); + (currentPane != nullptr); bool haveCurrentLayer = (haveCurrentPane && - (currentLayer != 0)); + (currentLayer != nullptr)); bool haveMainModel = - (getMainModel() != 0); + (getMainModel() != nullptr); bool havePlayTarget = - (m_playTarget != 0 || m_audioIO != 0); + (m_playTarget != nullptr || m_audioIO != nullptr); bool haveSelection = (m_viewManager && !m_viewManager->getSelections().empty()); @@ -764,7 +764,7 @@ if (m_viewManager->getPlaySoloMode()) { currentPaneChanged(m_paneStack->getCurrentPane()); } else { - m_viewManager->setPlaybackModel(0); + m_viewManager->setPlaybackModel(nullptr); if (m_playSource) { m_playSource->clearSoloModelSet(); } @@ -782,7 +782,7 @@ if (!(m_viewManager && m_playSource && m_viewManager->getPlaySoloMode())) { - if (m_viewManager) m_viewManager->setPlaybackModel(0); + if (m_viewManager) m_viewManager->setPlaybackModel(nullptr); return; } @@ -1166,7 +1166,7 @@ } m_labeller->label - (point, havePrevPoint ? &prevPoint : 0); + (point, havePrevPoint ? &prevPoint : nullptr); if (m_labeller->actingOnPrevPoint() && havePrevPoint) { command->addPoint(prevPoint); @@ -1216,7 +1216,7 @@ if (alignedStart >= alignedEnd) return; sv_frame_t alignedDuration = alignedEnd - alignedStart; - Command *c = 0; + Command *c = nullptr; QString name = tr("Add Item at %1 s") .arg(RealTime::frame2RealTime @@ -1377,9 +1377,9 @@ if (!source.isAvailable()) return FileOpenFailed; source.waitForData(); - bool canImportLayer = (getMainModel() != 0 && - m_paneStack != 0 && - m_paneStack->getCurrentPane() != 0); + bool canImportLayer = (getMainModel() != nullptr && + m_paneStack != nullptr && + m_paneStack->getCurrentPane() != nullptr); bool rdf = (source.getExtension().toLower() == "rdf" || source.getExtension().toLower() == "n3" || @@ -1707,7 +1707,7 @@ // know whether the pane contains a waveform model at all. Pane *pane = m_paneStack->getCurrentPane(); - Layer *replace = 0; + Layer *replace = nullptr; for (int i = 0; i < pane->getLayerCount(); ++i) { Layer *layer = pane->getLayer(i); @@ -2072,9 +2072,9 @@ } } - QXmlInputSource *inputSource = 0; - BZipFileDevice *bzFile = 0; - QFile *rawFile = 0; + QXmlInputSource *inputSource = nullptr; + BZipFileDevice *bzFile = nullptr; + QFile *rawFile = nullptr; if (source.getExtension().toLower() == sessionExt) { bzFile = new BZipFileDevice(source.getLocalFilename()); @@ -2198,8 +2198,8 @@ if (!source.isAvailable()) return FileOpenFailed; source.waitForData(); - QXmlInputSource *inputSource = 0; - QFile *file = 0; + QXmlInputSource *inputSource = nullptr; + QFile *file = nullptr; file = new QFile(source.getLocalFilename()); inputSource = new QXmlInputSource(file); @@ -2342,7 +2342,7 @@ if (w) { Pane *pane = addPaneToStack(); - Layer *layer = 0; + Layer *layer = nullptr; if (m_timeRulerLayer) { m_document->addLayerToView(pane, m_timeRulerLayer); @@ -2561,8 +2561,8 @@ { // First prevent this trying to call target. if (m_playSource) { - m_playSource->setSystemPlaybackTarget(0); - m_playSource->setResamplerWrapper(0); + m_playSource->setSystemPlaybackTarget(nullptr); + m_playSource->setResamplerWrapper(nullptr); } // Then delete the breakfastquay::System object. @@ -2575,9 +2575,9 @@ // of the use cases for recreateAudioIO() calling this delete m_resamplerWrapper; - m_audioIO = 0; - m_playTarget = 0; - m_resamplerWrapper = 0; + m_audioIO = nullptr; + m_playTarget = nullptr; + m_resamplerWrapper = nullptr; } void @@ -2604,14 +2604,14 @@ WaveFileModel * MainWindowBase::getMainModel() { - if (!m_document) return 0; + if (!m_document) return nullptr; return m_document->getMainModel(); } const WaveFileModel * MainWindowBase::getMainModel() const { - if (!m_document) return 0; + if (!m_document) return nullptr; return m_document->getMainModel(); } @@ -2905,7 +2905,7 @@ if (m_timeRulerLayer) { SVCERR << "WARNING: Time ruler layer was not reset to 0 before session template loaded?" << endl; delete m_timeRulerLayer; - m_timeRulerLayer = 0; + m_timeRulerLayer = nullptr; } } @@ -3430,7 +3430,7 @@ MainWindowBase::getSnapLayer() const { Pane *pane = m_paneStack->getCurrentPane(); - if (!pane) return 0; + if (!pane) return nullptr; Layer *layer = pane->getSelectedLayer(); @@ -3439,7 +3439,7 @@ !dynamic_cast(layer) && !dynamic_cast(layer)) { - layer = 0; + layer = nullptr; for (int i = pane->getLayerCount(); i > 0; --i) { Layer *l = pane->getLayer(i-1); @@ -3480,8 +3480,8 @@ MainWindowBase::AddPaneCommand::AddPaneCommand(MainWindowBase *mw) : m_mw(mw), - m_pane(0), - m_prevCurrentPane(0), + m_pane(nullptr), + m_prevCurrentPane(nullptr), m_added(false) { } @@ -3527,7 +3527,7 @@ MainWindowBase::RemovePaneCommand::RemovePaneCommand(MainWindowBase *mw, Pane *pane) : m_mw(mw), m_pane(pane), - m_prevCurrentPane(0), + m_prevCurrentPane(nullptr), m_added(true) { } @@ -3603,7 +3603,7 @@ void MainWindowBase::editCurrentLayer() { - Layer *layer = 0; + Layer *layer = nullptr; Pane *pane = m_paneStack->getCurrentPane(); if (pane) layer = pane->getSelectedLayer(); if (!layer) return; @@ -3723,7 +3723,7 @@ if (currentPane->getFixedOrderLayer(i) == currentLayer) { if (i == 0) { m_paneStack->setCurrentLayer - (currentPane, 0); // pane + (currentPane, nullptr); // pane } else { m_paneStack->setCurrentLayer (currentPane, currentPane->getFixedOrderLayer(i-1)); @@ -3758,7 +3758,7 @@ if (currentPane->getFixedOrderLayer(i) == currentLayer) { if (i == currentPane->getLayerCount()-1) { m_paneStack->setCurrentLayer - (currentPane, 0); // pane + (currentPane, nullptr); // pane } else { m_paneStack->setCurrentLayer (currentPane, currentPane->getFixedOrderLayer(i+1)); @@ -3822,7 +3822,7 @@ MainWindowBase::globalCentreFrameChanged(sv_frame_t ) { if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; - Pane *p = 0; + Pane *p = nullptr; if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; if (!p->getFollowGlobalPan()) return; updateVisibleRangeDisplay(p); @@ -3840,7 +3840,7 @@ } } if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; - Pane *p = 0; + Pane *p = nullptr; if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; if (v == p) updateVisibleRangeDisplay(p); } @@ -3849,7 +3849,7 @@ MainWindowBase::viewZoomLevelChanged(View *v, ZoomLevel, bool ) { if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; - Pane *p = 0; + Pane *p = nullptr; if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; if (v == p) updateVisibleRangeDisplay(p); } @@ -3877,7 +3877,7 @@ if (m_timeRulerLayer && (layer == m_timeRulerLayer)) { // cerr << "(this is the time ruler layer)" << endl; - m_timeRulerLayer = 0; + m_timeRulerLayer = nullptr; } } @@ -3960,7 +3960,7 @@ { // SVDEBUG << "MainWindowBase::modelAboutToBeDeleted(" << model << ")" << endl; if (model == m_viewManager->getPlaybackModel()) { - m_viewManager->setPlaybackModel(0); + m_viewManager->setPlaybackModel(nullptr); } m_playSource->removeModel(model); } @@ -4027,7 +4027,7 @@ void MainWindowBase::inProgressSelectionChanged() { - Pane *currentPane = 0; + Pane *currentPane = nullptr; if (m_paneStack) currentPane = m_paneStack->getCurrentPane(); if (currentPane) { //cerr << "JTEST: mouse event on selection pane" << endl; diff -r 26a0cb8335e3 -r e2715204feaa framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/SVFileReader.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -58,13 +58,13 @@ m_document(document), m_paneCallback(callback), m_location(location), - m_currentPane(0), - m_currentLayer(0), - m_currentDataset(0), - m_currentDerivedModel(0), + m_currentPane(nullptr), + m_currentLayer(nullptr), + m_currentDataset(nullptr), + m_currentDerivedModel(nullptr), m_currentDerivedModelId(-1), - m_currentPlayParameters(0), - m_currentTransformSource(0), + m_currentPlayParameters(nullptr), + m_currentTransformSource(nullptr), m_currentTransformChannel(0), m_currentTransformIsNewStyle(true), m_datasetSeparator(" "), @@ -297,7 +297,7 @@ } } - m_currentDataset = 0; + m_currentDataset = nullptr; } else if (name == "data") { @@ -341,9 +341,9 @@ } m_addedModels.insert(m_currentDerivedModel); - m_currentDerivedModel = 0; + m_currentDerivedModel = nullptr; m_currentDerivedModelId = -1; - m_currentTransformSource = 0; + m_currentTransformSource = nullptr; m_currentTransform = Transform(); m_currentTransformChannel = -1; @@ -356,7 +356,7 @@ } else if (name == "selections") { m_inSelections = false; } else if (name == "playparameters") { - m_currentPlayParameters = 0; + m_currentPlayParameters = nullptr; } return true; @@ -509,7 +509,7 @@ if (type == "wavefile") { - WaveFileModel *model = 0; + WaveFileModel *model = nullptr; FileFinder *ff = FileFinder::getInstance(); QString originalPath = attributes.value("file"); QString path = ff->find(FileFinder::AudioFile, @@ -544,7 +544,7 @@ model = new ReadOnlyWaveFileModel(file, rate); if (!model->isOK()) { delete model; - model = 0; + model = nullptr; } } @@ -760,7 +760,7 @@ READ_MANDATORY(int, aligned, toInt); READ_MANDATORY(int, path, toInt); - Model *refModel = 0, *alignedModel = 0, *pathModel = 0; + Model *refModel = nullptr, *alignedModel = nullptr, *pathModel = nullptr; if (m_models.find(reference) != m_models.end()) { refModel = m_models[reference]; @@ -788,7 +788,7 @@ if (refModel && alignedModel && pathModel) { AlignmentModel *model = new AlignmentModel - (refModel, alignedModel, 0, 0); + (refModel, alignedModel, nullptr, nullptr); PathModel *pm = dynamic_cast(pathModel); if (!pm) { SVCERR << "WARNING: SV-XML: Model id " << path @@ -817,7 +817,7 @@ SVFileReader::readView(const QXmlAttributes &attributes) { QString type = attributes.value("type"); - m_currentPane = 0; + m_currentPane = nullptr; if (type != "pane") { SVCERR << "WARNING: SV-XML: Unexpected view type \"" @@ -895,7 +895,7 @@ return false; } - Layer *layer = 0; + Layer *layer = nullptr; bool isNewLayer = false; // Layers are expected to be defined in layer elements in the data @@ -977,7 +977,7 @@ // Don't add a layer with an unknown model id // unless it explicitly supports this state m_document->deleteLayer(layer); - m_layers[id] = layer = 0; + m_layers[id] = layer = nullptr; return false; } } @@ -1006,7 +1006,7 @@ } m_currentLayer = layer; - m_inLayer = (layer != 0); + m_inLayer = (layer != nullptr); return true; } @@ -1026,7 +1026,7 @@ int modelId = m_awaitingDatasets[id]; - Model *model = 0; + Model *model = nullptr; if (haveModel(modelId)) { model = m_models[modelId]; } else { @@ -1062,7 +1062,7 @@ if (!good) { SVCERR << "WARNING: SV-XML: Model id " << modelId << " has wrong number of dimensions or inappropriate type for " << dimensions << "-D dataset " << id << endl; - m_currentDataset = 0; + m_currentDataset = nullptr; return false; } @@ -1297,7 +1297,7 @@ m_currentDerivedModel = m_models[modelId]; } else { // we'll regenerate the model when the derivation element ends - m_currentDerivedModel = 0; + m_currentDerivedModel = nullptr; } m_currentDerivedModelId = modelId; @@ -1376,7 +1376,7 @@ bool SVFileReader::readPlayParameters(const QXmlAttributes &attributes) { - m_currentPlayParameters = 0; + m_currentPlayParameters = nullptr; int modelId = 0; bool modelOk = false; diff -r 26a0cb8335e3 -r e2715204feaa framework/TransformUserConfigurator.cpp --- a/framework/TransformUserConfigurator.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/TransformUserConfigurator.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -30,7 +30,7 @@ #include -static QWidget *parentWidget = 0; +static QWidget *parentWidget = nullptr; void TransformUserConfigurator::setParentWidget(QWidget *w) @@ -226,7 +226,7 @@ delete dialog; if (effect && source) { - source->setAuditioningEffect(0); + source->setAuditioningEffect(nullptr); } return ok; diff -r 26a0cb8335e3 -r e2715204feaa framework/VersionTester.cpp --- a/framework/VersionTester.cpp Mon Nov 26 13:53:57 2018 +0000 +++ b/framework/VersionTester.cpp Mon Nov 26 14:34:06 2018 +0000 @@ -29,7 +29,7 @@ VersionTester::VersionTester(QString hostname, QString versionFilePath, QString myVersion) : m_myVersion(myVersion), - m_reply(0), + m_reply(nullptr), m_httpFailed(false), m_nm(new QNetworkAccessManager) { @@ -90,7 +90,7 @@ VersionTester::finished() { QNetworkReply *r = m_reply; - m_reply = 0; + m_reply = nullptr; r->deleteLater(); if (m_httpFailed) return;