Skip to content

Commit

Permalink
use bools with mkshort setters
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Sep 6, 2023
1 parent d16e188 commit bcf41c0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
14 changes: 7 additions & 7 deletions garmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 */
Expand All @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions garmin_gpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions gdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion gpx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
24 changes: 12 additions & 12 deletions humminbird.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tpg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion xcsv.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class XcsvStyle
std::optional<int> shortlen;

/* SHORTWHITE from style file */
std::optional<int> whitespace_ok;
std::optional<bool> whitespace_ok;

private:
/* Types */
Expand Down

0 comments on commit bcf41c0

Please sign in to comment.