1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-04 17:23:20 +00:00

Apply fixes by clang-tidy

This commit is contained in:
Carles Fernandez
2018-12-11 01:56:25 +01:00
parent c9f55f2491
commit d920aa4d92
17 changed files with 105 additions and 111 deletions

View File

@@ -220,7 +220,7 @@ void GpsL1CaPcpsOpenClAcquisition::set_local_code()
{
if (item_type_ == "gr_complex")
{
std::complex<float>* code = new std::complex<float>[code_length_];
auto* code = new std::complex<float>[code_length_];
gps_l1_ca_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0);
@@ -261,9 +261,9 @@ float GpsL1CaPcpsOpenClAcquisition::calculate_threshold(float pfa)
unsigned int ncells = vector_length_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent);
double lambda = double(vector_length_);
auto lambda = double(vector_length_);
boost::math::exponential_distribution<double> mydist(lambda);
float threshold = static_cast<float>(quantile(mydist, val));
auto threshold = static_cast<float>(quantile(mydist, val));
return threshold;
}

View File

@@ -61,6 +61,7 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include <utility>
using google::LogMessage;
@@ -75,7 +76,7 @@ pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
{
return pcps_opencl_acquisition_cc_sptr(
new pcps_opencl_acquisition_cc(sampled_ms, max_dwells, doppler_max, fs_in, samples_per_ms,
samples_per_code, bit_transition_flag, dump, dump_filename));
samples_per_code, bit_transition_flag, dump, std::move(dump_filename)));
}
@@ -140,7 +141,7 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc(
// For dumping samples into a file
d_dump = dump;
d_dump_filename = dump_filename;
d_dump_filename = std::move(dump_filename);
}
@@ -193,7 +194,7 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
}
int pcps_opencl_acquisition_cc::init_opencl_environment(std::string kernel_filename)
int pcps_opencl_acquisition_cc::init_opencl_environment(const std::string &kernel_filename)
{
//get all platforms (drivers)
std::vector<cl::Platform> all_platforms;
@@ -359,7 +360,7 @@ void pcps_opencl_acquisition_cc::set_local_code(std::complex<float> *code)
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Forward, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(),
0, NULL, NULL);
0, nullptr, nullptr);
//Conjucate the local code
cl::Kernel kernel = cl::Kernel(d_cl_program, "conj_vector");
@@ -562,7 +563,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Forward, (*d_cl_buffer_1)(), (*d_cl_buffer_2)(),
0, NULL, NULL);
0, nullptr, nullptr);
// Multiply carrier wiped--off, Fourier transformed incoming signal
// with the local FFT'd code reference
@@ -576,7 +577,7 @@ void pcps_opencl_acquisition_cc::acquisition_core_opencl()
// compute the inverse FFT
clFFT_ExecuteInterleaved((*d_cl_queue)(), d_cl_fft_plan, d_cl_fft_batch_size,
clFFT_Inverse, (*d_cl_buffer_2)(), (*d_cl_buffer_2)(),
0, NULL, NULL);
0, nullptr, nullptr);
// Compute magnitude
kernel = cl::Kernel(d_cl_program, "magnitude_squared");

View File

@@ -105,7 +105,7 @@ private:
void calculate_magnitudes(gr_complex* fft_begin, int doppler_shift,
int doppler_offset);
int init_opencl_environment(std::string kernel_filename);
int init_opencl_environment(const std::string& kernel_filename);
long d_fs_in;
int d_samples_per_ms;