subsurface/profile-widget
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
..
animationfunctions.cpp profile-widget: remove SettingsObjectWrapper and update qPref calls 2018-08-15 16:11:39 -07:00
animationfunctions.h Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
CMakeLists.txt Correctly handle SubsurfaceMobile 2016-01-08 08:04:24 -08:00
divecartesianaxis.cpp profile-widget: remove SettingsObjectWrapper and update qPref calls 2018-08-15 16:11:39 -07:00
divecartesianaxis.h Cleanup: replace virtual by override where appropriate 2018-07-31 11:02:34 +02:00
diveeventitem.cpp Cleanup: return gasmix by value 2018-08-23 05:16:38 -07:00
diveeventitem.h Cleanup: replace virtual by override where appropriate 2018-07-31 11:02:34 +02:00
divelineitem.cpp Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
divelineitem.h Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
divepixmapitem.cpp Dive video: paint duration-bar above thumbnail in profile plot 2018-07-23 15:58:55 -07:00
divepixmapitem.h Cleanup: remove all override modifiers 2018-08-01 06:30:00 -07:00
diveprofileitem.cpp Cleanup: return gasmix by value 2018-08-23 05:16:38 -07:00
diveprofileitem.h Cleanup: remove all override modifiers 2018-08-01 06:30:00 -07:00
diverectitem.cpp Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
diverectitem.h Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
divetextitem.cpp Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
divetextitem.h Add SPDX header to profile widgets 2017-04-29 13:32:55 -07:00
divetooltipitem.cpp profile-widget: remove SettingsObjectWrapper and update qPref calls 2018-08-15 16:11:39 -07:00
divetooltipitem.h Cleanup: replace virtual by override where appropriate 2018-07-31 11:02:34 +02:00
profilewidget2.cpp Cleanup: return gasmix by value 2018-08-23 05:16:38 -07:00
profilewidget2.h Cleanup: remove all override modifiers 2018-08-01 06:30:00 -07:00
qmlprofile.cpp profile: make profile self contained 2018-06-09 17:16:53 +02:00
qmlprofile.h profile: make profile self contained 2018-06-09 17:16:53 +02:00
ruleritem.cpp profile-widget: remove SettingsObjectWrapper and update qPref calls 2018-08-15 16:11:39 -07:00
ruleritem.h Cleanup: remove all override modifiers 2018-08-01 06:30:00 -07:00
tankitem.cpp Cleanup: return gasmix by value 2018-08-23 05:16:38 -07:00
tankitem.h Cleanup: replace virtual by override where appropriate 2018-07-31 11:02:34 +02:00