diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-10-04 18:57:50 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-10-04 18:57:50 +0200 |
commit | e21884ad871f52bcd02fc492084bade3dfab275a (patch) | |
tree | 2a97768de2fc19ec680f5fbeeccc88163f2aa397 /src | |
parent | ecf405846aec3ce7455f68379d86d6888b135c50 (diff) | |
download | dabmod-e21884ad871f52bcd02fc492084bade3dfab275a.tar.gz dabmod-e21884ad871f52bcd02fc492084bade3dfab275a.tar.bz2 dabmod-e21884ad871f52bcd02fc492084bade3dfab275a.zip |
Actually enable the new warnings for C++
Diffstat (limited to 'src')
-rw-r--r-- | src/DabMod.cpp | 10 | ||||
-rw-r--r-- | src/OfdmGenerator.cpp | 4 | ||||
-rw-r--r-- | src/Resampler.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 15b3be2..2caba5d 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -170,9 +170,9 @@ static void printModSettings(const mod_settings_t& mod_settings) fprintf(stderr, " Sampling rate: "); if (mod_settings.outputRate > 1000) { if (mod_settings.outputRate > 1000000) { - fprintf(stderr, "%.4g MHz\n", mod_settings.outputRate / 1000000.0f); + fprintf(stderr, "%.4g MHz\n", mod_settings.outputRate / 1000000.0); } else { - fprintf(stderr, "%.4g kHz\n", mod_settings.outputRate / 1000.0f); + fprintf(stderr, "%.4g kHz\n", mod_settings.outputRate / 1000.0); } } else { fprintf(stderr, "%zu Hz\n", mod_settings.outputRate); @@ -190,11 +190,11 @@ static shared_ptr<ModOutput> prepare_output( } if (s.fileOutputFormat == "complexf_normalised") { if (s.gainMode == GainMode::GAIN_FIX) - s.normalise = 1.0 / normalise_factor_file_fix; + s.normalise = 1.0f / normalise_factor_file_fix; else if (s.gainMode == GainMode::GAIN_MAX) - s.normalise = 1.0 / normalise_factor_file_max; + s.normalise = 1.0f / normalise_factor_file_max; else if (s.gainMode == GainMode::GAIN_VAR) - s.normalise = 1.0 / normalise_factor_file_var; + s.normalise = 1.0f / normalise_factor_file_var; output = make_shared<OutputFile>(s.outputName); } else if (s.fileOutputFormat == "s8" or diff --git a/src/OfdmGenerator.cpp b/src/OfdmGenerator.cpp index 6a5044e..48449c3 100644 --- a/src/OfdmGenerator.cpp +++ b/src/OfdmGenerator.cpp @@ -230,8 +230,8 @@ int OfdmGenerator::process(Buffer* const dataIn, Buffer* dataOut) double sum_iq = 0; double sum_delta = 0; for (size_t i = 0; i < mySpacing; i++) { - sum_iq += std::norm(before_cfr[i]); - sum_delta += std::norm(symbol[i] - before_cfr[i]); + sum_iq += (double)std::norm(before_cfr[i]); + sum_delta += (double)std::norm(symbol[i] - before_cfr[i]); } const double mer = 10.0 * std::log10(sum_iq / sum_delta); myMERs.push_back(mer); diff --git a/src/Resampler.cpp b/src/Resampler.cpp index 8786e91..8069a61 100644 --- a/src/Resampler.cpp +++ b/src/Resampler.cpp @@ -83,7 +83,7 @@ Resampler::Resampler(size_t inputRate, size_t outputRate, size_t resolution) : myWindow = (float*)memalign(16, myFftSizeIn * sizeof(float)); for (size_t i = 0; i < myFftSizeIn; ++i) { - myWindow[i] = 0.5f * (1.0f - cosf(2.0f * M_PI * i / (myFftSizeIn - 1))); + myWindow[i] = (float)(0.5 * (1.0 - cos(2.0 * M_PI * i / (myFftSizeIn - 1)))); PDEBUG("Window[%zu] = %f\n", i, myWindow[i]); } |