]> sigrok.org Git - pulseview.git/commitdiff
Various tidyups in LogicSnapshot
authorJoel Holdsworth <redacted>
Sat, 16 Mar 2013 10:11:18 +0000 (10:11 +0000)
committerJoel Holdsworth <redacted>
Thu, 21 Mar 2013 22:44:18 +0000 (22:44 +0000)
pv/data/logicsnapshot.cpp
pv/data/logicsnapshot.h

index af6ac0e8c367a097372aeea376cef6c101785e8b..e6fd26e33b68f742a8547894487ddf7f719a5bd3 100644 (file)
@@ -70,7 +70,7 @@ void LogicSnapshot::append_payload(
        append_payload_to_mipmap();
 }
 
-void LogicSnapshot::reallocate_mip_map(MipMapLevel &m)
+void LogicSnapshot::reallocate_mipmap_level(MipMapLevel &m)
 {
        const uint64_t new_data_length = ((m.length + MipMapDataUnit - 1) /
                MipMapDataUnit) * MipMapDataUnit;
@@ -101,14 +101,12 @@ void LogicSnapshot::append_payload_to_mipmap()
        if (m0.length == prev_length)
                return;
 
-       reallocate_mip_map(m0);
+       reallocate_mipmap_level(m0);
 
        dest_ptr = (uint8_t*)m0.data + prev_length * _unit_size;
 
        // Iterate through the samples to populate the first level mipmap
-       accumulator = 0;
-       diff_counter = MipMapScaleFactor;
-       const uint8_t *end_src_ptr = (uint8_t*)_data +
+       const uint8_t *const end_src_ptr = (uint8_t*)_data +
                m0.length * _unit_size * MipMapScaleFactor;
        for (src_ptr = (uint8_t*)_data +
                prev_length * _unit_size * MipMapScaleFactor;
@@ -143,12 +141,12 @@ void LogicSnapshot::append_payload_to_mipmap()
                if (m.length == prev_length)
                        break;
 
-               reallocate_mip_map(m);
+               reallocate_mipmap_level(m);
 
                // Subsample the level lower level
                src_ptr = (uint8_t*)ml.data +
                        _unit_size * prev_length * MipMapScaleFactor;
-               const uint8_t *end_dest_ptr =
+               const uint8_t *const end_dest_ptr =
                        (uint8_t*)m.data + _unit_size * m.length;
                for (dest_ptr = (uint8_t*)m.data +
                        _unit_size * prev_length;
index 8a851ac203539e92d93fb971b499960afe0d4d7e..9868a212561fb17364cdd98f525c882432675371 100644 (file)
 #include <vector>
 
 namespace LogicSnapshotTest {
-       class Pow2;
-       class Basic;
-       class LargeData;
-       class Pulses;
-       class LongPulses;
+class Pow2;
+class Basic;
+class LargeData;
+class Pulses;
+class LongPulses;
 }
 
 namespace pv {
@@ -65,7 +65,7 @@ public:
        void append_payload(const sr_datafeed_logic &logic);
 
 private:
-       void reallocate_mip_map(MipMapLevel &m);
+       void reallocate_mipmap_level(MipMapLevel &m);
 
        void append_payload_to_mipmap();