1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-25 04:27:39 +00:00

Remove bound checking when accessing elements

This commit is contained in:
Carles Fernandez
2019-09-09 16:00:17 +02:00
parent 5f7f6366b6
commit c8cd925ba8
6 changed files with 25 additions and 25 deletions

View File

@@ -81,7 +81,7 @@ beidou_b1i_telemetry_decoder_gs::beidou_b1i_telemetry_decoder_gs(
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -300,7 +300,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -325,7 +325,7 @@ void beidou_b1i_telemetry_decoder_gs::set_satellite(const Gnss_Satellite &satell
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -440,14 +440,14 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = d_symbol_history.at(i); d_subframe_symbols[i] = d_symbol_history[i];
} }
} }
else // 180 deg. inverted carrier phase PLL lock else // 180 deg. inverted carrier phase PLL lock
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = -d_symbol_history.at(i); d_subframe_symbols[i] = -d_symbol_history[i];
} }
} }
@@ -497,14 +497,14 @@ int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute_
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = d_symbol_history.at(i); d_subframe_symbols[i] = d_symbol_history[i];
} }
} }
else // 180 deg. inverted carrier phase PLL lock else // 180 deg. inverted carrier phase PLL lock
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = -d_symbol_history.at(i); d_subframe_symbols[i] = -d_symbol_history[i];
} }
} }

View File

@@ -81,7 +81,7 @@ beidou_b3i_telemetry_decoder_gs::beidou_b3i_telemetry_decoder_gs(
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -318,7 +318,7 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -342,7 +342,7 @@ void beidou_b3i_telemetry_decoder_gs::set_satellite(
// Setting samples of preamble code // Setting samples of preamble code
for (int32_t i = 0; i < d_symbols_per_preamble; i++) for (int32_t i = 0; i < d_symbols_per_preamble; i++)
{ {
if (BEIDOU_DNAV_PREAMBLE.at(i) == '1') if (BEIDOU_DNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -466,14 +466,14 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = d_symbol_history.at(i); d_subframe_symbols[i] = d_symbol_history[i];
} }
} }
else // 180 deg. inverted carrier phase PLL lock else // 180 deg. inverted carrier phase PLL lock
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = -d_symbol_history.at(i); d_subframe_symbols[i] = -d_symbol_history[i];
} }
} }
@@ -526,14 +526,14 @@ int beidou_b3i_telemetry_decoder_gs::general_work(
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = d_symbol_history.at(i); d_subframe_symbols[i] = d_symbol_history[i];
} }
} }
else // 180 deg. inverted carrier phase PLL lock else // 180 deg. inverted carrier phase PLL lock
{ {
for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++)
{ {
d_subframe_symbols[i] = -d_symbol_history.at(i); d_subframe_symbols[i] = -d_symbol_history[i];
} }
} }

View File

@@ -135,7 +135,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
{ {
case 1: // INAV case 1: // INAV
{ {
if (GALILEO_INAV_PREAMBLE.at(i) == '1') if (GALILEO_INAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -147,7 +147,7 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
} }
case 2: // FNAV for E5a-I case 2: // FNAV for E5a-I
{ {
if (GALILEO_FNAV_PREAMBLE.at(i) == '1') if (GALILEO_FNAV_PREAMBLE[i] == '1')
{ {
d_preamble_samples[i] = 1; d_preamble_samples[i] = 1;
} }
@@ -571,14 +571,14 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
d_page_part_symbols[i] = d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now! d_page_part_symbols[i] = d_symbol_history[i + d_samples_per_preamble]; // because last symbol of the preamble is just received now!
} }
} }
else // 180 deg. inverted carrier phase PLL lock else // 180 deg. inverted carrier phase PLL lock
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
d_page_part_symbols[i] = -d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now! d_page_part_symbols[i] = -d_symbol_history[i + d_samples_per_preamble]; // because last symbol of the preamble is just received now!
} }
} }
decode_INAV_word(d_page_part_symbols.data(), d_frame_length_symbols); decode_INAV_word(d_page_part_symbols.data(), d_frame_length_symbols);
@@ -592,7 +592,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
d_page_part_symbols[i] = d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now! d_page_part_symbols[i] = d_symbol_history[i + d_samples_per_preamble]; // because last symbol of the preamble is just received now!
} }
} }
} }
@@ -602,7 +602,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
d_page_part_symbols[i] = -d_symbol_history.at(i + d_samples_per_preamble); // because last symbol of the preamble is just received now! d_page_part_symbols[i] = -d_symbol_history[i + d_samples_per_preamble]; // because last symbol of the preamble is just received now!
} }
} }
} }

View File

@@ -343,11 +343,11 @@ int glonass_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
{ {
if (corr_value > 0) if (corr_value > 0)
{ {
string_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! string_symbols[i] = d_symbol_history[i + d_symbols_per_preamble].Prompt_I; // because last symbol of the preamble is just received now!
} }
else else
{ {
string_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! string_symbols[i] = -d_symbol_history[i + d_symbols_per_preamble].Prompt_I; // because last symbol of the preamble is just received now!
} }
} }

View File

@@ -343,11 +343,11 @@ int glonass_l2_ca_telemetry_decoder_gs::general_work(int noutput_items __attribu
{ {
if (corr_value > 0) if (corr_value > 0)
{ {
string_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! string_symbols[i] = d_symbol_history[i + d_symbols_per_preamble].Prompt_I; // because last symbol of the preamble is just received now!
} }
else else
{ {
string_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now! string_symbols[i] = -d_symbol_history[i + d_symbols_per_preamble].Prompt_I; // because last symbol of the preamble is just received now!
} }
} }

View File

@@ -87,7 +87,7 @@ gps_l1_ca_telemetry_decoder_gs::gps_l1_ca_telemetry_decoder_gs(
int32_t n = 0; int32_t n = 0;
for (int32_t i = 0; i < d_bits_per_preamble; i++) for (int32_t i = 0; i < d_bits_per_preamble; i++)
{ {
if (GPS_CA_PREAMBLE.at(i) == '1') if (GPS_CA_PREAMBLE[i] == '1')
{ {
d_preamble_samples[n] = 1; d_preamble_samples[n] = 1;
n++; n++;