Removed atof, atoll and atoi calls

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent 8dd1c59e18
commit b48bb0d754

@ -86,19 +86,19 @@ void parse_args(int argc, char **argv) {
rf_args = argv[optind];
break;
case 'b':
band = atoi(argv[optind]);
band = (int)strtol(argv[optind], NULL, 10);
break;
case 's':
earfcn_start = atoi(argv[optind]);
earfcn_start = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
earfcn_end = atoi(argv[optind]);
earfcn_end = (int)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell_detect_config.max_frames_pss = atoi(argv[optind]);
cell_detect_config.max_frames_pss = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'v':
srslte_verbose++;

@ -163,52 +163,52 @@ void parse_args(int argc, char **argv) {
rf_args = argv[optind];
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'l':
rf_amp = atof(argv[optind]);
rf_amp = strtof(argv[optind], NULL);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 'o':
output_file_name = argv[optind];
break;
case 'm':
mcs_idx = atoi(argv[optind]);
mcs_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'u':
net_port = atoi(argv[optind]);
net_port = (int)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'x':
transmission_mode = (srslte_tm_t)(atoi(argv[optind]) - 1);
transmission_mode = (srslte_tm_t)(strtol(argv[optind], NULL, 10) - 1);
break;
case 'b':
multiplex_pmi = (uint32_t) atoi(argv[optind]);
multiplex_pmi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'w':
multiplex_nof_layers = (uint32_t) atoi(argv[optind]);
multiplex_nof_layers = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'M':
mbsfn_area_id = atoi(argv[optind]);
mbsfn_area_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;
break;
case 's':
output_file_snr = atof(argv[optind]);
output_file_snr = strtof(argv[optind], NULL);
break;
case 'B':
mbsfn_sf_mask = atoi(argv[optind]);
mbsfn_sf_mask = (uint8_t)strtol(argv[optind], NULL, 10);
break;
case 'q':
enable_256qam ^= true;
@ -627,7 +627,7 @@ int update_control() {
break;
default:
last_mcs_idx = mcs_idx;
mcs_idx = atoi(input);
mcs_idx = strtol(input, NULL, 10);
}
}
bzero(input,sizeof(input));

@ -208,19 +208,19 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
args->input_file_name = argv[optind];
break;
case 'p':
args->file_nof_prb = atoi(argv[optind]);
args->file_nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'P':
args->file_nof_ports = atoi(argv[optind]);
args->file_nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
args->file_offset_freq = atof(argv[optind]);
args->file_offset_freq = strtof(argv[optind], NULL);
break;
case 'O':
args->file_offset_time = atoi(argv[optind]);
args->file_offset_time = (int)strtol(argv[optind], NULL, 10);
break;
case 'c':
args->file_cell_id = atoi(argv[optind]);
args->file_cell_id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'I':
args->rf_dev = argv[optind];
@ -229,10 +229,10 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
args->rf_args = argv[optind];
break;
case 'A':
args->rf_nof_rx_ant = atoi(argv[optind]);
args->rf_nof_rx_ant = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'g':
args->rf_gain = atof(argv[optind]);
args->rf_gain = strtof(argv[optind], NULL);
break;
case 'C':
args->disable_cfo = true;
@ -244,34 +244,34 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
args->average_subframe = true;
break;
case 't':
args->time_offset = atoi(argv[optind]);
args->time_offset = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
args->rf_freq = strtod(argv[optind], NULL);
break;
case 'T':
args->tdd_special_sf = atoi(argv[optind]);
args->tdd_special_sf = (int)strtol(argv[optind], NULL, 10);
break;
case 'G':
args->sf_config = atoi(argv[optind]);
args->sf_config = (int)strtol(argv[optind], NULL, 10);
break;
case 'n':
args->nof_subframes = atoi(argv[optind]);
args->nof_subframes = (int)strtol(argv[optind], NULL, 10);
break;
case 'r':
args->rnti = strtol(argv[optind], NULL, 16);
break;
case 'l':
args->force_N_id_2 = atoi(argv[optind]);
args->force_N_id_2 = (int)strtol(argv[optind], NULL, 10);
break;
case 'u':
args->net_port = atoi(argv[optind]);
args->net_port = (int)strtol(argv[optind], NULL, 10);
break;
case 'U':
args->net_address = argv[optind];
break;
case 's':
args->net_port_signal = atoi(argv[optind]);
args->net_port_signal = (int)strtol(argv[optind], NULL, 10);
break;
case 'S':
args->net_address_signal = argv[optind];
@ -287,22 +287,22 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
args->verbose = srslte_verbose;
break;
case 'Z':
args->decimate = atoi(argv[optind]);
args->decimate = (int)strtol(argv[optind], NULL, 10);
break;
case 'y':
args->cpu_affinity = atoi(argv[optind]);
args->cpu_affinity = (int)strtol(argv[optind], NULL, 10);
break;
case 'W':
output_file_name = argv[optind];
break;
case 'M':
args->mbsfn_area_id = atoi(argv[optind]);
args->mbsfn_area_id = (int32_t)strtol(argv[optind], NULL, 10);
break;
case 'N':
args->non_mbsfn_region = atoi(argv[optind]);
args->non_mbsfn_region = (uint8_t)strtol(argv[optind], NULL, 10);
break;
case 'B':
args->mbsfn_sf_mask = atoi(argv[optind]);
args->mbsfn_sf_mask = (uint8_t)strtol(argv[optind], NULL, 10);
break;
case 'q':
args->enable_256qam ^= true;

@ -60,25 +60,25 @@ void parse_args(int argc, char **argv) {
output_file_name = argv[optind];
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
frame_length = atoi(argv[optind]);
frame_length = (int)strtol(argv[optind], NULL, 10);
break;
case 't':
corr_peak_threshold = atof(argv[optind]);
corr_peak_threshold = strtof(argv[optind], NULL);
break;
case 's':
symbol_sz = atof(argv[optind]);
symbol_sz = (int)strtol(argv[optind], NULL, 10);
break;
case 'N':
out_N_id_2 = atoi(argv[optind]);
out_N_id_2 = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
force_N_id_2 = atoi(argv[optind]);
force_N_id_2 = (int)strtol(argv[optind], NULL, 10);
break;
case 'c':
force_cfo = atof(argv[optind]);
force_cfo = strtof(argv[optind], NULL);
break;
case 'v':
srslte_verbose++;

@ -66,19 +66,19 @@ void parse_args(int argc, char **argv) {
rf_args = argv[optind];
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'r':
rf_rate = atof(argv[optind]);
rf_rate = strtof(argv[optind], NULL);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 'n':
nof_samples = atoi(argv[optind]);
nof_samples = (int)strtol(argv[optind], NULL, 10);
break;
case 'A':
nof_rx_antennas = atoi(argv[optind]);
nof_rx_antennas = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -67,22 +67,22 @@ void parse_args(int argc, char **argv) {
rf_args = argv[optind];
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'p':
nof_prb = atoi(argv[optind]);
nof_prb = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 'n':
nof_subframes = atoi(argv[optind]);
nof_subframes = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
N_id_2 = atoi(argv[optind]);
N_id_2 = (int)strtol(argv[optind], NULL, 10);
break;
case 'A':
nof_rx_antennas = (uint32_t) atoi(argv[optind]);
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -66,22 +66,22 @@ void parse_args(int argc, char **argv) {
input_filename = argv[optind];
break;
case 't':
tone_offset_hz = atof(argv[optind]);
tone_offset_hz = strtof(argv[optind], NULL);
break;
case 'T':
time_adv_samples = atoi(argv[optind]);
time_adv_samples = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 'g':
rf_rx_gain = atof(argv[optind]);
rf_rx_gain = strtof(argv[optind], NULL);
break;
case 'G':
srslte_rf_tx_gain = atof(argv[optind]);
srslte_rf_tx_gain = strtof(argv[optind], NULL);
break;
case 'p':
nof_prb = atoi(argv[optind]);
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
if (!srslte_nofprb_isvalid(nof_prb)) {
ERROR("Invalid number of UL RB %d\n", nof_prb);
exit(-1);

@ -78,10 +78,10 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "recosvnm")) != -1) {
switch (opt) {
case 'r':
cell.base.nof_prb = atoi(argv[optind]);
cell.base.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.n_id_ncell = atoi(argv[optind]);
cell.n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
have_channel = true;
@ -90,7 +90,7 @@ void parse_args(int argc, char** argv)
have_ofdm = true;
break;
case 's':
snr_db = (float)atof(argv[optind]);
snr_db = strtof(argv[optind], NULL);
break;
case 'v':
srslte_verbose++;

@ -54,13 +54,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "recov")) != -1) {
switch(opt) {
case 'r':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'e':
cell.cp = SRSLTE_CP_EXT;
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
output_matlab = argv[optind];

@ -57,13 +57,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "recov")) != -1) {
switch(opt) {
case 'r':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'e':
cell.cp = SRSLTE_CP_EXT;
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
output_matlab = argv[optind];

@ -55,13 +55,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "recv")) != -1) {
switch(opt) {
case 'r':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'e':
cell.cp = SRSLTE_CP_EXT;
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -67,13 +67,13 @@ static void parse_args(int argc, char** argv)
model = argv[optind];
break;
case 't':
duration_ms = (uint32_t)atof(argv[optind]);
duration_ms = (uint32_t)strtof(argv[optind], NULL);
break;
case 's':
srate = (uint32_t)atof(argv[optind]);
srate = (uint32_t)strtof(argv[optind], NULL);
break;
case 'r':
random_seed = (uint32_t)atoi(argv[optind]);
random_seed = (uint32_t)strtol(argv[optind], NULL, 10);
break;
#ifdef ENABLE_GUI
case 'g':

@ -54,13 +54,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "ner")) != -1) {
switch (opt) {
case 'n':
nof_prb = atoi(argv[optind]);
nof_prb = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
cp = SRSLTE_CP_EXT;
break;
case 'r':
nof_repetitions = atoi(argv[optind]);
nof_repetitions = (int)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -47,10 +47,10 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nlps")) != -1) {
switch (opt) {
case 'n':
num_bits = atoi(argv[optind]);
num_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
crc_length = atoi(argv[optind]);
crc_length = (int)strtol(argv[optind], NULL, 10);
break;
case 'p':
crc_poly = (uint32_t) strtoul(argv[optind], NULL, 16);

@ -41,10 +41,10 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "tr")) != -1) {
switch (opt) {
case 't':
nof_tx_bits = atoi(argv[optind]);
nof_tx_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'r':
nof_rx_bits = atoi(argv[optind]);
nof_rx_bits = (int)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -55,13 +55,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cei")) != -1) {
switch (opt) {
case 'c':
cb_idx = atoi(argv[optind]);
cb_idx = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
nof_e_bits = atoi(argv[optind]);
nof_e_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'i':
rv_idx = atoi(argv[optind]);
rv_idx = (int)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -43,7 +43,7 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "lv")) != -1) {
switch (opt) {
case 'l':
long_cb = atoi(argv[optind]);
long_cb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -74,13 +74,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "kcinNledts")) != -1) {
switch (opt) {
case 'c':
nof_cb = atoi(argv[optind]);
nof_cb = (int)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'N':
nof_repetitions = atoi(argv[optind]);
nof_repetitions = (int)strtol(argv[optind], NULL, 10);
break;
case 'k':
test_known_data = 1;
@ -89,16 +89,16 @@ void parse_args(int argc, char **argv) {
test_errors = 1;
break;
case 'i':
nof_iterations = atoi(argv[optind]);
nof_iterations = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
frame_length = atoi(argv[optind]);
frame_length = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'd':
tdec_type = (srslte_tdec_impl_type_t) atoi(argv[optind]);
tdec_type = (srslte_tdec_impl_type_t)strtol(argv[optind], NULL, 10);
break;
case 'e':
ebno_db = atof(argv[optind]);
ebno_db = strtof(argv[optind], NULL);
break;
case 's':
seed = (uint32_t) strtoul(argv[optind], NULL, 0);

@ -61,13 +61,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nlste")) != -1) {
switch (opt) {
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
frame_length = atoi(argv[optind]);
frame_length = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
ebno_db = atof(argv[optind]);
ebno_db = strtof(argv[optind], NULL);
break;
case 's':
seed = (uint32_t) strtoul(argv[optind], NULL, 0);

@ -50,13 +50,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "mcln")) != -1) {
switch (opt) {
case 'n':
nof_symbols = atoi(argv[optind]);
nof_symbols = (int)strtol(argv[optind], NULL, 10);
break;
case 'c':
nof_cw = atoi(argv[optind]);
nof_cw = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
nof_layers = atoi(argv[optind]);
nof_layers = (int)strtol(argv[optind], NULL, 10);
break;
case 'm':
mimo_type_name = argv[optind];

@ -65,32 +65,32 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "mplnrcdsg")) != -1) {
switch (opt) {
case 'n':
nof_symbols = atoi(argv[optind]);
nof_symbols = (int)strtol(argv[optind], NULL, 10);
break;
case 'p':
nof_tx_ports = atoi(argv[optind]);
nof_tx_ports = (int)strtol(argv[optind], NULL, 10);
break;
case 'r':
nof_rx_ports = atoi(argv[optind]);
nof_rx_ports = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
nof_layers = atoi(argv[optind]);
nof_layers = (int)strtol(argv[optind], NULL, 10);
break;
case 'm':
mimo_type_name = argv[optind];
break;
case 'c':
codebook_idx = (uint32_t) atoi(argv[optind]);
codebook_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'd':
strncpy(decoder_type_name, argv[optind], 15);
decoder_type_name[15] = 0;
break;
case 's':
snr_db = (float) atof(argv[optind]);
snr_db = strtof(argv[optind], NULL);
break;
case 'g':
scaling = (float) atof(argv[optind]);
scaling = strtof(argv[optind], NULL);
break;
default:
usage(argv[0]);

@ -47,30 +47,30 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nm")) != -1) {
switch (opt) {
case 'n':
num_bits = atoi(argv[optind]);
num_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'm':
switch(atoi(argv[optind])) {
case 1:
modulation = SRSLTE_MOD_BPSK;
break;
case 2:
modulation = SRSLTE_MOD_QPSK;
break;
case 4:
modulation = SRSLTE_MOD_16QAM;
break;
case 6:
modulation = SRSLTE_MOD_64QAM;
break;
case 8:
modulation = SRSLTE_MOD_256QAM;
break;
default:
ERROR("Invalid modulation %d. Possible values: "
"(1: BPSK, 2: QPSK, 4: QAM16, 6: QAM64, 8: QAM256)\n",
atoi(argv[optind]));
break;
switch (strtol(argv[optind], NULL, 10)) {
case 1:
modulation = SRSLTE_MOD_BPSK;
break;
case 2:
modulation = SRSLTE_MOD_QPSK;
break;
case 4:
modulation = SRSLTE_MOD_16QAM;
break;
case 6:
modulation = SRSLTE_MOD_64QAM;
break;
case 8:
modulation = SRSLTE_MOD_256QAM;
break;
default:
ERROR("Invalid modulation %ld. Possible values: "
"(1: BPSK, 2: QPSK, 4: QAM16, 6: QAM64, 8: QAM256)\n",
strtol(argv[optind], NULL, 10));
break;
}
break;
default:

@ -46,36 +46,36 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nmvf")) != -1) {
switch (opt) {
case 'n':
num_bits = atoi(argv[optind]);
num_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;
break;
case 'm':
switch(atoi(argv[optind])) {
case 1:
modulation = SRSLTE_MOD_BPSK;
break;
case 2:
modulation = SRSLTE_MOD_QPSK;
break;
case 4:
modulation = SRSLTE_MOD_16QAM;
break;
case 6:
modulation = SRSLTE_MOD_64QAM;
break;
case 8:
modulation = SRSLTE_MOD_256QAM;
break;
default:
ERROR("Invalid modulation %d. Possible values: "
"(1: BPSK, 2: QPSK, 4: QAM16, 6: QAM64)\n",
atoi(argv[optind]));
break;
switch (strtol(argv[optind], NULL, 10)) {
case 1:
modulation = SRSLTE_MOD_BPSK;
break;
case 2:
modulation = SRSLTE_MOD_QPSK;
break;
case 4:
modulation = SRSLTE_MOD_16QAM;
break;
case 6:
modulation = SRSLTE_MOD_64QAM;
break;
case 8:
modulation = SRSLTE_MOD_256QAM;
break;
default:
ERROR("Invalid modulation %d. Possible values: "
"(1: BPSK, 2: QPSK, 4: QAM16, 6: QAM64)\n",
(int)strtol(argv[optind], NULL, 10));
break;
}
break;
default:

@ -77,25 +77,25 @@ void parse_args(int argc, char** argv)
input_file_name = argv[optind];
break;
case 'l':
cell.n_id_ncell = atoi(argv[optind]);
cell.n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.base.nof_prb = atoi(argv[optind]);
cell.base.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 't':
do_chest = atoi(argv[optind]);
do_chest = (strtol(argv[optind], NULL, 10) != 0);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 's':
sf_idx = atoi(argv[optind]) % 10;
sf_idx = (int)(strtol(argv[optind], NULL, 10) % 10);
break;
case 'v':
srslte_verbose++;
break;
case 'r':
nf = atoi(argv[optind]);
nf = (int)strtol(argv[optind], NULL, 10);
break;
case 'R':
cell.is_r14 = true;

@ -49,13 +49,13 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "cpnv")) != -1) {
switch (opt) {
case 'p':
cell.base.nof_ports = atoi(argv[optind]);
cell.base.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.base.nof_prb = atoi(argv[optind]);
cell.base.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.base.id = atoi(argv[optind]);
cell.base.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -71,13 +71,13 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -52,13 +52,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cpnv")) != -1) {
switch(opt) {
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -69,16 +69,16 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'd':
use_standard_lte_rates = true;
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
matlab_file_name = argv[optind];

@ -51,13 +51,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cpnv")) != -1) {
switch(opt) {
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -75,7 +75,7 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
rnti = strtoul(argv[optind], NULL, 0);
@ -84,13 +84,13 @@ void parse_args(int argc, char **argv) {
max_frames = strtoul(argv[optind], NULL, 0);
break;
case 'f':
cfi = atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
dci_format = srslte_dci_format_from_string(argv[optind]);

@ -57,19 +57,19 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cfpndvAx")) != -1) {
switch (opt) {
case 'p':
cell.nof_ports = (uint32_t) atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
cfi = (uint32_t) atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = (uint32_t) atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = (uint32_t) atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'A':
nof_rx_ant = (uint32_t) atoi(argv[optind]);
nof_rx_ant = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'd':
print_dci_table = true;

@ -75,10 +75,10 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
sf_idx = atoi(argv[optind]);
sf_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
rnti = strtoul(argv[optind], NULL, 0);
@ -87,13 +87,13 @@ void parse_args(int argc, char **argv) {
max_frames = strtoul(argv[optind], NULL, 0);
break;
case 'f':
cfi = atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
dci_format = srslte_dci_format_from_string(argv[optind]);

@ -87,46 +87,46 @@ void parse_args(int argc, char **argv) {
input_file = argv[optind];
break;
case 'm':
mcs[0] = (uint32_t) atoi(argv[optind]);
mcs[0] = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'b':
use_8_bit = true;
break;
case 'M':
mcs[1] = (uint32_t) atoi(argv[optind]);
mcs[1] = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
subframe = atoi(argv[optind]);
subframe = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'X':
M = (uint32_t) atoi(argv[optind]);
M = (int)strtol(argv[optind], NULL, 10);
break;
case 'r':
rv_idx[0] = (uint32_t) atoi(argv[optind]);
rv_idx[0] = (int)strtol(argv[optind], NULL, 10);
break;
case 't':
rv_idx[1] = (uint32_t) atoi(argv[optind]);
rv_idx[1] = (int)strtol(argv[optind], NULL, 10);
break;
case 'R':
rnti = atoi(argv[optind]);
rnti = (uint16_t)strtol(argv[optind], NULL, 10);
break;
case 'F':
cfi = atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'x':
tm = (srslte_tm_t)atoi(argv[optind]) - 1;
tm = (srslte_tm_t)(strtol(argv[optind], NULL, 10) - 1);
break;
case 'p':
pmi = (uint32_t) atoi(argv[optind]);
pmi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'a':
nof_rx_antennas = (uint32_t) atoi(argv[optind]);
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'w':
tb_cw_swap = true;

@ -79,10 +79,10 @@ void parse_args(int argc, char **argv) {
matlab_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
nof_ctrl_symbols = atoi(argv[optind]);
nof_ctrl_symbols = (int)strtol(argv[optind], NULL, 10);
break;
case 'g':
if (!strcmp(argv[optind], "1/6")) {
@ -101,10 +101,10 @@ void parse_args(int argc, char **argv) {
cell.phich_length = SRSLTE_PHICH_EXT;
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -57,13 +57,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cpnvgel")) != -1) {
switch(opt) {
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'g':
if (!strcmp(argv[optind], "1/6")) {

@ -75,22 +75,22 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
sf_idx = atoi(argv[optind]);
sf_idx = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
cfi = atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
cell.nof_ports = atoi(argv[optind]);
cell.nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'M':
mbsfn_area_id = atoi(argv[optind]);
mbsfn_area_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -83,31 +83,31 @@ void parse_args(int argc, char **argv) {
input_file = argv[optind];
break;
case 'm':
mcs_idx = (uint32_t) atoi(argv[optind]);
mcs_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
subframe = atoi(argv[optind]);
subframe = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
rv_idx[0] = (uint32_t) atoi(argv[optind]);
rv_idx[0] = (int)strtol(argv[optind], NULL, 10);
break;
case 'R':
rnti = atoi(argv[optind]);
rnti = (uint16_t)strtol(argv[optind], NULL, 10);
break;
case 'F':
cfi = atoi(argv[optind]);
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
pmi = (uint32_t) atoi(argv[optind]);
pmi = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'a':
nof_rx_antennas = (uint32_t) atoi(argv[optind]);
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -50,16 +50,16 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nfrz")) != -1) {
switch (opt) {
case 'n':
nof_prb = atoi(argv[optind]);
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
config_idx = atoi(argv[optind]);
config_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
root_seq_idx = atoi(argv[optind]);
root_seq_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'z':
zero_corr_zone = atoi(argv[optind]);
zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -52,19 +52,19 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "Nfrzn")) != -1) {
switch (opt) {
case 'N':
nof_prb = atoi(argv[optind]);
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
preamble_format = atoi(argv[optind]);
preamble_format = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
root_seq_idx = atoi(argv[optind]);
root_seq_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'z':
zero_corr_zone = atoi(argv[optind]);
zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
n_seqs = atoi(argv[optind]);
n_seqs = (uint32_t)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -73,41 +73,41 @@ void parse_args(int argc, char **argv) {
output_filename = argv[optind];
break;
case 'f':
uhd_freq = atof(argv[optind]);
uhd_freq = strtof(argv[optind], NULL);
break;
case 'g':
uhd_rx_gain = atof(argv[optind]);
uhd_rx_gain = strtof(argv[optind], NULL);
break;
case 'G':
uhd_tx_gain = atof(argv[optind]);
uhd_tx_gain = strtof(argv[optind], NULL);
break;
case 'P':
preamble_format = atoi(argv[optind]);
preamble_format = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'O':
frequency_offset = atoi(argv[optind]);
frequency_offset = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 't':
timeadv = atof(argv[optind]);
timeadv = strtof(argv[optind], NULL);
break;
case 'p':
nof_prb = atoi(argv[optind]);
nof_prb = (int)strtol(argv[optind], NULL, 10);
if (!srslte_nofprb_isvalid(nof_prb)) {
ERROR("Invalid number of UL RB %d\n", nof_prb);
exit(-1);
}
break;
case 'F':
preamble_format = atoi(argv[optind]);
preamble_format = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'r':
root_seq_idx = atoi(argv[optind]);
root_seq_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
seq_idx = atoi(argv[optind]);
seq_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'z':
zero_corr_zone = atoi(argv[optind]);
zero_corr_zone = (uint32_t)strtol(argv[optind], NULL, 10);
break;
default:
usage(argv[0]);

@ -56,13 +56,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "csNnqv")) != -1) {
switch(opt) {
case 's':
subframe = atoi(argv[optind]);
subframe = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
cell.nof_prb = atoi(argv[optind]);
cell.nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'c':
cell.id = atoi(argv[optind]);
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'q':
test_cqi_only = true;

@ -48,10 +48,10 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "csefl")) != -1) {
switch (opt) {
case 'c':
cell_id = atoi(argv[optind]);
cell_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
nof_bits = atoi(argv[optind]);
nof_bits = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
cp = SRSLTE_CP_EXT;

@ -44,10 +44,10 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "nf")) != -1) {
switch (opt) {
case 'n':
num_samples = atoi(argv[optind]);
num_samples = (int)strtol(argv[optind], NULL, 10);
break;
case 'f':
freq = atof(argv[optind]);
freq = strtof(argv[optind], NULL);
break;
default:
usage(argv[0]);

@ -76,19 +76,19 @@ void parse_args(int argc, char** argv)
input_file_name = argv[optind];
break;
case 't':
threshold = atof(argv[optind]);
threshold = strtof(argv[optind], NULL);
break;
case 'o':
file_offset = atoi(argv[optind]);
file_offset = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
N_id_2_sync = atoi(argv[optind]);
N_id_2_sync = (int)strtol(argv[optind], NULL, 10);
break;
case 's':
save_frame_to_file = true;
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -51,7 +51,7 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "lv")) != -1) {
switch (opt) {
case 'l':
input_len = atoi(argv[optind]);
input_len = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose = SRSLTE_VERBOSE_DEBUG;

@ -84,26 +84,26 @@ void parse_args(int argc, char** argv)
has_cfo_corr = false;
break;
case 'c':
cfo_fixed = atof(argv[optind]);
cfo_fixed = strtof(argv[optind], NULL);
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 't':
threshold = atof(argv[optind]);
threshold = strtof(argv[optind], NULL);
break;
case 'i':
cell.base.id = atoi(argv[optind]);
cell.base.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
save_frame_to_file = true;
disable_plots = true;
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'd':
disable_plots = true;

@ -66,13 +66,13 @@ void parse_args(int argc, char** argv)
input_file_name = argv[optind];
break;
case 'c':
n_id_ncell = atoi(argv[optind]);
n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
sfn = atoi(argv[optind]);
sfn = (int)strtol(argv[optind], NULL, 10);
break;
case 'r':
max_num_sf = atoi(argv[optind]);
max_num_sf = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose = SRSLTE_VERBOSE_DEBUG;

@ -75,22 +75,22 @@ void parse_args(int argc, char** argv)
has_cfo_corr = false;
break;
case 'c':
cfo_fixed = atof(argv[optind]);
cfo_fixed = strtof(argv[optind], NULL);
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 't':
threshold = atof(argv[optind]);
threshold = strtof(argv[optind], NULL);
break;
case 'i':
cell.n_id_ncell = atoi(argv[optind]);
cell.n_id_ncell = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose++;

@ -72,25 +72,25 @@ void parse_args(int argc, char **argv) {
input_file_name = argv[optind];
break;
case 't':
threshold = atof(argv[optind]);
threshold = strtof(argv[optind], NULL);
break;
case 'e':
cp = SRSLTE_CP_EXT;
break;
case 'i':
cell_id = atoi(argv[optind]);
cell_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'o':
file_offset = atoi(argv[optind]);
file_offset = (int)strtol(argv[optind], NULL, 10);
break;
case 'l':
N_id_2_sync = atoi(argv[optind]);
N_id_2_sync = (int)strtol(argv[optind], NULL, 10);
break;
case 's':
fft_size = atoi(argv[optind]);
fft_size = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'd':
disable_plots = true;

@ -75,31 +75,31 @@ void parse_args(int argc, char **argv) {
rf_args = argv[optind];
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
break;
case 'f':
rf_freq = atof(argv[optind]);
rf_freq = strtof(argv[optind], NULL);
break;
case 't':
threshold = atof(argv[optind]);
threshold = strtof(argv[optind], NULL);
break;
case 'e':
cp = SRSLTE_CP_EXT;
break;
case 'i':
cell_id = atoi(argv[optind]);
cell_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'T':
tdd_mode = true;
break;
case 'l':
N_id_2_sync = atoi(argv[optind]);
N_id_2_sync = (int)strtol(argv[optind], NULL, 10);
break;
case 's':
fft_size = atoi(argv[optind]);
fft_size = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'n':
nof_frames = atoi(argv[optind]);
nof_frames = (int)strtol(argv[optind], NULL, 10);
break;
case 'd':
disable_plots = true;

@ -63,13 +63,13 @@ void parse_args(int argc, char** argv)
input_file_name = argv[optind];
break;
case 'c':
cfo = atof(argv[optind]);
cfo = strtof(argv[optind], NULL);
break;
case 'g':
snr = atof(argv[optind]);
snr = strtof(argv[optind], NULL);
break;
case 'o':
offset = atoi(argv[optind]);
offset = (int)strtol(argv[optind], NULL, 10);
break;
case 'v':
srslte_verbose = SRSLTE_VERBOSE_DEBUG;

@ -51,13 +51,13 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "cpoev")) != -1) {
switch (opt) {
case 'c':
cell_id = atoi(argv[optind]);
cell_id = (int)strtol(argv[optind], NULL, 10);
break;
case 'p':
nof_prb = atoi(argv[optind]);
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'o':
offset = atoi(argv[optind]);
offset = (int)strtol(argv[optind], NULL, 10);
break;
case 'e':
cp = SRSLTE_CP_EXT;

@ -51,7 +51,7 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "Nbmnd")) != -1) {
switch (opt) {
case 'N':
N = atoi(argv[optind]);
N = (int)strtol(argv[optind], NULL, 10);
break;
case 'b':
forward = false;

@ -61,7 +61,7 @@ static sem_t plot_sem;
static uint32_t plot_sf_idx = 0;
static plot_real_t fft_plot[SRSLTE_MAX_RADIOS] = {};
static cf_t* fft_plot_buffer[SRSLTE_MAX_RADIOS] = {};
static float* fft_plot_temp = NULL;
static float* fft_plot_temp = nullptr;
static uint32_t fft_plot_buffer_size;
srslte_dft_plan_t dft_spectrum = {};
#endif /* ENABLE_GUI */
@ -94,10 +94,10 @@ void parse_args(int argc, char **argv) {
while ((opt = getopt(argc, argv, "foabcderpsStvhmFxwg")) != -1) {
switch (opt) {
case 'f':
freq = atof(argv[optind]);
freq = strtof(argv[optind], NULL);
break;
case 'g':
rf_gain = atof(argv[optind]);
rf_gain = strtof(argv[optind], NULL);
agc_enable = false;
break;
case 'o':
@ -116,16 +116,16 @@ void parse_args(int argc, char **argv) {
radios_args[2][63] = '\0';
break;
case 'r':
nof_radios = (uint32_t)atoi(argv[optind]);
nof_radios = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'p':
nof_ports = (uint32_t)atoi(argv[optind]);
nof_ports = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
srate = atof(argv[optind]);
srate = strtof(argv[optind], NULL);
break;
case 't':
duration = atof(argv[optind]);
duration = strtof(argv[optind], NULL);
break;
case 'm':
measure_delay ^= true;

@ -131,7 +131,7 @@ bool hss::read_db_file(std::string db_filename)
m_hss_log->error("Neither XOR nor MILENAGE configured.\n");
return false;
}
ue_ctx->imsi = atoll(split[2].c_str());
ue_ctx->imsi = strtoull(split[2].c_str(), nullptr, 10);
get_uint_vec_from_hex_str(split[3], ue_ctx->key, 16);
if (split[4] == std::string("op")) {
ue_ctx->op_configured = true;
@ -155,7 +155,7 @@ bool hss::read_db_file(std::string db_filename)
m_hss_log->debug_hex(ue_ctx->opc, 16, "User OPc : ");
m_hss_log->debug_hex(ue_ctx->amf, 2, "AMF : ");
m_hss_log->debug_hex(ue_ctx->sqn, 6, "SQN : ");
ue_ctx->qci = atoi(split[8].c_str());
ue_ctx->qci = (uint16_t)strtol(split[8].c_str(), nullptr, 10);
m_hss_log->debug("Default Bearer QCI: %d\n", ue_ctx->qci);
if (split[9] == std::string("dynamic")) {

@ -221,7 +221,7 @@ private:
if(line.substr(0,len).compare(key)) {
return false;
}
*var = (T)atoi(line.substr(len).c_str());
*var = (T)strtol(line.substr(len).c_str(), NULL, 10);
return true;
}
@ -248,7 +248,7 @@ private:
std::string substr;
getline(ss, substr, ',');
if (not substr.empty()) {
list.push_back(atoi(substr.c_str()));
list.push_back(strtol(substr.c_str(), nullptr, 10));
}
}
return list;

@ -55,7 +55,7 @@ public:
args.stack.rrc.feature_group = 0xe6041000;
args.stack.rrc.ue_category_str = SRSLTE_UE_CATEGORY_DEFAULT;
args.stack.rrc.ue_category = atoi(args.stack.rrc.ue_category_str.c_str());
args.stack.rrc.ue_category = strtol(args.stack.rrc.ue_category_str.c_str(), nullptr, 10);
args.stack.rrc.nof_supported_bands = 1;
args.stack.rrc.supported_bands[0] = 7;
args.stack.rrc.release = 8;

Loading…
Cancel
Save