Skip to content

Commit

Permalink
Merge pull request #1335 from GPSBabel/tidymore
Browse files Browse the repository at this point in the history
clang tidy fixes
  • Loading branch information
tsteven4 authored Sep 6, 2024
2 parents a83ddad + e5f9ad2 commit db5fa78
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion grtcirc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <tuple> // for tie, tuple, make_tuple, ignore

#include "defs.h" // for PositionRad, DEG, METERS_TO_MILES, PositionDeg
#include "grtcirc.h"

static constexpr double EARTH_RAD = 6378137.0;

Expand Down
4 changes: 2 additions & 2 deletions html.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ HtmlFormat::write()
// Don't write this line when running test suite. Actually, we should
// probably not write this line at all...
if (!gpsbabel_testmode()) {
*file_out << " <meta name=\"Generator\" content=\"GPSBabel "
*file_out << R"( <meta name="Generator" content="GPSBabel )"
<< gpsbabel_version << "\">\n";
}
*file_out << " <title>GPSBabel HTML Output</title>\n";
if (stylesheet) {
*file_out << " <link rel=\"stylesheet\" type=\"text/css\" href=\""
*file_out << R"( <link rel="stylesheet" type="text/css" href=")"
<< stylesheet << "\">\n";
} else {
*file_out << " <style>\n";
Expand Down
8 changes: 4 additions & 4 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ main(int argc, char* argv[])
#endif

if constexpr (DEBUG_LOCALE) {
printf("Initial locale: %s\n",setlocale(LC_ALL, NULL));
printf("Initial locale: %s\n",setlocale(LC_ALL, nullptr));
}

// Create a QCoreApplication object to handle application initialization.
Expand All @@ -764,7 +764,7 @@ main(int argc, char* argv[])
// as opposed to the initial default "C" locale.
// This was demonstrated with Qt5 on Mac OS X.
if constexpr (DEBUG_LOCALE) {
printf("Locale after initial setup: %s\n",setlocale(LC_ALL, NULL));
printf("Locale after initial setup: %s\n",setlocale(LC_ALL, nullptr));
}
// As recommended in QCoreApplication reset the locale to the default.
// Note the documentation says to set LC_NUMERIC, but QCoreApplicationPrivate::initLocale()
Expand All @@ -776,7 +776,7 @@ main(int argc, char* argv[])
}
setlocale(LC_NUMERIC,"C");
if constexpr (DEBUG_LOCALE) {
printf("LC_ALL: %s\n",setlocale(LC_ALL, NULL));
printf("LC_ALL: %s\n",setlocale(LC_ALL, nullptr));
}
}
/* reset LC_TIME for strftime */
Expand All @@ -786,7 +786,7 @@ main(int argc, char* argv[])
}
setlocale(LC_TIME,"C");
if constexpr (DEBUG_LOCALE) {
printf("LC_ALL: %s\n",setlocale(LC_ALL, NULL));
printf("LC_ALL: %s\n",setlocale(LC_ALL, nullptr));
}
}
qInstallMessageHandler(MessageHandler);
Expand Down
2 changes: 1 addition & 1 deletion unicsv.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class UnicsvFormat : public Format
static QTime unicsv_parse_time(const char* str, QDate& date);
static QTime unicsv_parse_time(const QString& str, QDate& date);
static Geocache::status_t unicsv_parse_status(const QString& str);
QDateTime unicsv_adjust_time(const QDate date, const QTime time, bool is_localtime) const;
QDateTime unicsv_adjust_time(QDate date, QTime time, bool is_localtime) const;
static bool unicsv_compare_fields(const QString& s, const field_t* f);
void unicsv_fondle_header(QString header);
void unicsv_parse_one_line(const QString& ibuf);
Expand Down
2 changes: 1 addition & 1 deletion vcf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ VcfFormat::vcf_disp(const Waypoint* wpt)
vcf_print_utf(&wpt->gc_data->desc_short);
gbfprintf(file_out, "\\n");
vcf_print_utf(&wpt->gc_data->desc_long);
gbfprintf(file_out, "\\n\\nHINT:\\n");
gbfprintf(file_out, R"(\n\nHINT:\n)");
if (vcf_encrypt) {
QString s = rot13(wpt->gc_data->hint);
vcf_print(s);
Expand Down
2 changes: 1 addition & 1 deletion xcsv.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class XcsvFormat : public Format
/* Member Functions */

static QDate yyyymmdd_to_time(const QString& s);
QDateTime xcsv_adjust_time(const QDate date, const QTime time, bool is_localtime) const;
QDateTime xcsv_adjust_time(QDate date, QTime time, bool is_localtime) const;
static void sscanftime(const char* s, const char* format, QDate& date, QTime& time);
static QString writetime(const char* format, time_t t, bool gmt);
static QString writetime(const char* format, const gpsbabel::DateTime& t, bool gmt);
Expand Down

0 comments on commit db5fa78

Please sign in to comment.