From b60e0198749eda67c98993e5b070c19479bbcd79 Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Sun, 27 Oct 2024 16:10:13 -0700 Subject: [PATCH] Move gran() to Modulator implementation file This function is used only by the Modulator, and even then, only when testing. --- CMakeLists.txt | 1 - Modulator.cpp | 15 ++++++++++++--- getfile.cpp | 10 ---------- getfile.h | 8 -------- 4 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 getfile.cpp delete mode 100644 getfile.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 97419436..4974ba8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,6 @@ set (wsjtx_CXXSRCS Detector.cpp logqso.cpp decodedtext.cpp - getfile.cpp soundout.cpp soundin.cpp signalmeter.cpp diff --git a/Modulator.cpp b/Modulator.cpp index e046be00..90b16004 100644 --- a/Modulator.cpp +++ b/Modulator.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -13,12 +14,20 @@ #include "moc_Modulator.cpp" -extern float gran(); // Noise generator (for tests only) - namespace { constexpr double TAU = 2 * M_PI; - + + // Noise generator, for tests only; generate gaussian random + // float with mean = 0 and std_dev = 1. + + float + gran() + { + static std::normal_distribution d; + return d(*QRandomGenerator::global()); + } + unsigned delayMS(qint32 const trPeriod) { diff --git a/getfile.cpp b/getfile.cpp deleted file mode 100644 index 5e85f05e..00000000 --- a/getfile.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "getfile.h" -#include -#include - -/* Generate gaussian random float with mean=0 and std_dev=1 */ -float gran() -{ - static std::normal_distribution d; - return d (*QRandomGenerator::global ()); -} diff --git a/getfile.h b/getfile.h deleted file mode 100644 index c79b9f30..00000000 --- a/getfile.h +++ /dev/null @@ -1,8 +0,0 @@ -// -*- Mode: C++ -*- -#ifndef GETFILE_H -#define GETFILE_H -#include - -float gran(); - -#endif // GETFILE_H