]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logicsegment.cpp
Random simplifications, cosmetics/whitespace/consistency fixes.
[pulseview.git] / pv / data / logicsegment.cpp
index fcf572297e689f87762eabc81df96207df3000dc..cbaf54a47c132a3d192e530e59e5ee1f6efda586 100644 (file)
@@ -33,7 +33,6 @@ using std::lock_guard;
 using std::recursive_mutex;
 using std::max;
 using std::min;
-using std::pair;
 using std::shared_ptr;
 using std::vector;
 
@@ -45,18 +44,7 @@ namespace data {
 const int LogicSegment::MipMapScalePower = 4;
 const int LogicSegment::MipMapScaleFactor = 1 << MipMapScalePower;
 const float LogicSegment::LogMipMapScaleFactor = logf(MipMapScaleFactor);
-const uint64_t LogicSegment::MipMapDataUnit = 64*1024; // bytes
-
-LogicSegment::LogicSegment(pv::data::Logic& owner, shared_ptr<sigrok::Logic> data,
-       uint64_t samplerate) :
-       Segment(samplerate, data->unit_size()),
-       owner_(owner),
-       last_append_sample_(0)
-{
-       lock_guard<recursive_mutex> lock(mutex_);
-       memset(mip_map_, 0, sizeof(mip_map_));
-       append_payload(data);
-}
+const uint64_t LogicSegment::MipMapDataUnit = 64 * 1024; // bytes
 
 LogicSegment::LogicSegment(pv::data::Logic& owner, unsigned int unit_size,
        uint64_t samplerate) :
@@ -189,7 +177,7 @@ const uint8_t* LogicSegment::get_samples(int64_t start_sample,
 
        lock_guard<recursive_mutex> lock(mutex_);
 
-       return get_raw_samples(start_sample, (end_sample-start_sample));
+       return get_raw_samples(start_sample, (end_sample - start_sample));
 }
 
 SegmentLogicDataIterator* LogicSegment::begin_sample_iteration(uint64_t start)
@@ -269,7 +257,7 @@ void LogicSegment::append_payload_to_mipmap()
        // Compute higher level mipmaps
        for (unsigned int level = 1; level < ScaleStepCount; level++) {
                MipMapLevel &m = mip_map_[level];
-               const MipMapLevel &ml = mip_map_[level-1];
+               const MipMapLevel &ml = mip_map_[level - 1];
 
                // Expand the data buffer to fit the new samples
                prev_length = m.length;