From 2e644b49114c69f0c77bd0c65e28fe28b79b0094 Mon Sep 17 00:00:00 2001 From: Tonya Souther Date: Sat, 27 Jan 2018 02:02:16 -0600 Subject: [PATCH] Compile fixes for Xcode 9 (and probably gcc). --- indra/cmake/00-Common.cmake | 2 ++ indra/llkdu/llkdumem.h | 4 ++++ indra/llui/llfolderviewitem.cpp | 4 +++- indra/llui/lllineeditor.cpp | 2 +- indra/llui/lltexteditor.cpp | 2 +- indra/newview/fsfloaterimcontainer.cpp | 2 +- indra/newview/fsfloaterwearablefavorites.cpp | 2 +- indra/newview/growlnotifierwin.cpp | 2 ++ indra/newview/llagentcamera.cpp | 4 ++-- indra/newview/llinventoryfilter.cpp | 4 ++-- indra/newview/llmimetypes.cpp | 1 + indra/newview/lltracker.cpp | 1 - indra/newview/llviewermenu.cpp | 4 +++- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/rlvhelper.cpp | 2 +- 15 files changed, 25 insertions(+), 13 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 01908bb787..2112f35dac 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -209,6 +209,8 @@ if (DARWIN) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations") + # Silence some more compiler warnings on Xcode 9 + set(DARWIN_extra_cstar_flags "${DARWIN_extra_cstar_flags} -Wno-unused-const-variable -Wno-unused-private-field -Wno-potentially-evaluated-expression") # Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format -- # see Variables.cmake. string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}" diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 09d81f38de..5bc93fd8be 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -27,6 +27,10 @@ #ifndef LL_LLKDUMEM_H #define LL_LLKDUMEM_H +// Silence Clang warning the flag doesn't for some reason +#pragma clang diagnostic ignored "-Woverloaded-virtual" +// + // Support classes for reading and writing from memory buffers in KDU #define KDU_NO_THREADS diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 2f568025ab..6a433c5641 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -624,7 +624,9 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) bool can_drag = true; if ( (root->isOverDragThreshold(screen_x, screen_y)) && (root->getCurSelectedItem()) ) { - if (can_drag = root->startDrag()) + // Silence compiler warning + //if (can_drag = root->startDrag()) + if ((can_drag = root->startDrag())) { // RN: when starting drag and drop, clear out last auto-open root->autoOpenTest(NULL); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 27ff36c165..f363648fb2 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -967,7 +967,7 @@ void LLLineEditor::removeWord(bool prev) if (new_pos == pos) // Other character we don't jump over new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1); - const U32 diff(labs(pos - new_pos)); + const U32 diff(labs(static_cast(pos) - static_cast(new_pos))); if (prev) { mText.erase(new_pos, diff); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 90d56dd750..f006e9533b 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1128,7 +1128,7 @@ void LLTextEditor::removeWord(bool prev) if (new_pos == pos) // Other character we don't jump over new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1); - const U32 diff(labs(pos - new_pos)); + const U32 diff(labs(static_cast(pos) - static_cast(new_pos))); if (prev) { remove(new_pos, diff, false); diff --git a/indra/newview/fsfloaterimcontainer.cpp b/indra/newview/fsfloaterimcontainer.cpp index 20db1c537b..482c611efa 100644 --- a/indra/newview/fsfloaterimcontainer.cpp +++ b/indra/newview/fsfloaterimcontainer.cpp @@ -247,7 +247,7 @@ void FSFloaterIMContainer::addFloater(LLFloater* floaterp, // Look for the first IM session to the left of this one while (--idxChiclet >= 0) { - if (pChiclet = dynamic_cast(pChicletPanel->getChiclet(idxChiclet))) + if ((pChiclet = dynamic_cast(pChicletPanel->getChiclet(idxChiclet)))) { FSFloaterIM* pFloater = FSFloaterIM::findInstance(pChiclet->getSessionId()); if (pFloater) diff --git a/indra/newview/fsfloaterwearablefavorites.cpp b/indra/newview/fsfloaterwearablefavorites.cpp index 74d01fb93a..4c9c666ab3 100644 --- a/indra/newview/fsfloaterwearablefavorites.cpp +++ b/indra/newview/fsfloaterwearablefavorites.cpp @@ -351,7 +351,7 @@ void FSFloaterWearableFavorites::onDoubleClick() if (get_is_item_worn(selected_item_id)) { if ((item->getType() == LLAssetType::AT_CLOTHING && (!RlvActions::isRlvEnabled() || gRlvWearableLocks.canRemove(item))) || - (item->getType() == LLAssetType::AT_OBJECT) && (!RlvActions::isRlvEnabled() || gRlvAttachmentLocks.canDetach(item))) + ((item->getType() == LLAssetType::AT_OBJECT) && (!RlvActions::isRlvEnabled() || gRlvAttachmentLocks.canDetach(item)))) { LLAppearanceMgr::instance().removeItemsFromAvatar(ids); } diff --git a/indra/newview/growlnotifierwin.cpp b/indra/newview/growlnotifierwin.cpp index 24027e19b2..b6615f6a64 100644 --- a/indra/newview/growlnotifierwin.cpp +++ b/indra/newview/growlnotifierwin.cpp @@ -43,7 +43,9 @@ #include "llviewercontrol.h" #ifdef GROWL_HAS_LOG +#if LL_WINDOWS #pragma comment(lib,"growl.lib") +#endif void __cdecl GrowlLogSink( char const *aMessage, int aLevel ) { LL_INFOS( "Growl" ) << aMessage << LL_ENDL; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c498c6d871..7300529823 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2012,10 +2012,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // F | T | skip av => slam focus // F | F | clamp focus then av bool fCamAvDistClamped, fCamAvDistLocked = false; float nCamAvDistLimitMin, nCamAvDistLimitMax; - if (fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax)) + if ((fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax))) fCamAvDistLocked = nCamAvDistLimitMin == nCamAvDistLimitMax; bool fCamOriginDistClamped, fCamOriginDistLocked = false; float nCamOriginDistLimitMin, nCamOriginDistLimitMax; - if (fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax)) + if ((fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax))) fCamOriginDistLocked = nCamOriginDistLimitMin == nCamOriginDistLimitMax; // Check focus distance limits diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 4c053e9c14..3b93a664e3 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1596,13 +1596,13 @@ U32 LLInventoryFilter::getFilterSubStringCount() const std::string::size_type LLInventoryFilter::getFilterSubStringPos(U32 index) const { - if (index < 0 || index >= mSubStringMatchOffsets.size()) return std::string::npos; + if (index >= mSubStringMatchOffsets.size()) return std::string::npos; return mSubStringMatchOffsets[index]; } std::string::size_type LLInventoryFilter::getFilterSubStringLen(U32 index) const { - if (index < 0 || index >= mFilterSubStrings.size()) return 0; + if (index >= mFilterSubStrings.size()) return 0; return mFilterSubStrings[index].size(); } // Multi-substring inventory search diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index 646b02048d..a9c10022b7 100644 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -185,6 +185,7 @@ std::string getStreamingPlugin() return "media_plugin_libvlc"; #else llassert_always( false ); + return ""; // shut up the compiler #endif } // diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 4070d96312..9fc773eb5a 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -519,7 +519,6 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 const U32 BEACON_VERTS = 256; F32 step; - LLVector3d pos_agent_3d = gAgent.getPositionGlobal(); // FIRE-8234 gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cddd08746d..08aaf750e8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -10512,7 +10512,9 @@ class LLEditTakeOff : public view_listener_t && (gAgentWearables.getWearableCount(type) > 0)) { // MULTI-WEARABLES: assuming user wanted to remove top shirt. - U32 wearable_index = gAgentWearables.getWearableCount(type) - 1; + // Shut the compiler up about unsigned comparisons <0 or >0 + //U32 wearable_index = gAgentWearables.getWearableCount(type) - 1; + S32 wearable_index = gAgentWearables.getWearableCount(type) - 1; // [RLVa:KB] - Checked: 2010-06-09 (RLVa-1.2.0g) | Added: RLVa-1.2.0g if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearable(type)) ) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4a045c280b..da00da2d78 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4538,7 +4538,7 @@ void renderOnePhysicsShape(LLViewerObject* objectp) LLCDMeshData res; LLCDResult retval; - if (retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res)) + if ((retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res))) { LL_WARNS() << "ConvexDecomp Failed (generateSingleHullMeshFromMesh): " << retval << LL_ENDL; } diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 3cc1a4a979..895ccfe5be 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -1769,7 +1769,7 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string: *pidxStart = std::string::npos; // Assume we won't find anything // Extracts the last - matched - parenthesised text from the input string - std::string::size_type idxIt, idxEnd; int cntLevel = 1; + int idxIt; std::string::size_type idxEnd; int cntLevel = 1; if ((idxEnd = strText.find_last_of(')')) == std::string::npos) return std::string();