mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: convert pref.c and units.c to C++
Convert both files simultanously, because the SI_UNITS define works either under C or under C++. This was painful, because initialization of struct-members has to be done in order of definition in C++. And it was completely out of order. However, as long as not all is C++, we can't use default initialization directly in the struct definition. :( Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6cda13a9fe
commit
fe0bb905f3
5 changed files with 138 additions and 114 deletions
|
@ -327,10 +327,10 @@ struct units {
|
|||
* actually use. Similarly, C instead of Kelvin.
|
||||
* And kg instead of g.
|
||||
*/
|
||||
#define SI_UNITS \
|
||||
{ \
|
||||
.length = METERS, .volume = LITER, .pressure = BAR, .temperature = CELSIUS, .weight = KG, \
|
||||
.vertical_speed_time = MINUTES, .duration_units = MIXED, .show_units_table = false \
|
||||
#define SI_UNITS \
|
||||
{ \
|
||||
.length = units::METERS, .volume = units::LITER, .pressure = units::BAR, .temperature = units::CELSIUS, .weight = units::KG, \
|
||||
.vertical_speed_time = units::MINUTES, .duration_units = units::MIXED, .show_units_table = false \
|
||||
}
|
||||
|
||||
extern const struct units SI_units, IMPERIAL_units;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue