diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-10-01 21:03:44 +0200 |
|---|---|---|
| committer | Ovahlord <dreadkiller@gmx.de> | 2024-10-03 00:38:15 +0200 |
| commit | d2d3457b2fd0635e3a32a701bd0b2d17b0374b4a (patch) | |
| tree | 74d8698c82179ef42bf7fe0b29006d3234a31652 /src/tools/vmap4_extractor | |
| parent | e05461a0ed83ef500321383668f05bb4ba6dc6a7 (diff) | |
Core/Utilities: Extend make_unique_ptr_with_deleter functionality to allow it to create deleters with compile time constant functions (reduces its size to just sizeof(void*))
(cherry picked from commit b13b5142f1009a71ff06786ac8c8db92891f566a)
Diffstat (limited to 'src/tools/vmap4_extractor')
| -rw-r--r-- | src/tools/vmap4_extractor/adtfile.cpp | 4 | ||||
| -rw-r--r-- | src/tools/vmap4_extractor/wdtfile.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/vmap4_extractor/adtfile.cpp b/src/tools/vmap4_extractor/adtfile.cpp index 44b1198bbeb..7c09833d1d8 100644 --- a/src/tools/vmap4_extractor/adtfile.cpp +++ b/src/tools/vmap4_extractor/adtfile.cpp @@ -107,7 +107,7 @@ bool ADTFile::init(uint32 map_num, uint32 originalMapId) uint32 size; std::string dirname = Trinity::StringFormat("{}/dir_bin/{:04}", szWorkDirWmo, map_num); - auto dirfile = Trinity::make_unique_ptr_with_deleter(fopen(dirname.c_str(), "ab"), &::fclose); + auto dirfile = Trinity::make_unique_ptr_with_deleter<&::fclose>(fopen(dirname.c_str(), "ab")); if(!dirfile) { printf("Can't open dirfile!'%s'\n", dirname.c_str()); @@ -239,7 +239,7 @@ bool ADTFile::initFromCache(uint32 map_num, uint32 originalMapId) return true; std::string dirname = Trinity::StringFormat("{}/dir_bin/{:04}", szWorkDirWmo, map_num); - auto dirfile = Trinity::make_unique_ptr_with_deleter(fopen(dirname.c_str(), "ab"), &::fclose); + auto dirfile = Trinity::make_unique_ptr_with_deleter<&::fclose>(fopen(dirname.c_str(), "ab")); if (!dirfile) { printf("Can't open dirfile!'%s'\n", dirname.c_str()); diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp index 43778067f1b..f213affa768 100644 --- a/src/tools/vmap4_extractor/wdtfile.cpp +++ b/src/tools/vmap4_extractor/wdtfile.cpp @@ -51,7 +51,7 @@ bool WDTFile::init(uint32 mapId) uint32 size; std::string dirname = Trinity::StringFormat("{}/dir_bin/{:04}", szWorkDirWmo, mapId); - auto dirfile = Trinity::make_unique_ptr_with_deleter(fopen(dirname.c_str(), "ab"), &::fclose); + auto dirfile = Trinity::make_unique_ptr_with_deleter<&::fclose>(fopen(dirname.c_str(), "ab")); if (!dirfile) { printf("Can't open dirfile!'%s'\n", dirname.c_str()); |
