From ff0edab69a1dc4884b7636c2546327901ce8fdde Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 7 Apr 2023 01:07:59 +0300 Subject: post-merge buildfix --- indra/llcommon/llsdserialize.h | 2 +- indra/newview/llfilepicker.cpp | 4 ++-- indra/newview/llfilepicker_mac.h | 2 +- indra/newview/llfilepicker_mac.mm | 28 ++++++++++++++-------------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index cf6c1ab73a..2f12c6d1ff 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -870,7 +870,7 @@ public: LL_COMMON_API std::string zip_llsd(LLSD& data); -LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize,std::istream& is, S32 size); +LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, size_t& outsize,std::istream& is, S32 size); // returns a pointer to the array or past the array if the deprecated header exists LL_COMMON_API char* strip_deprecated_header(char* in, U32& cur_size, U32* header_size = nullptr); diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 51b2f25f8d..b61afcbbc9 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -716,9 +716,9 @@ bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter, return false; } - std::vector *allowed_types=navOpenFilterProc(filter); + std::unique_ptr> allowed_types=navOpenFilterProc(filter); - doLoadDialogModeless(allowed_types, + doLoadDialogModeless(allowed_types.get(), mPickOptions, callback, userdata); diff --git a/indra/newview/llfilepicker_mac.h b/indra/newview/llfilepicker_mac.h index c18643f355..367c792969 100644 --- a/indra/newview/llfilepicker_mac.h +++ b/indra/newview/llfilepicker_mac.h @@ -47,7 +47,7 @@ void doLoadDialogModeless(const std::vector* allowed_types, void (*callback)(bool, std::vector&, void*), void *userdata); -std::string* doSaveDialog(const std::string* file, +std::unique_ptr doSaveDialog(const std::string* file, const std::string* type, const std::string* creator, const std::string* extension, diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index 7fd9f37e18..bca5b10c8a 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -75,27 +75,27 @@ std::unique_ptr> doLoadDialog(const std::vector* outfiles = NULL; - + std::unique_ptr> outfiles = nullptr; + if (result == NSOKButton) { NSArray *filesToOpen = [panel URLs]; - int i, count = [filesToOpen count]; - + int count = [filesToOpen count]; + if (count > 0) { - outfiles = new std::vector; + outfiles = std::make_unique>(); } - - for (i=0; ipush_back(*afilestr); + + for (int i=0; ipush_back(std::move(afilestr)); } } return outfiles; @@ -140,7 +140,7 @@ void doLoadDialogModeless(const std::vector* allowed_types, }]; } -std::string* doSaveDialog(const std::string* file, +std::unique_ptr doSaveDialog(const std::string* file, const std::string* type, const std::string* creator, const std::string* extension, @@ -157,7 +157,7 @@ std::string* doSaveDialog(const std::string* file, [panel setAllowedFileTypes:fileType]; NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; - std::string *outfile = NULL; + std::unique_ptr outfile = nullptr; NSURL* url = [NSURL fileURLWithPath:fileName]; [panel setNameFieldStringValue: fileName]; [panel setDirectoryURL: url]; @@ -166,7 +166,7 @@ std::string* doSaveDialog(const std::string* file, { NSURL* url = [panel URL]; NSString* p = [url path]; - outfile = new std::string( [p UTF8String] ); + outfile = std::make_unique( [p UTF8String] ); // write the file } return outfile; -- cgit v1.2.3