summaryrefslogtreecommitdiffstats
path: root/src/debug
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-23 04:34:37 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-01-24 17:08:27 +0000
commit33a5ca9a670b38a9edcc034b026e622a642c6f7f (patch)
tree2f2b62bd38c877c3e0597ac893c18761d3570a0c /src/debug
parentDemangle: Switch to std::shared_ptr. (diff)
downloadinkscape-33a5ca9a670b38a9edcc034b026e622a642c6f7f.tar.gz
inkscape-33a5ca9a670b38a9edcc034b026e622a642c6f7f.zip
Timestamp: Switch to std::shared_ptr.
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/timestamp.cpp9
-rw-r--r--src/debug/timestamp.h5
2 files changed, 8 insertions, 6 deletions
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 <glib.h>
#include <glibmm/ustring.h>
+#include <memory>
+#include <string>
#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<std::string> timestamp() {
GTimeVal timestamp;
g_get_current_time(&timestamp);
gchar *value = g_strdup_printf( "%d.%06d", static_cast<gint>(timestamp.tv_sec), static_cast<gint>(timestamp.tv_usec) );
- result = Util::share_string(value);
+ std::shared_ptr<std::string> result = std::make_shared<std::string>(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 <memory>
+#include <string>
namespace Inkscape {
namespace Debug {
-Util::ptr_shared timestamp();
+std::shared_ptr<std::string> timestamp();
}