summaryrefslogtreecommitdiffstats
path: root/core/profile.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-05 23:23:20 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-07-18 05:50:22 -0700
commit39ede7e9e85e92cfd5b93e32237c6899e595fcfa (patch)
tree90bd7bc5c111582726545ec4226611c219bf2afc /core/profile.h
parent68147c42255598992f2be23e53c9bbcf76e65b91 (diff)
downloadsubsurface-39ede7e9e85e92cfd5b93e32237c6899e595fcfa.tar.gz
Cleanup: introduce function to set pressure values
Instead of assigning the the lvalue of the SENSOR_PRESSURE macro, introduce a general function to set pressure values. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.h')
-rw-r--r--core/profile.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/profile.h b/core/profile.h
index 761f270d7..8636be2fd 100644
--- a/core/profile.h
+++ b/core/profile.h
@@ -97,13 +97,17 @@ int get_maxdepth(struct plot_info *pi);
#define SENSOR_PR 0
#define INTERPOLATED_PR 1
-#define SENSOR_PRESSURE(_entry,_idx) (_entry)->pressure[_idx][SENSOR_PR]
static inline int get_plot_pressure_data(const struct plot_data *entry, int sensor, int idx)
{
return entry->pressure[idx][sensor];
}
+static inline void set_plot_pressure_data(struct plot_data *entry, int sensor, int idx, int value)
+{
+ entry->pressure[idx][sensor] = value;
+}
+
static inline int get_plot_sensor_pressure(const struct plot_data *entry, int idx)
{
return get_plot_pressure_data(entry, SENSOR_PR, idx);