Fix some clang-tidy warnings

master
dvdgrgrtt 3 years ago committed by dvdgrgrtt
parent 7752feb3c2
commit 864cb14eec

@ -73,10 +73,12 @@ static int compare_floats(const void* a, const void* b)
float arg1 = *(const float*)a; float arg1 = *(const float*)a;
float arg2 = *(const float*)b; float arg2 = *(const float*)b;
if (arg1 < arg2) if (arg1 < arg2) {
return -1; return -1;
if (arg1 > arg2) }
if (arg1 > arg2) {
return 1; return 1;
}
return 0; return 0;
} }
@ -112,12 +114,13 @@ static float anderson(const float* x, uint32_t half_length, float* y)
qsort(y, length, sizeof(float), compare_floats); qsort(y, length, sizeof(float), compare_floats);
// compute Anderson--Darling statistic // compute Anderson--Darling statistic
float cdf1, cdf2; float cdf1 = NAN;
float a2 = 0; float cdf2 = NAN;
float a2 = 0;
for (uint32_t ii = 0; ii < nof_samples; ii++) { for (uint32_t ii = 0; ii < nof_samples; ii++) {
cdf1 = CDF(y[ii]); cdf1 = CDF(y[ii]);
cdf2 = CDF(y[length - ii - 1]); cdf2 = CDF(y[length - ii - 1]);
a2 += (2 * ii + 1) * (logf(cdf1) + log1pf(-cdf2)) + (2 * (length - ii) - 1) * (logf(cdf2) + log1pf(-cdf1)); a2 += (2.F * ii + 1) * (logf(cdf1) + log1pf(-cdf2)) + (2.F * (length - ii) - 1) * (logf(cdf2) + log1pf(-cdf1));
} }
a2 = -length_f - a2 / length_f; a2 = -length_f - a2 / length_f;
a2 = a2 * (1 + (4 - 25 / length_f) / length_f); a2 = a2 * (1 + (4 - 25 / length_f) / length_f);

@ -32,8 +32,8 @@ static double assert_pucch_snr_min = 0.000;
test_bench::args_t::args_t(int argc, char** argv) test_bench::args_t::args_t(int argc, char** argv)
{ {
std::string config_file = ""; std::string config_file;
std::string reference_cfg_str = ""; std::string reference_cfg_str;
bpo::options_description options; bpo::options_description options;
bpo::options_description options_tb("Test bench options"); bpo::options_description options_tb("Test bench options");
bpo::options_description options_gnb_stack("gNb stack and scheduling related options"); bpo::options_description options_gnb_stack("gNb stack and scheduling related options");
@ -143,7 +143,7 @@ test_bench::args_t::args_t(int argc, char** argv)
} }
// if config file given // if config file given
if (vm.count("config_file")) { if (vm.count("config_file") != 0U) {
std::cout << "Reading configuration file " << config_file << "..." << std::endl; std::cout << "Reading configuration file " << config_file << "..." << std::endl;
std::ifstream conf(config_file.c_str(), std::ios::in); std::ifstream conf(config_file.c_str(), std::ios::in);
if (conf.fail()) { if (conf.fail()) {

Loading…
Cancel
Save