From d752550cc8d01b29dd8b58e688147acff10da33c Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 15:49:33 -0700 Subject: Update to build on Xcode 6.0: delete called on 'LLTranslationBridge' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] --- indra/llappearance/llwearabletype.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index e51e6731d3..7c9594644d 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -35,6 +35,9 @@ class LLTranslationBridge { public: + // clang needs this to be happy + virtual ~LLTranslationBridge() {} + virtual std::string getString(const std::string &xml_desc) = 0; }; -- cgit v1.2.3 From 2a3f022e0ac018345e80da34d4ea6965e5c31de0 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 17 Oct 2014 15:58:28 -0700 Subject: Update to build on Xcode 6.0: clang detecting unsigned int (size_t) comparison with <0 [-Wtautological-compare] --- indra/llappearance/llwearabledata.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index cf1ee435a8..5dfb201fc4 100755 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -173,8 +173,9 @@ bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a } wearableentry_vec_t& wearable_vec = wearable_iter->second; - if (0 > index_a || index_a >= wearable_vec.size()) return false; - if (0 > index_b || index_b >= wearable_vec.size()) return false; + // removed 0 > index_a and index_b comparisions - can never be true + if (index_a >= wearable_vec.size()) return false; + if (index_b >= wearable_vec.size()) return false; LLWearable* wearable = wearable_vec[index_a]; wearable_vec[index_a] = wearable_vec[index_b]; -- cgit v1.2.3 From 42cb9e655a3ada775ff9f432bb23afd47aa6a3ad Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 20 Oct 2014 11:18:30 -0700 Subject: Update to build on Xcode 6.0: delete called on that is abstract but has non-virtual dest --- indra/llappearance/lltexturemanagerbridge.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lltexturemanagerbridge.h b/indra/llappearance/lltexturemanagerbridge.h index 4b814b522d..101704b162 100644 --- a/indra/llappearance/lltexturemanagerbridge.h +++ b/indra/llappearance/lltexturemanagerbridge.h @@ -35,6 +35,8 @@ class LLTextureManagerBridge { public: + virtual ~LLTextureManagerBridge() {} + virtual LLPointer getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0; virtual LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0; virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0; -- cgit v1.2.3 From 1a974f227de5f3d6c42dd5b836acab8edd28171c Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 20 Oct 2014 11:21:54 -0700 Subject: Update to build on Xcode 6.0: typedef declared protected incorrectly here --- indra/llappearance/llwearable.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 406fc7e883..630eb1e3a5 100755 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -113,6 +113,9 @@ public: // Update the baked texture hash. virtual void addToBakedTextureHash(LLMD5& hash) const = 0; + typedef std::map visual_param_index_map_t; + visual_param_index_map_t mVisualParamIndexMap; + protected: typedef std::map te_map_t; void syncImages(te_map_t &src, te_map_t &dst); @@ -132,9 +135,6 @@ protected: typedef std::map param_map_t; param_map_t mSavedVisualParamMap; // last saved version of visual params - typedef std::map visual_param_index_map_t; - visual_param_index_map_t mVisualParamIndexMap; - te_map_t mTEMap; // maps TE to LocalTextureObject te_map_t mSavedTEMap; // last saved version of TEMap }; -- cgit v1.2.3 From f81c5a4e94a26689cd3cfa8078bb9cde360541a0 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Thu, 11 Dec 2014 16:32:13 -0800 Subject: Add bespoke ctor/dtor that align on 16byte boundaries when creating things on the heap --- indra/llappearance/llpolymorph.h | 10 ++++++++++ indra/llappearance/llpolyskeletaldistortion.h | 13 +++++++++++++ 2 files changed, 23 insertions(+) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 7e712f9e94..3c2c68079c 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -182,6 +182,16 @@ public: void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert); void addPendingMorphMask() { mNumMorphMasksPending++; } + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + protected: LLPolyMorphTarget(const LLPolyMorphTarget& pOther); diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index ea2adb8a87..ab1a132d19 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -73,6 +73,19 @@ public: /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + + + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + + protected: typedef std::vector bone_info_list_t; bone_info_list_t mBoneInfoList; -- cgit v1.2.3 From ae6440eecc4d6c018a3634c2c06052757bde962f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 28 Jan 2015 15:55:18 -0500 Subject: MAINT-4744: Eliminate viewer dependency on (old) GNU libstdc++. To be more accurate, this changeset doesn't actually eliminate the dependency: it eliminates the use cases for the llifstream / llofstream feature that requires it. Currently you can construct an llifstream or llofstream from an open LLFILE* file handle (or, except on Windows, an int file descriptor). But rather than containing a streambuf implementation based on FILE*, llfile.h relies on the fact that the Windows std::filebuf happens to support that as a nonstandard extension; also on a nonstandard GNU extension __gnu_cxx::stdio_filebuf. To move from GNU libstdc++ to clang's libc++ (the direction on Mac), we could code a streambuf that supports FILE*. But before doing that, it's worth asking whether anyone actually uses this questionable feature. In fact there were only two methods: LLWearable::exportFile() and importFile() -- and only one call to either, in LLViewerWearable::saveNewAsset(). The code in saveNewAsset() opened the LLFILE* immediately before calling exportFile(), meaning we could reasonably push the open operation down into exportFile(). That logic was complex anyway due to the need for the caller to close the LLFILE* regardless of the success of the exportFile(). Change LLWearable::exportFile() and importFile() to accept a std::string filename rather than an open LLFILE*. Change LLViewerWearable::saveNewAsset() to simply call exportFile(filename) rather than horsing around with an LLFILE* handle. (This improves the code in another way too: it encapsulates the need to open the relevant file in binary mode. Previously, each caller had to remember to do that.) To prevent inadvertent reintroduction of ll[io]fstream(LLFILE*) code, add llstream_LLFILE preprocessor macro (default 0) to control access to the relevant constructors. Also suppress rdbuf() override, the only method whose signature references llstdio_filebuf. --- indra/llappearance/llwearable.cpp | 13 +++++++------ indra/llappearance/llwearable.h | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 4bce3f99ed..41c06f4368 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -86,10 +86,10 @@ LLAssetType::EType LLWearable::getAssetType() const return LLWearableType::getAssetType(mType); } -BOOL LLWearable::exportFile(LLFILE* fp) const +BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(fp); - return exportStream(ofs); + llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + return ofs.is_open() && exportStream(ofs); } // virtual @@ -201,10 +201,11 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) } } -LLWearable::EImportResult LLWearable::importFile(LLFILE* fp, LLAvatarAppearance* avatarp ) +LLWearable::EImportResult LLWearable::importFile(const std::string& filename, + LLAvatarAppearance* avatarp ) { - llifstream ifs(fp); - return importStream(ifs, avatarp); + llifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } // virtual diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 630eb1e3a5..875c2932f1 100755 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -81,8 +81,8 @@ public: SUCCESS, BAD_HEADER }; - BOOL exportFile(LLFILE* file) const; - EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp ); + BOOL exportFile(const std::string& filename) const; + EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp ); virtual BOOL exportStream( std::ostream& output_stream ) const; virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); -- cgit v1.2.3 From 3a57b18896eacb6fea6680d0eccaaeddb0b700b0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 7 Apr 2015 17:28:05 -0400 Subject: convert llifstream and llofstream to std::ifstream and std::ofstream respectively --- indra/llappearance/llwearable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 41c06f4368..5ca9f55ac8 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); return ofs.is_open() && exportStream(ofs); } @@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) LLWearable::EImportResult LLWearable::importFile(const std::string& filename, LLAvatarAppearance* avatarp ) { - llifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } -- cgit v1.2.3 From 8b42c7898ef756a4a81daa08b2a5acce2894f4b8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 7 Apr 2015 17:59:28 -0400 Subject: replace llifstream and llofstream with std::ifstream and std::ofstream respectively --- indra/llappearance/llwearable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 5ca9f55ac8..1bbe878bba 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + std::ofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); return ofs.is_open() && exportStream(ofs); } @@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) LLWearable::EImportResult LLWearable::importFile(const std::string& filename, LLAvatarAppearance* avatarp ) { - llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); + std::ifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } -- cgit v1.2.3 From 5c6cf3e7fb9f592e3a293921175b64b515bac23f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 10 Apr 2015 11:02:37 -0400 Subject: restore the ll[io]fstream because we need them as wrappers on Windows for wide char paths; on other platforms they are now just typedefs to the std classes --- indra/llappearance/llwearable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 1bbe878bba..5ca9f55ac8 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const BOOL LLWearable::exportFile(const std::string& filename) const { - std::ofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); return ofs.is_open() && exportStream(ofs); } @@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) LLWearable::EImportResult LLWearable::importFile(const std::string& filename, LLAvatarAppearance* avatarp ) { - std::ifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); + llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } -- cgit v1.2.3