From 9e20a0fecfbd9fbb80b0ca9de17a5f9e24a1035b Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 25 May 2020 21:08:43 +0200 Subject: [PATCH] Use make_unique when appropriate Signed-off-by: Kevin Ottens --- src/csync/vio/csync_vio_local_unix.cpp | 4 +++- src/csync/vio/csync_vio_local_win.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/csync/vio/csync_vio_local_unix.cpp b/src/csync/vio/csync_vio_local_unix.cpp index addfd6ed2..170497463 100644 --- a/src/csync/vio/csync_vio_local_unix.cpp +++ b/src/csync/vio/csync_vio_local_unix.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include "c_private.h" #include "c_lib.h" #include "c_string.h" @@ -101,7 +103,7 @@ std::unique_ptr csync_vio_local_readdir(csync_vio_handle_t *d return {}; } while (qstrcmp(dirent->d_name, ".") == 0 || qstrcmp(dirent->d_name, "..") == 0); - file_stat.reset(new csync_file_stat_t); + file_stat = std::make_unique(); file_stat->path = c_utf8_from_locale(dirent->d_name); QByteArray fullPath = QByteArray() % const_cast(handle->path) % '/' % QByteArray() % const_cast(dirent->d_name); if (file_stat->path.isNull()) { diff --git a/src/csync/vio/csync_vio_local_win.cpp b/src/csync/vio/csync_vio_local_win.cpp index 1c8e05920..9955c230e 100644 --- a/src/csync/vio/csync_vio_local_win.cpp +++ b/src/csync/vio/csync_vio_local_win.cpp @@ -25,6 +25,8 @@ #include #include +#include + #include "windows.h" #include "c_private.h" @@ -166,7 +168,7 @@ std::unique_ptr csync_vio_local_readdir(csync_vio_handle_t *d if (path == "." || path == "..") return csync_vio_local_readdir(dhandle); - file_stat.reset(new csync_file_stat_t); + file_stat = std::make_unique(); file_stat->path = path; if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { -- 2.30.2