From c286dc4f5c38459e95993dec1ca39e6fb0fecff3 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 15 Dec 2023 18:35:07 -0600 Subject: [PATCH] refactoring --- include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp | 5 +++-- src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp | 6 ++++-- src/drives/winfsp/winfsp_drive.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp b/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp index b0931c41..55ba875c 100644 --- a/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp +++ b/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp @@ -143,9 +143,10 @@ public: void shutdown() { ::GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); } - static void display_options(int argc, char *argv[]) {} + static void display_options(int /* argc */, char * /* argv[] */) {} - static void display_version_information(int argc, char *argv[]) {} + static void display_version_information(int /* argc */, char * /* argv[] */) { + } }; } // namespace remote_winfsp } // namespace repertory diff --git a/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp b/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp index fee2d62d..e9f5ad1f 100644 --- a/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp +++ b/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp @@ -138,7 +138,8 @@ auto remote_winfsp_drive::Create(PWSTR file_name, UINT32 create_options, set_file_info(ofi->FileInfo, fi); const auto file_path = utils::string::from_utf8(normalized_name); wcsncpy(ofi->NormalizedName, &file_path[0], wcslen(&file_path[0])); - ofi->NormalizedNameSize = (UINT16)(wcslen(&file_path[0]) * sizeof(WCHAR)); + ofi->NormalizedNameSize = + static_cast(wcslen(&file_path[0]) * sizeof(WCHAR)); } return ret; @@ -290,7 +291,8 @@ auto remote_winfsp_drive::Open(PWSTR file_name, UINT32 create_options, set_file_info(ofi->FileInfo, fi); const auto file_path = utils::string::from_utf8(normalize_name); wcsncpy(ofi->NormalizedName, &file_path[0], wcslen(&file_path[0])); - ofi->NormalizedNameSize = (UINT16)(wcslen(&file_path[0]) * sizeof(WCHAR)); + ofi->NormalizedNameSize = + static_cast(wcslen(&file_path[0]) * sizeof(WCHAR)); } return ret; diff --git a/src/drives/winfsp/winfsp_drive.cpp b/src/drives/winfsp/winfsp_drive.cpp index ac7af4a5..d2cf527f 100644 --- a/src/drives/winfsp/winfsp_drive.cpp +++ b/src/drives/winfsp/winfsp_drive.cpp @@ -57,7 +57,7 @@ E_SIMPLE3(winfsp_event, debug, true, winfsp_drive::winfsp_service::winfsp_service( lock_data &lock, winfsp_drive &drive, std::vector drive_args, app_config &config) - : Service((PWSTR)L"Repertory"), + : Service(static_cast(REPERTORY_W)), lock_(lock), drive_(drive), drive_args_(std::move(drive_args)),