diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index c20ca2962..fdbbab1b6 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -46,8 +46,13 @@ using google::LogMessage; TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue) + std::string role, + unsigned int in_streams, + unsigned int out_streams, + boost::shared_ptr queue) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams), + queue_(queue) { std::string default_filename = "../data/my_capture.dat"; std::string default_item_type = "byte"; @@ -56,7 +61,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac double default_seconds_to_skip = 0.0; samples_ = configuration->property(role + ".samples", 0ULL); - sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); + sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0LL); filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present @@ -72,7 +77,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false); double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip); - long bytes_to_skip = 0; + int64_t bytes_to_skip = 0; if (item_type_.compare("byte") == 0) { @@ -122,7 +127,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac if (seconds_to_skip > 0) { - bytes_to_skip = static_cast( + bytes_to_skip = static_cast( seconds_to_skip * sampling_frequency_ / 4); if (is_complex_) { diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 71ed81dbd..00019ce4c 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -98,12 +99,12 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } @@ -130,7 +131,7 @@ public: private: uint64_t samples_; - long sampling_frequency_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_;