From f61928c928210d3e0601d99dfdc135ecc8f433a3 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sun, 13 Oct 2019 14:33:48 -0400 Subject: [PATCH] Fix some signed/unsigned warnings --- indra/llappearance/llwearable.cpp | 2 +- indra/llcommon/StackWalker.cpp | 4 ++++ indra/llimage/llimage.cpp | 2 +- indra/llrender/llfontfreetype.cpp | 2 +- indra/newview/lldrawable.cpp | 4 ++-- indra/newview/llfloatereditdaycycle.cpp | 6 +++--- indra/newview/llfloaterexperiences.cpp | 2 +- indra/newview/llinventorymodel.cpp | 2 +- indra/newview/llpanelgrouproles.cpp | 2 +- indra/newview/llteleporthistory.cpp | 2 +- indra/newview/lltexturefetch.cpp | 2 +- indra/newview/llviewerobjectlist.cpp | 2 +- indra/newview/llviewerwearable.cpp | 4 ++-- indra/newview/llvocache.cpp | 4 ++-- 14 files changed, 22 insertions(+), 18 deletions(-) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 157fe9df1b..9cae28ce0f 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -365,7 +365,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, << num_parameters << LL_ENDL; return LLWearable::FAILURE; } - if( num_parameters != mVisualParamIndexMap.size() ) + if( num_parameters != (S32)mVisualParamIndexMap.size() ) { LL_WARNS() << "Wearable parameter mismatch. Reading in " << num_parameters << " from file, but created " diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index 0c1628abc4..dc57a0a0fa 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -93,6 +93,8 @@ #include "StackWalker.h" +#pragma warning (push) +#pragma warning (disable : 4740) // If VC7 and later, then use the shipped 'dbghelp.h'-file #pragma pack(push,8) @@ -1389,4 +1391,6 @@ void StackWalker::OnOutput(LPCSTR buffer) OutputDebugStringA(buffer); } +#pragma warning(pop) + #endif // LL_WINDOWS diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index bd6f1a1e86..948a0d9141 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -2176,7 +2176,7 @@ bool LLImageFormatted::load(const std::string &filename, int load_size) bool res; U8 *data = allocateData(load_size); apr_size_t bytes_read = infile.read(data, load_size); - if (bytes_read == 0 || bytes_read != load_size) + if (bytes_read == 0 || (int)bytes_read != load_size) { deleteData(); setLastError("Unable to read file",filename); diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index d23026d0d0..e7de7478f0 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -105,7 +105,7 @@ U8 const* LLFontManager::loadFont(const std::string& filename, long& out_size) out_size = stat.st_size; auto buf = std::make_unique<U8[]>(out_size); - if (out_size != LLAPRFile::readEx(filename, buf.get(), 0, out_size)) + if ((apr_size_t)out_size != LLAPRFile::readEx(filename, buf.get(), 0, out_size)) { out_size = 0; return nullptr; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index a065eef19e..e5009c7b6e 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -448,7 +448,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText } } - llassert_always(mFaces.size() == newFaces); + llassert_always((S32)mFaces.size() == newFaces); } void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep) @@ -471,7 +471,7 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer } } - llassert_always(mFaces.size() == newFaces) ; + llassert_always((S32)mFaces.size() == newFaces) ; } void LLDrawable::mergeFaces(LLDrawable* src) diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp index 9585c55588..632676b5da 100644 --- a/indra/newview/llfloatereditdaycycle.cpp +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -201,7 +201,7 @@ void LLFloaterEditDayCycle::applyTrack() return; } - llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); + llassert_always((S32)mSliderToKey.size() == mKeysSlider->getValue().size()); // create a new animation track LLWLParamManager::getInstance()->mDay.clearKeyframes(); @@ -402,7 +402,7 @@ void LLFloaterEditDayCycle::onKeyPresetChanged() void LLFloaterEditDayCycle::onAddKey() { - llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); + llassert_always((S32)mSliderToKey.size() == mKeysSlider->getValue().size()); S32 max_sliders; LLEnvKey::EScope scope = LLEnvKey::SCOPE_LOCAL; // *TODO: editing region day cycle @@ -457,7 +457,7 @@ void LLFloaterEditDayCycle::addSliderKey(F32 time, LLWLParamKey keyframe) // add to map mSliderToKey.insert(std::pair<std::string, SliderKey>(sldr_name, newKey)); - llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); + llassert_always((S32)mSliderToKey.size() == mKeysSlider->getValue().size()); } LLWLParamKey LLFloaterEditDayCycle::getSelectedDayCycle() diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 750a7ae3d4..f69791a735 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -250,7 +250,7 @@ void LLFloaterExperiences::checkAndOpen(LLPanelExperiences* panel, const LLSD& c // determine new item const LLSD& response_ids = content["experience_ids"]; - if (mPrepurchaseIds.size() + 1 == response_ids.size()) + if ((S32)mPrepurchaseIds.size() + 1 == response_ids.size()) { // we have a new element for (LLSD::array_const_iterator it = response_ids.beginArray(); it != response_ids.endArray(); ++it) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 582e681ff6..149266ee2e 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3884,7 +3884,7 @@ bool LLInventoryModel::validate() const { desc_unknown_count++; } - else if (cats->size() + items->size() != cat->getDescendentCount()) + else if ((S32)cats->size() + (S32)items->size() != cat->getDescendentCount()) { LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName() << "] parent " << cat->getParentUUID() diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index ea4f3a31ab..dcb5ad8f1c 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1362,7 +1362,7 @@ void LLPanelGroupMembersSubTab::activate() else { // Members can be removed outside of this tab, checking changes - if (!gdatap || (gdatap->isMemberDataComplete() && gdatap->mMembers.size() != mMembersList->getItemCount())) + if (!gdatap || (gdatap->isMemberDataComplete() && (S32)gdatap->mMembers.size() != mMembersList->getItemCount())) { update(GC_MEMBER_DATA); } diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index 202734e926..8cc28b7e2d 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -229,7 +229,7 @@ void LLTeleportHistory::dump() const for (size_t i=0; i<mItems.size(); i++) { std::stringstream line; - line << ((i == mCurrentItem) ? " * " : " "); + line << (((S32)i == mCurrentItem) ? " * " : " "); line << i << ": " << mItems[i].mTitle; line << " REGION_ID: " << mItems[i].mRegionID; line << ", pos: " << mItems[i].mGlobalPos; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f6553e5dbb..8f5bfb8717 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -4934,7 +4934,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) case HTTP_FETCHING: // Do some notifications... mFetcher->getHttpRequest().update(10); - if (!fillCurlQueue() && mNbCurlCompleted == mFetchingHistory.size()) + if (!fillCurlQueue() && mNbCurlCompleted == (S32)mFetchingHistory.size()) { mHTTPTime = mTimer.getElapsedTimeF32() ; setDebuggerState(IDLE); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index edd2b84a13..9c2a66dd61 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -827,7 +827,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) } mCurLazyUpdateIndex = max_value; - if (mCurLazyUpdateIndex == mObjects.size()) + if (mCurLazyUpdateIndex == (S32)mObjects.size()) { // restart mCurLazyUpdateIndex = 0; diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 0838d99cb4..b21f9016a6 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -164,7 +164,7 @@ BOOL LLViewerWearable::isOldVersion() const } } } - if( param_count != mVisualParamIndexMap.size() ) + if( param_count != (S32)mVisualParamIndexMap.size() ) { return TRUE; } @@ -182,7 +182,7 @@ BOOL LLViewerWearable::isOldVersion() const } } } - if( te_count != mTEMap.size() ) + if( te_count != (S32)mTEMap.size() ) { return TRUE; } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index a4083d306c..7ac2f21f6b 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -46,12 +46,12 @@ BOOL LLVOCachePartition::sNeedsOcclusionCheck = FALSE; BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) { - return apr_file->read(src, n_bytes) == n_bytes ; + return (S32)apr_file->read(src, n_bytes) == n_bytes ; } BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes) { - return apr_file->write(src, n_bytes) == n_bytes ; + return (S32)apr_file->write(src, n_bytes) == n_bytes ; } -- GitLab