core: convert save-profiledata to C++

Leave the code as is for now. Just replace membuffer by its
C++ version.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-03 07:48:17 +02:00
parent 834f2278fc
commit 24a6af9ac1
3 changed files with 3 additions and 4 deletions

View file

@ -105,7 +105,7 @@ SOURCES += subsurface-mobile-main.cpp \
core/qt-ble.cpp \ core/qt-ble.cpp \
core/uploadDiveShare.cpp \ core/uploadDiveShare.cpp \
core/uploadDiveLogsDE.cpp \ core/uploadDiveLogsDE.cpp \
core/save-profiledata.c \ core/save-profiledata.cpp \
core/xmlparams.cpp \ core/xmlparams.cpp \
core/settings/qPref.cpp \ core/settings/qPref.cpp \
core/settings/qPrefCloudStorage.cpp \ core/settings/qPrefCloudStorage.cpp \

View file

@ -158,7 +158,7 @@ set(SUBSURFACE_CORE_LIB_SRCS
save-git.cpp save-git.cpp
save-html.cpp save-html.cpp
save-html.h save-html.h
save-profiledata.c save-profiledata.cpp
save-xml.cpp save-xml.cpp
selection.cpp selection.cpp
selection.h selection.h

View file

@ -246,7 +246,7 @@ void save_subtitles_buffer(struct membuffer *b, struct dive *dive, int offset, i
int save_profiledata(const char *filename, bool select_only) int save_profiledata(const char *filename, bool select_only)
{ {
struct membuffer buf = { 0 }; struct membufferpp buf;
FILE *f; FILE *f;
int error = 0; int error = 0;
@ -265,6 +265,5 @@ int save_profiledata(const char *filename, bool select_only)
if (error) if (error)
report_error("Save failed (%s)", strerror(errno)); report_error("Save failed (%s)", strerror(errno));
free_buffer(&buf);
return error; return error;
} }