mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
68147c4225
commit
39ede7e9e8
3 changed files with 9 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue