From: Kevin Ottens Date: Mon, 25 May 2020 19:08:43 +0000 (+0200) Subject: Use make_unique when appropriate X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~210^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9e20a0fecfbd9fbb80b0ca9de17a5f9e24a1035b;p=nextcloud-desktop.git Use make_unique when appropriate Signed-off-by: Kevin Ottens --- 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) {