From 7f2febeec98480738f0ea7987e94f71a0ee1e7e1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 17 Oct 2017 22:13:37 -0400 Subject: [PATCH] Ensures complete DPLL initial state assignment. --- Storage/Disk/DPLL/DigitalPhaseLockedLoop.cpp | 8 ++------ Storage/Disk/DPLL/DigitalPhaseLockedLoop.hpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Storage/Disk/DPLL/DigitalPhaseLockedLoop.cpp b/Storage/Disk/DPLL/DigitalPhaseLockedLoop.cpp index 8348049c9..ec3c5bbb1 100644 --- a/Storage/Disk/DPLL/DigitalPhaseLockedLoop.cpp +++ b/Storage/Disk/DPLL/DigitalPhaseLockedLoop.cpp @@ -13,13 +13,9 @@ using namespace Storage; DigitalPhaseLockedLoop::DigitalPhaseLockedLoop(int clocks_per_bit, size_t length_of_history) : - clocks_per_bit_(clocks_per_bit), - phase_(0), - window_length_(clocks_per_bit), - offset_history_pointer_(0), offset_history_(length_of_history, 0), - offset_(0), - delegate_(nullptr) {} + window_length_(clocks_per_bit), + clocks_per_bit_(clocks_per_bit) {} void DigitalPhaseLockedLoop::run_for(const Cycles cycles) { offset_ += cycles.as_int(); diff --git a/Storage/Disk/DPLL/DigitalPhaseLockedLoop.hpp b/Storage/Disk/DPLL/DigitalPhaseLockedLoop.hpp index 9cd081252..ecce97bbe 100644 --- a/Storage/Disk/DPLL/DigitalPhaseLockedLoop.hpp +++ b/Storage/Disk/DPLL/DigitalPhaseLockedLoop.hpp @@ -50,20 +50,20 @@ class DigitalPhaseLockedLoop { } private: - Delegate *delegate_; + Delegate *delegate_ = nullptr; void post_phase_offset(int phase, int offset); std::vector offset_history_; - size_t offset_history_pointer_; - int offset_; + size_t offset_history_pointer_ = 0; + int offset_ = 0; - int phase_; - int window_length_; - bool window_was_filled_; + int phase_ = 0; + int window_length_ = 0; + bool window_was_filled_ = false; - int clocks_per_bit_; - int tolerance_; + int clocks_per_bit_ = 0; + int tolerance_ = 0; }; }