mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 12:40:35 +00:00
clang-tidy compromise; fix some, silence some
This commit is contained in:
parent
963b1cc63c
commit
9c773a9dda
@ -3102,7 +3102,7 @@ void readpos(const char *file, const char *rcv, double *pos)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto sta = stas[np++];
|
auto sta = stas[np++]; // NOLINT(readability-qualified-auto)
|
||||||
std::strncpy(sta, str, 16);
|
std::strncpy(sta, str, 16);
|
||||||
sta[15] = '\0';
|
sta[15] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -1956,7 +1956,7 @@ void *ftpthread(void *arg)
|
|||||||
|
|
||||||
/* if local file exist, skip download */
|
/* if local file exist, skip download */
|
||||||
auto tmpfile = local;
|
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)
|
if (tmpfile.extension() == ext)
|
||||||
{
|
{
|
||||||
@ -1980,7 +1980,7 @@ void *ftpthread(void *arg)
|
|||||||
if (*proxyaddr)
|
if (*proxyaddr)
|
||||||
{
|
{
|
||||||
auto proto = "ftp"s;
|
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) + " % ";
|
env = "set "s + proto + "_proxy=http://"s + std::string(proxyaddr) + " % ";
|
||||||
proxyopt = "--proxy=on ";
|
proxyopt = "--proxy=on ";
|
||||||
}
|
}
|
||||||
@ -1991,18 +1991,18 @@ void *ftpthread(void *arg)
|
|||||||
{ /* ftp */
|
{ /* ftp */
|
||||||
auto opt_str = "--ftp-user="s + std::string(ftp->user) + " --ftp-password="s + std::string(ftp->passwd) +
|
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) +
|
" --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
|
// TODO: this uses shell syntax; consider escaping paths
|
||||||
cmd_str = env + std::string(FTP_CMD) + " "s + opt_str + " "s +
|
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
|
else
|
||||||
{ /* http */
|
{ /* http */
|
||||||
auto opt_str = proxyopt + " -t 1 -T "s + std::to_string(FTP_TIMEOUT) + " -O \""s + local.native() + "\""s;
|
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 +
|
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 */
|
/* execute download command */
|
||||||
std::error_code ec; // prevent exceptions
|
std::error_code ec; // prevent exceptions
|
||||||
@ -2024,7 +2024,7 @@ void *ftpthread(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* uncompress downloaded file */
|
/* 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)
|
if (local.extension() == ext)
|
||||||
{
|
{
|
||||||
@ -2074,7 +2074,7 @@ ftp_t *openftp(const char *path, int type, char *msg)
|
|||||||
ftp->state = 0;
|
ftp->state = 0;
|
||||||
ftp->proto = type;
|
ftp->proto = type;
|
||||||
ftp->error = 0;
|
ftp->error = 0;
|
||||||
ftp->thread = 0; // NOLINT
|
ftp->thread = pthread_t();
|
||||||
ftp->local[0] = '\0';
|
ftp->local[0] = '\0';
|
||||||
|
|
||||||
/* decode ftp path */
|
/* decode ftp path */
|
||||||
|
Loading…
Reference in New Issue
Block a user