From bcf41c0361815ccd5b1be7a434911f0648dbe76d Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Wed, 6 Sep 2023 07:12:40 -0600 Subject: [PATCH] use bools with mkshort setters --- garmin.cc | 14 +++++++------- garmin_gpi.cc | 8 ++++---- gdb.cc | 8 ++++---- gpx.cc | 2 +- humminbird.cc | 24 ++++++++++++------------ tpg.cc | 4 ++-- xcsv.h | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/garmin.cc b/garmin.cc index 002cdcee5..159d3c02d 100644 --- a/garmin.cc +++ b/garmin.cc @@ -76,7 +76,7 @@ static char* baudopt = nullptr; static char* opt_codec = nullptr; static int baud = 0; static int categorybits; -static int receiver_must_upper = 1; +static bool receiver_must_upper = true; static QTextCodec* codec{nullptr}; #define MILITANT_VALID_WAYPT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" @@ -156,7 +156,7 @@ write_char_string(char* dest, const char* source, size_t destsize) static void rw_init(const QString& fname) { - receiver_must_upper = 1; + receiver_must_upper = true; const char* receiver_charset = "US-ASCII"; if (!mkshort_handle) { @@ -271,7 +271,7 @@ rw_init(const QString& fname) break; case 382: /* C320 */ receiver_short_length = 30; - receiver_must_upper = 0; + receiver_must_upper = false; break; case 292: /* (60|76)C[S]x series */ case 421: /* Vista|Legend Cx */ @@ -281,7 +281,7 @@ rw_init(const QString& fname) case 957: /* Legend HC */ receiver_short_length = 14; snwhiteopt = xstrdup("1"); - receiver_must_upper = 0; + receiver_must_upper = false; /* This might be 8859-1 */ receiver_charset = "windows-1252"; break; @@ -293,16 +293,16 @@ rw_init(const QString& fname) break; case 231: /* Quest */ case 463: /* Quest 2 */ - receiver_must_upper = 0; + receiver_must_upper = false; receiver_short_length = 30; receiver_charset = "windows-1252"; break; case 577: // Rino 530HCx Version 2.50 - receiver_must_upper = 0; + receiver_must_upper = false; receiver_short_length = 14; break; case 429: // Streetpilot i3 - receiver_must_upper = 0; + receiver_must_upper = false; receiver_charset = "windows-1252"; receiver_short_length = 30; break; diff --git a/garmin_gpi.cc b/garmin_gpi.cc index 96e0161c8..793c3c117 100644 --- a/garmin_gpi.cc +++ b/garmin_gpi.cc @@ -1256,10 +1256,10 @@ GarminGPIFormat::wr_init(const QString& fname) short_h->set_length(1024); short_h->set_badchars("\r\n"); - short_h->set_mustupper(0); - short_h->set_mustuniq(1); - short_h->set_whitespace_ok(1); - short_h->set_repeating_whitespace_ok(0); + short_h->set_mustupper(false); + short_h->set_mustuniq(true); + short_h->set_whitespace_ok(true); + short_h->set_repeating_whitespace_ok(false); short_h->set_defname("POI"); codepage = 0; diff --git a/gdb.cc b/gdb.cc index e173e01ec..5efbb55f3 100644 --- a/gdb.cc +++ b/gdb.cc @@ -1120,10 +1120,10 @@ GdbFormat::reset_short_handle(const char* defname) short_h->set_length(kGDBNameBufferLen); short_h->set_badchars("\r\n\t"); - short_h->set_mustupper(0); - short_h->set_mustuniq(1); - short_h->set_whitespace_ok(1); - short_h->set_repeating_whitespace_ok(1); + short_h->set_mustupper(false); + short_h->set_mustuniq(true); + short_h->set_whitespace_ok(true); + short_h->set_repeating_whitespace_ok(true); short_h->set_defname(defname); } diff --git a/gpx.cc b/gpx.cc index 197569064..6d0a4c042 100644 --- a/gpx.cc +++ b/gpx.cc @@ -96,7 +96,7 @@ GpxFormat::gpx_reset_short_handle() mkshort_handle = new MakeShort; if (suppresswhite) { - mkshort_handle->set_whitespace_ok(0); + mkshort_handle->set_whitespace_ok(false); } mkshort_handle->set_length(xstrtoi(snlen, nullptr, 10)); diff --git a/humminbird.cc b/humminbird.cc index 5c8ff3707..ea3f2f3a8 100644 --- a/humminbird.cc +++ b/humminbird.cc @@ -587,28 +587,28 @@ HumminbirdBase::humminbird_wr_init(const QString& fname) wptname_sh->set_length(WPT_NAME_LEN - 1); wptname_sh->set_badchars(BAD_CHARS); - wptname_sh->set_mustupper(0); - wptname_sh->set_mustuniq(0); - wptname_sh->set_whitespace_ok(1); - wptname_sh->set_repeating_whitespace_ok(1); + wptname_sh->set_mustupper(false); + wptname_sh->set_mustuniq(false); + wptname_sh->set_whitespace_ok(true); + wptname_sh->set_repeating_whitespace_ok(true); wptname_sh->set_defname("WPT"); rtename_sh = new MakeShort; rtename_sh->set_length(RTE_NAME_LEN - 1); rtename_sh->set_badchars(BAD_CHARS); - rtename_sh->set_mustupper(0); - rtename_sh->set_mustuniq(0); - rtename_sh->set_whitespace_ok(1); - rtename_sh->set_repeating_whitespace_ok(1); + rtename_sh->set_mustupper(false); + rtename_sh->set_mustuniq(false); + rtename_sh->set_whitespace_ok(true); + rtename_sh->set_repeating_whitespace_ok(true); rtename_sh->set_defname("Route"); trkname_sh = new MakeShort; trkname_sh->set_length(RTE_NAME_LEN - 1); trkname_sh->set_badchars(BAD_CHARS); - trkname_sh->set_mustupper(0); - trkname_sh->set_mustuniq(0); - trkname_sh->set_whitespace_ok(1); - trkname_sh->set_repeating_whitespace_ok(1); + trkname_sh->set_mustupper(false); + trkname_sh->set_mustuniq(false); + trkname_sh->set_whitespace_ok(true); + trkname_sh->set_repeating_whitespace_ok(true); trkname_sh->set_defname("Track"); waypoint_num = 0; diff --git a/tpg.cc b/tpg.cc index 0d9eeb52e..615a08de2 100644 --- a/tpg.cc +++ b/tpg.cc @@ -293,8 +293,8 @@ tpg_write() if (global_opts.synthesize_shortnames) { mkshort_handle->set_length(32); - mkshort_handle->set_whitespace_ok(1); - mkshort_handle->set_mustupper(1); + mkshort_handle->set_whitespace_ok(true); + mkshort_handle->set_mustupper(true); } if (s > MAXTPGOUTPUTPINS) { diff --git a/xcsv.h b/xcsv.h index 22c0102d0..3a586c0c5 100644 --- a/xcsv.h +++ b/xcsv.h @@ -240,7 +240,7 @@ class XcsvStyle std::optional shortlen; /* SHORTWHITE from style file */ - std::optional whitespace_ok; + std::optional whitespace_ok; private: /* Types */