diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 0aa8f1410..0f80cf3bd 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -31,7 +31,7 @@ */ #include "pcps_acquisition_fine_doppler_cc.h" -#include // std::rotate +#include // std::rotate, std::fill_n #include #include #include @@ -331,7 +331,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star gr::fft::fft_complex *fft_operator = new gr::fft::fft_complex(fft_size_extended, true); //zero padding the entire vector - memset(fft_operator->get_inbuf(), 0, fft_size_extended * sizeof(gr_complex)); + std::fill_n(fft_operator->get_inbuf(), fft_size_extended, gr_complex(0.0, 0.0)); //1. generate local code aligned with the acquisition code phase estimation gr_complex *code_replica = static_cast(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment())); @@ -366,7 +366,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star int counter = 0; float fftFreqBins[fft_size_extended]; - memset(fftFreqBins, 0, fft_size_extended * sizeof(float)); + std::fill_n(fftFreqBins, fft_size_extended, 0.0); for (int k = 0; k < (fft_size_extended / 2); k++) { diff --git a/src/core/libs/supl/supl.c b/src/core/libs/supl/supl.c index 6a06bb252..021b65327 100644 --- a/src/core/libs/supl/supl.c +++ b/src/core/libs/supl/supl.c @@ -221,7 +221,7 @@ int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) { SSLeay_add_ssl_algorithms(); // meth = TLSv1_client_method(); - meth = SSLv23_client_method(); + meth = (SSL_METHOD*)SSLv23_client_method(); SSL_load_error_strings(); ctx->ssl_ctx = SSL_CTX_new(meth); if (!ctx->ssl_ctx) return E_SUPL_CONNECT; diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc index 1b0aaa8cb..9867b5584 100644 --- a/src/tests/unit-tests/arithmetic/conjugate_test.cc +++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc @@ -29,7 +29,7 @@ * ------------------------------------------------------------------------- */ - +#include #include #include #include @@ -44,7 +44,7 @@ TEST(ConjugateTest, StandardCComplexImplementation) { std::complex* input = new std::complex[FLAGS_size_conjugate_test]; std::complex* output = new std::complex[FLAGS_size_conjugate_test]; - memset(input, 0, sizeof(std::complex) * FLAGS_size_conjugate_test); + std::fill_n(input, FLAGS_size_conjugate_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -118,7 +118,7 @@ TEST(ConjugateTest, VolkComplexImplementation) { std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); std::complex* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); - memset(input, 0, sizeof(std::complex) * FLAGS_size_conjugate_test); + std::fill_n(input, FLAGS_size_conjugate_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc index 6238b5c75..cefa52e21 100644 --- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc +++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc @@ -30,7 +30,7 @@ * ------------------------------------------------------------------------- */ - +#include #include #include #include @@ -115,7 +115,7 @@ TEST(MagnitudeSquaredTest, ArmadilloComplexImplementation) TEST(MagnitudeSquaredTest, VolkComplexImplementation) { std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); - memset(input, 0, sizeof(std::complex) * FLAGS_size_magnitude_test); + std::fill_n(input, FLAGS_size_magnitude_test, std::complex(0.0, 0.0)); float* output = static_cast(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(float), volk_gnsssdr_get_alignment())); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc index 093bca5f9..809ff8d11 100644 --- a/src/tests/unit-tests/arithmetic/multiply_test.cc +++ b/src/tests/unit-tests/arithmetic/multiply_test.cc @@ -30,7 +30,7 @@ * ------------------------------------------------------------------------- */ - +#include #include #include #include @@ -45,7 +45,7 @@ TEST(MultiplyTest, StandardCDoubleImplementation) { double* input = new double[FLAGS_size_multiply_test]; double* output = new double[FLAGS_size_multiply_test]; - memset(input, 0, sizeof(double) * FLAGS_size_multiply_test); + std::fill_n(input, FLAGS_size_multiply_test, 0.0); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -98,7 +98,7 @@ TEST(MultiplyTest, StandardCComplexImplementation) { std::complex* input = new std::complex[FLAGS_size_multiply_test]; std::complex* output = new std::complex[FLAGS_size_multiply_test]; - memset(input, 0, sizeof(std::complex) * FLAGS_size_multiply_test); + std::fill_n(input, FLAGS_size_multiply_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -180,7 +180,7 @@ TEST(MultiplyTest, VolkComplexImplementation) { std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); std::complex* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); - memset(input, 0, sizeof(std::complex) * FLAGS_size_multiply_test); + std::fill_n(input, FLAGS_size_multiply_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; start = std::chrono::system_clock::now();