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:
Berthold Stoeger 2024-05-02 07:56:47 +02:00 committed by bstoeger
parent 6cda13a9fe
commit fe0bb905f3
5 changed files with 138 additions and 114 deletions

View file

@ -45,7 +45,7 @@ SOURCES += subsurface-mobile-main.cpp \
core/fulltext.cpp \
core/subsurfacestartup.cpp \
core/subsurface-string.cpp \
core/pref.c \
core/pref.cpp \
core/profile.cpp \
core/device.cpp \
core/dive.cpp \
@ -98,7 +98,7 @@ SOURCES += subsurface-mobile-main.cpp \
core/taxonomy.c \
core/time.cpp \
core/trip.c \
core/units.c \
core/units.cpp \
core/uemis.cpp \
core/btdiscovery.cpp \
core/connectionlistmodel.cpp \