diff options
| author | Jan Lingscheid <jan.linscheid@auticon.de> | 2017-10-18 14:03:34 +0000 |
|---|---|---|
| committer | Jan Lingscheid <jan.linscheid@auticon.de> | 2017-10-18 14:03:34 +0000 |
| commit | 41b862f1c4eaea48bdd0d546e2bb31907f15857b (patch) | |
| tree | e667c91439f0f04aa1f2cec1d3eafddf80bc4ecc /src/util/format.h | |
| parent | Replace boost::shared_ptr (diff) | |
| download | inkscape-41b862f1c4eaea48bdd0d546e2bb31907f15857b.tar.gz inkscape-41b862f1c4eaea48bdd0d546e2bb31907f15857b.zip | |
Refactor Util::ptr_shared
Util::ptr_shared<T> was only used in its <char> specialization, so it is now refactored into a
non-template class. Using it with arbitary classes was dangerous anyway.
Diffstat (limited to 'src/util/format.h')
| -rw-r--r-- | src/util/format.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/format.h b/src/util/format.h index 690121254..d2fe2d0ef 100644 --- a/src/util/format.h +++ b/src/util/format.h @@ -20,20 +20,20 @@ namespace Inkscape { namespace Util { -inline ptr_shared<char> vformat(char const *format, va_list args) { +inline ptr_shared vformat(char const *format, va_list args) { char *temp=g_strdup_vprintf(format, args); - ptr_shared<char> result=share_string(temp); + ptr_shared result=share_string(temp); g_free(temp); return result; } // needed since G_GNUC_PRINTF can only be used on a declaration - ptr_shared<char> format(char const *format, ...) G_GNUC_PRINTF(1,2); -inline ptr_shared<char> format(char const *format, ...) { + ptr_shared format(char const *format, ...) G_GNUC_PRINTF(1,2); +inline ptr_shared format(char const *format, ...) { va_list args; va_start(args, format); - ptr_shared<char> result=vformat(format, args); + ptr_shared result=vformat(format, args); va_end(args); return result; |
