diff options
-rw-r--r-- | core/dive.h | 2 | ||||
-rw-r--r-- | core/libdivecomputer.c | 8 | ||||
-rw-r--r-- | core/plannernotes.c | 8 | ||||
-rw-r--r-- | core/qthelper.cpp | 4 | ||||
-rw-r--r-- | core/qthelper.h | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/core/dive.h b/core/dive.h index ca0325192..f81423f24 100644 --- a/core/dive.h +++ b/core/dive.h @@ -1016,7 +1016,7 @@ extern void set_userid(const char *user_id); extern void set_informational_units(const char *units); extern void set_git_prefs(const char *prefs); -extern const char *get_dive_date_c_string(timestamp_t when); +extern char *get_dive_date_c_string(timestamp_t when); extern void update_setpoint_events(struct dive *dive, struct divecomputer *dc); #ifdef __cplusplus } diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index be0bb01a5..a666ca667 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -618,9 +618,9 @@ static dc_status_t libdc_header_parser(dc_parser_t *parser, device_data_t *devda } // Parse the divetime. - const char *date_string = get_dive_date_c_string(dive->when); + char *date_string = get_dive_date_c_string(dive->when); dev_info(devdata, translate("gettextFromC", "Dive %d: %s"), import_dive_number, date_string); - free((void *)date_string); + free(date_string); unsigned int divetime = 0; rc = dc_parser_get_field(parser, DC_FIELD_DIVETIME, 0, &divetime); @@ -802,9 +802,9 @@ static int dive_cb(const unsigned char *data, unsigned int size, /* If we already saw this dive, abort. */ if (!devdata->force_download && find_dive(&dive->dc)) { - const char *date_string = get_dive_date_c_string(dive->when); + char *date_string = get_dive_date_c_string(dive->when); dev_info(devdata, translate("gettextFromC", "Already downloaded dive at %s"), date_string); - free((void *)date_string); + free(date_string); goto error_exit; } diff --git a/core/plannernotes.c b/core/plannernotes.c index c0647ebe6..e05f27738 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -137,15 +137,15 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d dive->notes = strdup(buffer); goto finished; } else if (diveplan->surface_interval >= 48 * 60 *60) { - const char *current_date = get_current_date(); + char *current_date = get_current_date(); len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>", translate("gettextFromC", "Subsurface"), subsurface_canonical_version(), translate("gettextFromC", "dive plan</b> created on"), current_date); - free((void *)current_date); + free(current_date); } else { - const char *current_date = get_current_date(); + char *current_date = get_current_date(); len += snprintf_loc(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>", translate("gettextFromC", "Subsurface"), subsurface_canonical_version(), @@ -153,7 +153,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d FRACTION(diveplan->surface_interval / 60, 60), translate("gettextFromC", "created on"), current_date); - free((void *)current_date); + free(current_date); } if (prefs.display_variations && decoMode() != RECREATIONAL) diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 6c4fc099c..fb32fabe5 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -976,13 +976,13 @@ QString get_short_dive_date_string(timestamp_t when) return loc.toString(ts.toUTC(), QString(prefs.date_format_short) + " " + prefs.time_format); } -const char *get_dive_date_c_string(timestamp_t when) +char *get_dive_date_c_string(timestamp_t when) { QString text = get_dive_date_string(when); return copy_qstring(text); } -extern "C" const char *get_current_date() +extern "C" char *get_current_date() { QDateTime ts(QDateTime::currentDateTime());; QString current_date; diff --git a/core/qthelper.h b/core/qthelper.h index 02fc629f8..4c0dcda66 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -79,7 +79,7 @@ char *picturedir_string(); const char *subsurface_user_agent(); enum deco_mode decoMode(); int parse_seabear_header(const char *filename, char **params, int pnr); -const char *get_current_date(); +char *get_current_date(); double cache_value(int tissue, int timestep, enum inertgas gas); void cache_insert(int tissue, int timestep, enum inertgas gas, double value); void print_qt_versions(); |