changeset 1745:074b860a7828 by-id

Use reference rather than bare pointer
author Chris Cannam
date Tue, 02 Jul 2019 14:08:25 +0100
parents b92bdcd4954b
children 826e0cb77d8e
files data/model/WaveformOversampler.cpp data/model/WaveformOversampler.h data/model/test/TestWaveformOversampler.h
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/WaveformOversampler.cpp	Tue Jul 02 11:49:28 2019 +0100
+++ b/data/model/WaveformOversampler.cpp	Tue Jul 02 14:08:25 2019 +0100
@@ -19,7 +19,7 @@
 #include "data/model/DenseTimeValueModel.h"
 
 floatvec_t
-WaveformOversampler::getOversampledData(const DenseTimeValueModel *source,
+WaveformOversampler::getOversampledData(const DenseTimeValueModel &source,
                                         int channel,
                                         sv_frame_t sourceStartFrame,
                                         sv_frame_t sourceFrameCount,
@@ -53,14 +53,14 @@
 }
 
 floatvec_t
-WaveformOversampler::getFixedRatioData(const DenseTimeValueModel *source,
+WaveformOversampler::getFixedRatioData(const DenseTimeValueModel &source,
                                        int channel,
                                        sv_frame_t sourceStartFrame,
                                        sv_frame_t sourceFrameCount)
 {
     Profiler profiler("WaveformOversampler::getFixedRatioData");
     
-    sv_frame_t sourceLength = source->getEndFrame();
+    sv_frame_t sourceLength = source.getEndFrame();
     
     if (sourceStartFrame + sourceFrameCount > sourceLength) {
         sourceFrameCount = sourceLength - sourceStartFrame;
@@ -84,7 +84,7 @@
         i1 = sourceLength;
     }
     
-    floatvec_t sourceData = source->getData(channel, i0, i1 - i0);
+    floatvec_t sourceData = source.getData(channel, i0, i1 - i0);
     
     for (sv_frame_t i = i0; i < i1; ++i) {
         float v = sourceData[i - i0];
--- a/data/model/WaveformOversampler.h	Tue Jul 02 11:49:28 2019 +0100
+++ b/data/model/WaveformOversampler.h	Tue Jul 02 14:08:25 2019 +0100
@@ -38,14 +38,14 @@
      *  will have sourceFrameCount * oversampleBy samples, except when
      *  truncated because the end of the model was reached.
      */
-    static floatvec_t getOversampledData(const DenseTimeValueModel *source,
+    static floatvec_t getOversampledData(const DenseTimeValueModel &source,
                                          int channel,
                                          sv_frame_t sourceStartFrame,
                                          sv_frame_t sourceFrameCount,
                                          int oversampleBy);
 
 private:
-    static floatvec_t getFixedRatioData(const DenseTimeValueModel *source,
+    static floatvec_t getFixedRatioData(const DenseTimeValueModel &source,
                                         int channel,
                                         sv_frame_t sourceStartFrame,
                                         sv_frame_t sourceFrameCount);
--- a/data/model/test/TestWaveformOversampler.h	Tue Jul 02 11:49:28 2019 +0100
+++ b/data/model/test/TestWaveformOversampler.h	Tue Jul 02 14:08:25 2019 +0100
@@ -72,7 +72,7 @@
                    sv_frame_t sourceFrameCount,
                    int oversampleBy) {
         return WaveformOversampler::getOversampledData
-            (m_sourceModel, 0,
+            (*m_sourceModel, 0,
              sourceStartFrame, sourceFrameCount, oversampleBy);
     }