aboutsummaryrefslogtreecommitdiffstats
path: root/core/membuffer.c
AgeCommit message (Collapse)Author
2019-03-27Cleanup: unconstify string argument to add_to_string()Gravatar Berthold Stoeger
add_to_string() frees the original string that is passed in. This should therefore not be of "const char *" type, as the contents of the string *will* be modified (or more precisely: destroyed). Same for the congener smtk_concat_str(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-21Add 'location_t' data structureGravatar Linus Torvalds
Instead of having people treat latitude and longitude as separate things, just add a 'location_t' data structure that contains both. Almost all cases want to always act on them together. This is really just prep-work for adding a few more locations that we track: I want to add a entry/exit location to each dive (independent of the dive site) because of how the Garmin Descent gives us the information (and hopefully, some day, other dive computers too). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-03-05Localization: Make Qt's locale-aware formatting accessible from CGravatar Berthold Stoeger
This commit introduces functions: - QString asprintf_loc(const char *cformat, ...); - int snprintf_loc(char *dst, size_t size, const char *cformat, ...); - put_format_loc(struct membuffer *, const char *fmt, ...); and their va_arg equivalents, which use Qt's QString::arg() formatting options to render the strings. The snprintf_loc() function takes care not to truncate multi-byte UTF-8 encodings. Thus, on overflow, the resulting string might be shorter than size-1. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-08Fix crash when text emptyGravatar Miika Turkia
Exporting to divelogs.de triggered this bug when divesite name is empty. Fixes #656 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-29Add SPDX header to core C filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-12Only enable -Wmissing-field-initializers for ClangGravatar Lubomir I. Ivanov
The following pragma is Clang specific: It produces a warning: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] Only enable it for Clang by checking the __clang__ macro. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>