From 33a5ca9a670b38a9edcc034b026e622a642c6f7f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 23 Jan 2019 05:34:37 +0100 Subject: Timestamp: Switch to std::shared_ptr. --- src/debug/timestamp.cpp | 9 +++++---- src/debug/timestamp.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/debug') diff --git a/src/debug/timestamp.cpp b/src/debug/timestamp.cpp index e22f8dede..619c4a18a 100644 --- a/src/debug/timestamp.cpp +++ b/src/debug/timestamp.cpp @@ -13,6 +13,8 @@ #include #include +#include +#include #include "debug/simple-event.h" #include "timestamp.h" @@ -20,14 +22,13 @@ namespace Inkscape { namespace Debug { -Util::ptr_shared timestamp() { - Util::ptr_shared result; +std::shared_ptr timestamp() { GTimeVal timestamp; g_get_current_time(×tamp); gchar *value = g_strdup_printf( "%d.%06d", static_cast(timestamp.tv_sec), static_cast(timestamp.tv_usec) ); - result = Util::share_string(value); + std::shared_ptr result = std::make_shared(value); g_free(value); - return result; + return std::move(result); } } diff --git a/src/debug/timestamp.h b/src/debug/timestamp.h index 281c31b4c..a4db90dc6 100644 --- a/src/debug/timestamp.h +++ b/src/debug/timestamp.h @@ -13,13 +13,14 @@ #ifndef SEEN_INKSCAPE_DEBUG_TIMESTAMP_H #define SEEN_INKSCAPE_DEBUG_TIMESTAMP_H -#include "util/share.h" +#include +#include namespace Inkscape { namespace Debug { -Util::ptr_shared timestamp(); +std::shared_ptr timestamp(); } -- cgit v1.2.3