From: tsteven4 Date: Sun, 1 Jul 2018 19:23:38 +0000 (-0600) Subject: a few more const_cast eliminations. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~115^2~1^2~114^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=23cb08f17;p=gpsbabel.git a few more const_cast eliminations. --- diff --git a/gdb.cc b/gdb.cc index e1a2f99c8..030d40e16 100644 --- a/gdb.cc +++ b/gdb.cc @@ -1631,7 +1631,7 @@ write_waypoint_cb(const Waypoint* refpt) // but, but, casting away the const here is wrong... (const_cast(refpt))->shortname = refpt->shortname.trimmed(); #else - rtrim(((Waypoint*)refpt)->shortname); + rtrim(const_cast(refpt))->shortname); #endif test = gdb_find_wayptq(&wayptq_out, refpt, 1); diff --git a/trackfilter.cc b/trackfilter.cc index 22ddcd86a..df783cd7f 100644 --- a/trackfilter.cc +++ b/trackfilter.cc @@ -60,7 +60,7 @@ int TrackFilter::trackfilter_parse_time_opt(const char* arg) { time_t t0, t1; int sign = 1; - char* cin = const_cast(arg); + const char* cin = arg; char c; t0 = t1 = 0; @@ -741,13 +741,13 @@ time_t TrackFilter::trackfilter_range_check(const char* timestr) int i; char fmt[20]; char c; - char* cin; + const char* cin; struct tm time; i = 0; strncpy(fmt, "00000101000000", sizeof(fmt)); - cin = const_cast(timestr); + cin = timestr; while ((c = *cin++)) { if (fmt[i] == '\0') {