From 4a687b1bc1928c71ec10d23358bcb493ce437950 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 25 Aug 2024 19:42:52 +0200 Subject: [PATCH] Avoid -Wcast-function-type in get_proc_addr --- src/operations.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/operations.cpp b/src/operations.cpp index 3fdbf3189..19d8ed9e5 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -1401,12 +1401,12 @@ BOOST_FILESYSTEM_INIT_FUNC init_winapi_func_ptrs() boost::winapi::HMODULE_ h = boost::winapi::GetModuleHandleW(L"kernel32.dll"); if (BOOST_LIKELY(!!h)) { - GetFileInformationByHandleEx_t* get_file_information_by_handle_ex = (GetFileInformationByHandleEx_t*)boost::winapi::get_proc_address(h, "GetFileInformationByHandleEx"); + GetFileInformationByHandleEx_t* get_file_information_by_handle_ex = boost::winapi::get_proc_address(h, "GetFileInformationByHandleEx"); filesystem::detail::atomic_store_relaxed(get_file_information_by_handle_ex_api, get_file_information_by_handle_ex); - SetFileInformationByHandle_t* set_file_information_by_handle = (SetFileInformationByHandle_t*)boost::winapi::get_proc_address(h, "SetFileInformationByHandle"); + SetFileInformationByHandle_t* set_file_information_by_handle = boost::winapi::get_proc_address(h, "SetFileInformationByHandle"); filesystem::detail::atomic_store_relaxed(set_file_information_by_handle_api, set_file_information_by_handle); - filesystem::detail::atomic_store_relaxed(create_hard_link_api, (CreateHardLinkW_t*)boost::winapi::get_proc_address(h, "CreateHardLinkW")); - filesystem::detail::atomic_store_relaxed(create_symbolic_link_api, (CreateSymbolicLinkW_t*)boost::winapi::get_proc_address(h, "CreateSymbolicLinkW")); + filesystem::detail::atomic_store_relaxed(create_hard_link_api, boost::winapi::get_proc_address(h, "CreateHardLinkW")); + filesystem::detail::atomic_store_relaxed(create_symbolic_link_api, boost::winapi::get_proc_address(h, "CreateSymbolicLinkW")); if (get_file_information_by_handle_ex && set_file_information_by_handle) { @@ -1419,8 +1419,8 @@ BOOST_FILESYSTEM_INIT_FUNC init_winapi_func_ptrs() h = boost::winapi::GetModuleHandleW(L"ntdll.dll"); if (BOOST_LIKELY(!!h)) { - filesystem::detail::atomic_store_relaxed(nt_create_file_api, (NtCreateFile_t*)boost::winapi::get_proc_address(h, "NtCreateFile")); - filesystem::detail::atomic_store_relaxed(nt_query_directory_file_api, (NtQueryDirectoryFile_t*)boost::winapi::get_proc_address(h, "NtQueryDirectoryFile")); + filesystem::detail::atomic_store_relaxed(nt_create_file_api, boost::winapi::get_proc_address(h, "NtCreateFile")); + filesystem::detail::atomic_store_relaxed(nt_query_directory_file_api, boost::winapi::get_proc_address(h, "NtQueryDirectoryFile")); } init_directory_iterator_impl();