Berthold Stoeger f5b11daffd Cleanup: return gasmix by value
Currently, get_gasmix_from_event() and get_gasmix() return pointers
to either static or to (possibly changing) dive data. This seems like
a dangerous practice and the returned data should be used immediately.

Instead, return the gasmix by value. This is in preparation of
const-ifying input parameters of a number of core functions, which
will ultimately let the merge() function take const-arguments in
preparation of undo of dive-merging.

On common 64-bit systems gasmix (two "int"s) is the size of a pointer
and can be returned in a register.

On 32-bit systems a pointer to the struct to be filled out will be
passed.

Since get_gasmix() now returns a value, the first invocation is
tested by a NULL-initialized "struct event *". Document this in
a comment.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-23 05:16:38 -07:00
..
2018-07-18 02:09:15 +03:00
2018-07-18 02:09:15 +03:00
2017-11-25 20:13:01 +01:00
2018-08-23 05:16:38 -07:00
2018-08-23 05:16:38 -07:00
2018-08-23 05:16:38 -07:00
2018-01-31 14:47:26 +01:00
2017-04-29 13:32:55 -07:00
2018-01-08 09:52:55 +02:00
2017-05-26 15:52:04 -07:00
2018-05-27 23:18:01 +03:00
2018-07-04 02:27:36 +08:00
2017-05-26 15:44:36 -07:00
2018-08-23 05:16:38 -07:00
2018-04-28 20:11:22 +03:00
2018-07-12 08:08:00 -07:00
2018-08-23 05:16:38 -07:00
2017-04-29 13:32:55 -07:00
2018-08-23 05:16:38 -07:00
2018-08-12 15:37:21 -07:00
2018-05-30 21:47:07 -07:00
2017-04-29 13:32:55 -07:00
2017-10-04 08:05:09 -07:00
2017-04-29 13:32:55 -07:00
2017-04-29 13:32:55 -07:00
2018-08-14 14:13:52 -07:00