From 9c773a9dda53bc2421d9babf399a9f9285ed035b Mon Sep 17 00:00:00 2001 From: Jim Melton Date: Sun, 31 Jul 2022 13:45:17 -0600 Subject: [PATCH] clang-tidy compromise; fix some, silence some --- src/algorithms/libs/rtklib/rtklib_rtkcmn.cc | 2 +- src/algorithms/libs/rtklib/rtklib_stream.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 12d2a8f0a..fe4cffdf9 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -3102,7 +3102,7 @@ void readpos(const char *file, const char *rcv, double *pos) { continue; } - auto sta = stas[np++]; + auto sta = stas[np++]; // NOLINT(readability-qualified-auto) std::strncpy(sta, str, 16); sta[15] = '\0'; } diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 5edd2e195..475aa8a9f 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1956,7 +1956,7 @@ void *ftpthread(void *arg) /* if local file exist, skip download */ auto tmpfile = local; - for (auto ext : {".z", ".gz", ".zip", ".Z", ".GZ", ".ZIP"}) + for (auto ext : {".z", ".gz", ".zip", ".Z", ".GZ", ".ZIP"}) // NOLINT(readability-qualified-auto): auto decoration is less readable { if (tmpfile.extension() == ext) { @@ -1980,7 +1980,7 @@ void *ftpthread(void *arg) if (*proxyaddr) { auto proto = "ftp"s; - if (ftp->proto) proto = "http"s; + if (ftp->proto) proto = "http"s; // NOLINT(readability-braces-around-statements): adding braces reduces readability env = "set "s + proto + "_proxy=http://"s + std::string(proxyaddr) + " % "; proxyopt = "--proxy=on "; } @@ -1991,18 +1991,18 @@ void *ftpthread(void *arg) { /* ftp */ auto opt_str = "--ftp-user="s + std::string(ftp->user) + " --ftp-password="s + std::string(ftp->passwd) + " --glob=off --passive-ftp "s + proxyopt + "s-t 1 -T "s + std::to_string(FTP_TIMEOUT) + - " -O \"" + local.native() + "\""s; + R"( -O ")" + local.native() + R"(")"s; // TODO: this uses shell syntax; consider escaping paths cmd_str = env + std::string(FTP_CMD) + " "s + opt_str + " "s + - "\"ftp://"s + std::string(ftp->addr) + "/"s + remotePath.native() + "\" 2> \""s + errfile.native() + "\"\n"s; + R"("ftp://)"s + std::string(ftp->addr) + "/"s + remotePath.native() + R"(" 2> ")"s + errfile.native() + "\"\n"s; } else { /* http */ auto opt_str = proxyopt + " -t 1 -T "s + std::to_string(FTP_TIMEOUT) + " -O \""s + local.native() + "\""s; cmd_str = env + std::string(FTP_CMD) + " "s + opt_str + " "s + - "\"http://"s + std::string(ftp->addr) + "/"s + remotePath.native() + "\" 2> \""s + errfile.native() + "\"\n"; + R"("http://)"s + std::string(ftp->addr) + "/"s + remotePath.native() + R"(" 2> ")"s + errfile.native() + "\"\n"; } /* execute download command */ std::error_code ec; // prevent exceptions @@ -2024,7 +2024,7 @@ void *ftpthread(void *arg) } /* uncompress downloaded file */ - for (auto ext : {".z", ".gz", ".zip", ".Z", ".GZ", ".ZIP"}) + for (auto ext : {".z", ".gz", ".zip", ".Z", ".GZ", ".ZIP"}) // NOLINT(readability-qualified-auto): auto decoration is less readable { if (local.extension() == ext) { @@ -2074,7 +2074,7 @@ ftp_t *openftp(const char *path, int type, char *msg) ftp->state = 0; ftp->proto = type; ftp->error = 0; - ftp->thread = 0; // NOLINT + ftp->thread = pthread_t(); ftp->local[0] = '\0'; /* decode ftp path */