From 38ab11a6c0299fb55944bdb1438d9ac357682d4d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 20 Feb 2016 09:36:14 -0800 Subject: Add option to allocate the samples in fake_dc() We (ab)use fake_dc() to create a pleasing profile for a manually added dive. Based on it's intended use, fake_dc() simply handed back a dc structure that pointed at staticly allocated samples - that's obviously (now that I think about it) going to blow up in my face if I edit a manually added dive more than once. So now we have an option for fake_dc() to actually allocate the samples - this way the rest of the code can treat these samples as we would treat samples created any other way. We can free them and replace them with a new set. Signed-off-by: Dirk Hohndel --- subsurface-core/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subsurface-core/device.h') diff --git a/subsurface-core/device.h b/subsurface-core/device.h index 9ff2ce23a..8a00b96d3 100644 --- a/subsurface-core/device.h +++ b/subsurface-core/device.h @@ -6,7 +6,7 @@ extern "C" { #endif -extern struct divecomputer *fake_dc(struct divecomputer *dc); +extern struct divecomputer *fake_dc(struct divecomputer *dc, bool alloc); extern void create_device_node(const char *model, uint32_t deviceid, const char *serial, const char *firmware, const char *nickname); extern void call_for_each_dc(void *f, void (*callback)(void *, const char *, uint32_t, const char *, const char *, const char *), bool select_only); -- cgit v1.2.3-70-g09d2