Compile fixes for Xcode 9 (and probably gcc).

meow-7.2.2
Tonya Souther 2018-01-27 02:02:16 -06:00
parent 201883ce9c
commit 2e644b4911
15 changed files with 25 additions and 13 deletions

View File

@ -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")
#<FS:TS> 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}"

View File

@ -27,6 +27,10 @@
#ifndef LL_LLKDUMEM_H
#define LL_LLKDUMEM_H
//<FS:TS> Silence Clang warning the flag doesn't for some reason
#pragma clang diagnostic ignored "-Woverloaded-virtual"
//</FS:TS>
// Support classes for reading and writing from memory buffers in KDU
#define KDU_NO_THREADS

View File

@ -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())
//<FS:TS> 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);

View File

@ -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<S32>(pos) - static_cast<S32>(new_pos)));
if (prev)
{
mText.erase(new_pos, diff);

View File

@ -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<S32>(pos) - static_cast<S32>(new_pos)));
if (prev)
{
remove(new_pos, diff, false);

View File

@ -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<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet)))
if ((pChiclet = dynamic_cast<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet))))
{
FSFloaterIM* pFloater = FSFloaterIM::findInstance(pChiclet->getSessionId());
if (pFloater)

View File

@ -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);
}

View File

@ -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;

View File

@ -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

View File

@ -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();
}
// </FS:Zi> Multi-substring inventory search

View File

@ -185,6 +185,7 @@ std::string getStreamingPlugin()
return "media_plugin_libvlc";
#else
llassert_always( false );
return ""; // shut up the compiler
#endif
}
// </FS:ND>

View File

@ -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(); // <FS:CR> FIRE-8234
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();

View File

@ -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;
//<FS:TS> 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)) )

View File

@ -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;
}

View File

@ -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();