From 966f5c7333c4a83d1ef62070c487e23d586df863 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 12 Sep 2014 14:13:23 +0200 Subject: [PATCH] Changing cast to volk_malloc from C style to C++ --- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 28 +++++++++---------- .../galileo_pcps_8ms_acquisition_cc.cc | 8 +++--- .../gnuradio_blocks/pcps_acquisition_cc.cc | 6 ++-- .../pcps_acquisition_fine_doppler_cc.cc | 14 +++++----- .../pcps_assisted_acquisition_cc.cc | 8 +++--- .../pcps_cccwsr_acquisition_cc.cc | 18 ++++++------ .../pcps_multithread_acquisition_cc.cc | 10 +++---- .../pcps_opencl_acquisition_cc.cc | 12 ++++---- .../pcps_quicksync_acquisition_cc.cc | 16 +++++------ .../pcps_tong_acquisition_cc.cc | 10 +++---- 10 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 76e74f408..72b277c28 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -107,24 +107,24 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_both_signal_components = both_signal_components_; d_CAF_window_hz = CAF_window_hz_; - d_inbuffer = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_fft_code_I_A = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitudeIA = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_inbuffer = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_fft_code_I_A = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitudeIA = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); if (d_both_signal_components == true) { - d_fft_code_Q_A = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitudeQA = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_code_Q_A = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitudeQA = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); } // IF COHERENT INTEGRATION TIME > 1 if (d_sampled_ms > 1) { - d_fft_code_I_B = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitudeIB = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_code_I_B = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitudeIB = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); if (d_both_signal_components == true) { - d_fft_code_Q_B = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitudeQB = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_code_Q_B = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitudeQB = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); } } @@ -260,7 +260,7 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init() d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); int doppler = -(int)d_doppler_max + d_doppler_step*doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); @@ -271,11 +271,11 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init() // if (d_CAF_filter) if (d_CAF_window_hz > 0) { - d_CAF_vector = (float*)volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()); - d_CAF_vector_I = (float*)volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()); + d_CAF_vector = static_cast(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment())); + d_CAF_vector_I = static_cast(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment())); if (d_both_signal_components == true) { - d_CAF_vector_Q = (float*)volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()); + d_CAF_vector_Q = static_cast(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment())); } } } @@ -584,7 +584,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items if (d_CAF_window_hz > 0) { int CAF_bins_half; - float* accum = (float*)volk_malloc(sizeof(float), volk_get_alignment()); + float* accum = static_cast(volk_malloc(sizeof(float), volk_get_alignment())); CAF_bins_half = d_CAF_window_hz/(2*d_doppler_step); float weighting_factor; weighting_factor = 0.5/(float)CAF_bins_half; diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 8f3b79a86..a5ae138da 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -79,9 +79,9 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_code_A = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_fft_code_B = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_code_A = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_fft_code_B = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -160,7 +160,7 @@ void galileo_pcps_8ms_acquisition_cc::init() d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; for (unsigned int doppler_index=0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); int doppler = -(int)d_doppler_max + d_doppler_step*doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc index 8af185fe8..4e542f8fa 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc @@ -86,8 +86,8 @@ pcps_acquisition_cc::pcps_acquisition_cc( d_num_doppler_bins = 0; d_bit_transition_flag = bit_transition_flag; - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -152,7 +152,7 @@ void pcps_acquisition_cc::init() for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); } 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 2aa0b40a4..912ca1b00 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 @@ -81,9 +81,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc( d_gnuradio_forecast_samples = d_fft_size; d_input_power = 0.0; d_state = 0; - d_carrier = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_carrier = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -106,7 +106,7 @@ void pcps_acquisition_fine_doppler_cc::set_doppler_step(unsigned int doppler_ste d_grid_data = new float*[d_num_doppler_points]; for (int i = 0; i < d_num_doppler_points; i++) { - d_grid_data[i] = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_grid_data[i] = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); } update_carrier_wipeoff(); } @@ -268,7 +268,7 @@ int pcps_acquisition_fine_doppler_cc::compute_and_accumulate_grid(gr_vector_cons // 2- Doppler frequency search loop - float* p_tmp_vector = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + float* p_tmp_vector = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { @@ -309,7 +309,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star memset(fft_operator->get_inbuf(), 0, fft_size_extended * sizeof(gr_complex)); //1. generate local code aligned with the acquisition code phase estimation - gr_complex *code_replica = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + gr_complex *code_replica = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); gps_l1_ca_code_gen_complex_sampled(code_replica, d_gnss_synchro->PRN, d_fs_in, 0); @@ -331,7 +331,7 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star fft_operator->execute(); // 4. Compute the magnitude and find the maximum - float* p_tmp_vector = (float*)volk_malloc(fft_size_extended * sizeof(float), volk_get_alignment()); + float* p_tmp_vector = static_cast(volk_malloc(fft_size_extended * sizeof(float), volk_get_alignment())); volk_32fc_magnitude_squared_32f(p_tmp_vector, fft_operator->get_outbuf(), fft_size_extended); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index 51fb2af48..cfc7688c3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -82,8 +82,8 @@ pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( d_input_power = 0.0; d_state = 0; d_disable_assist = false; - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_carrier = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_carrier = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -292,7 +292,7 @@ float pcps_assisted_acquisition_cc::estimate_input_power(gr_vector_const_void_st { const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer // 1- Compute the input signal power estimation - float* p_tmp_vector = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + float* p_tmp_vector = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); volk_32fc_magnitude_squared_32f(p_tmp_vector, in, d_fft_size); @@ -318,7 +318,7 @@ int pcps_assisted_acquisition_cc::compute_and_accumulate_grid(gr_vector_const_vo << ", doppler_step: " << d_doppler_step; // 2- Doppler frequency search loop - float* p_tmp_vector = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + float* p_tmp_vector = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); for (int doppler_index = 0; doppler_index < d_num_doppler_points; doppler_index++) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index c6b3d4a23..0c5f69a7a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -86,13 +86,13 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_code_data = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_fft_code_pilot = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_data_correlation = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_pilot_correlation = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_correlation_plus = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_correlation_minus = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_code_data = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_fft_code_pilot = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_data_correlation = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_pilot_correlation = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_correlation_plus = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_correlation_minus = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -174,9 +174,9 @@ void pcps_cccwsr_acquisition_cc::init() d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); - int doppler = -(int)d_doppler_max + d_doppler_step*doppler_index; + int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc index 8ac3deade..b5cf5c449 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_multithread_acquisition_cc.cc @@ -92,10 +92,10 @@ pcps_multithread_acquisition_cc::pcps_multithread_acquisition_cc( //todo: do something if posix_memalign fails for (unsigned int i = 0; i < d_max_dwells; i++) { - d_in_buffer[i] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_in_buffer[i] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); } - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -158,9 +158,9 @@ void pcps_multithread_acquisition_cc::init() d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; for (unsigned int doppler_index=0;doppler_index(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); - int doppler = -(int)d_doppler_max + d_doppler_step*doppler_index; + int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index a0f9c1ff4..0f0e72a3b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -116,11 +116,11 @@ pcps_opencl_acquisition_cc::pcps_opencl_acquisition_cc( d_in_buffer = new gr_complex*[d_max_dwells]; for (unsigned int i = 0; i < d_max_dwells; i++) { - d_in_buffer[i] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_in_buffer[i] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); } - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_get_alignment()); - d_zero_vector = (gr_complex*)volk_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_get_alignment()); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); + d_fft_codes = static_cast(volk_malloc(d_fft_size_pow2 * sizeof(gr_complex), volk_get_alignment())); + d_zero_vector = static_cast(volk_malloc((d_fft_size_pow2 - d_fft_size) * sizeof(gr_complex), volk_get_alignment())); for (unsigned int i = 0; i < (d_fft_size_pow2-d_fft_size); i++) { @@ -314,9 +314,9 @@ void pcps_opencl_acquisition_cc::init() for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); - int doppler= -(int)d_doppler_max + d_doppler_step*doppler_index; + int doppler= -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 97f4be88c..0c2626f7a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -97,9 +97,9 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( //fft size is reduced. d_fft_size = (d_samples_per_code) / d_folding_factor; - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_samples_per_code * d_folding_factor * sizeof(float), volk_get_alignment()); - d_magnitude_folded = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(float), volk_get_alignment())); + d_magnitude_folded = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); d_possible_delay = new unsigned int[d_folding_factor]; d_corr_output_f = new float[d_folding_factor]; @@ -198,7 +198,7 @@ void pcps_quicksync_acquisition_cc::init() d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment())); int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, @@ -259,16 +259,16 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, float magt = 0.0; const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer - gr_complex* in_temp = (gr_complex*)volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment()); - gr_complex* in_temp_folded = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + gr_complex* in_temp = static_cast(volk_malloc(d_samples_per_code * d_folding_factor * sizeof(gr_complex), volk_get_alignment())); + gr_complex* in_temp_folded = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); /*Create a signal to store a signal of size 1ms, to perform correlation in time. No folding on this data is required*/ - gr_complex* in_1code = (gr_complex*)volk_malloc(d_samples_per_code * sizeof(gr_complex), volk_get_alignment()); + gr_complex* in_1code = static_cast(volk_malloc(d_samples_per_code * sizeof(gr_complex), volk_get_alignment())); /*Stores the values of the correlation output between the local code and the signal with doppler shift corrected */ - gr_complex* corr_output = (gr_complex*)volk_malloc(d_samples_per_code * sizeof(gr_complex), volk_get_alignment()); + gr_complex* corr_output = static_cast(volk_malloc(d_samples_per_code * sizeof(gr_complex), volk_get_alignment())); /*Stores a copy of the folded version of the signal.This is used for the FFT operations in future steps of excecution*/ diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index beb46ce9a..99e9b44e2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -99,8 +99,8 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( d_input_power = 0.0; d_num_doppler_bins = 0; - d_fft_codes = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); - d_magnitude = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_fft_codes = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); + d_magnitude = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); // Direct FFT d_fft_if = new gr::fft::fft_complex(d_fft_size, true); @@ -170,14 +170,14 @@ void pcps_tong_acquisition_cc::init() d_grid_data = new float*[d_num_doppler_bins]; for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++) { - d_grid_doppler_wipeoffs[doppler_index] = (gr_complex*)volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()); + d_grid_doppler_wipeoffs[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment())); - int doppler = -(int)d_doppler_max + d_doppler_step*doppler_index; + int doppler = -(int)d_doppler_max + d_doppler_step * doppler_index; complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size); - d_grid_data[doppler_index] = (float*)volk_malloc(d_fft_size * sizeof(float), volk_get_alignment()); + d_grid_data[doppler_index] = static_cast(volk_malloc(d_fft_size * sizeof(float), volk_get_alignment())); for (unsigned int i = 0; i < d_fft_size; i++) {