mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn string data in struct divecomputer into std::string
Simplifies memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
cc39f709ce
commit
b9a2eff3c9
28 changed files with 114 additions and 147 deletions
|
@ -205,10 +205,8 @@ static int seac_dive(void *param, int, char **data, char **)
|
|||
settings_start(state);
|
||||
dc_settings_start(state);
|
||||
|
||||
// These dc values are const char *, therefore we have to cast.
|
||||
// Will be fixed by converting to std::string
|
||||
utf8_string(data[1], (char **)&state->cur_dive->dc.serial);
|
||||
utf8_string(data[12], (char **)&state->cur_dive->dc.fw_version);
|
||||
utf8_string_std(data[1], &state->cur_dive->dc.serial);
|
||||
utf8_string_std(data[12],&state->cur_dive->dc.fw_version);
|
||||
state->cur_dive->dc.model = strdup("Seac Action");
|
||||
|
||||
state->cur_dive->dc.deviceid = calculate_string_hash(data[1]);
|
||||
|
@ -225,7 +223,6 @@ static int seac_dive(void *param, int, char **data, char **)
|
|||
|
||||
curcyl->gasmix.o2.permille = 10 * sqlite3_column_int(sqlstmt, 4);
|
||||
|
||||
|
||||
// Track gasses to tell when switch occurs
|
||||
lastgas = curcyl->gasmix;
|
||||
curgas = curcyl->gasmix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue