From 5affacab7080abb5545236bd7e3a5b7f4ca01b51 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 24 Mar 2014 16:56:10 -0400 Subject: [PATCH] Fixes, mainly for Clang/Mac, from Cinder. --- indra/libhacd/hacdHACD.h | 2 +- indra/llaudio/llaudiodecodemgr.h | 2 +- indra/llcommon/CMakeLists.txt | 1 + indra/llcommon/fix_macros.h | 25 +++++++++++++++++++ indra/llmessage/llmessagethrottle.cpp | 1 + indra/llui/llnotifications.cpp | 5 ++-- indra/llui/llnotifications.h | 4 +-- indra/newview/CMakeLists.txt | 4 +-- indra/newview/app_settings/settings.xml | 13 +++++++++- indra/newview/hippogridmanager.cpp | 2 ++ indra/newview/llagentcamera.cpp | 2 +- indra/newview/llappearancemgr.cpp | 4 +-- indra/newview/llappviewer.cpp | 12 ++++----- indra/newview/llcrashlogger.cpp | 5 +++- indra/newview/llimpanel.cpp | 4 +-- indra/newview/llmediadataclient.cpp | 22 ++++++++-------- indra/newview/llmediadataclient.h | 6 ++--- .../skins/default/xui/en-us/floater_about.xml | 2 +- .../skins/default/xui/en-us/strings.xml | 2 +- 19 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 indra/llcommon/fix_macros.h diff --git a/indra/libhacd/hacdHACD.h b/indra/libhacd/hacdHACD.h index 2ca9a4ae7..fd9fd4301 100644 --- a/indra/libhacd/hacdHACD.h +++ b/indra/libhacd/hacdHACD.h @@ -317,7 +317,7 @@ namespace HACD bool m_addFacesPoints; //>! specifies whether to add faces points or not bool m_addExtraDistPoints; //>! specifies whether to add extra points for concave shapes or not - friend HACD * const CreateHACD(HeapManager * heapManager = 0); + friend HACD * const CreateHACD(HeapManager * heapManager); friend void DestroyHACD(HACD * const hacd); }; inline HACD * const CreateHACD(HeapManager * heapManager) diff --git a/indra/llaudio/llaudiodecodemgr.h b/indra/llaudio/llaudiodecodemgr.h index 917511daa..3ff894dba 100644 --- a/indra/llaudio/llaudiodecodemgr.h +++ b/indra/llaudio/llaudiodecodemgr.h @@ -24,7 +24,7 @@ */ #ifndef LL_LLAUDIODECODEMGR_H -#define LL_LLAUDIODECODEMG_H +#define LL_LLAUDIODECODEMGR_H #include "stdtypes.h" diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index be045f100..31e4fa484 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -117,6 +117,7 @@ set(llcommon_HEADER_FILES bitpack.h ctype_workaround.h doublelinkedlist.h + fix_macros.h imageids.h indra_constants.h linden_common.h diff --git a/indra/llcommon/fix_macros.h b/indra/llcommon/fix_macros.h new file mode 100644 index 000000000..ef959decf --- /dev/null +++ b/indra/llcommon/fix_macros.h @@ -0,0 +1,25 @@ +/** + * @file fix_macros.h + * @author Nat Goodspeed + * @date 2012-11-16 + * @brief The Mac system headers seem to #define macros with obnoxiously + * generic names, preventing any library from using those names. We've + * had to fix these in so many places that it's worth making a header + * file to handle it. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Copyright (c) 2012, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// DON'T use an #include guard: every time we encounter this header, #undef +// these macros all over again. + +// who injects MACROS with such generic names?! Grr. +#ifdef equivalent +#undef equivalent +#endif + +#ifdef check +#undef check +#endif diff --git a/indra/llmessage/llmessagethrottle.cpp b/indra/llmessage/llmessagethrottle.cpp index 579d6d718..6d6e9a924 100644 --- a/indra/llmessage/llmessagethrottle.cpp +++ b/indra/llmessage/llmessagethrottle.cpp @@ -30,6 +30,7 @@ #include "llmessagethrottle.h" #include "llframetimer.h" +#include "fix_macros.h" // This is used for the stl search_n function. #if _MSC_VER >= 1500 // VC9 has a bug in search_n diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index f066ef6dc..e0ec85523 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1503,14 +1503,13 @@ LLNotificationPtr LLNotifications::add(AIAlert::Error const& error, int type, un } //-------------------------------------------------------------------------------- -// class UpdateItem +// struct UpdateItem // // Allow LLNotifications::add, LLNotifications::cancel and LLNotifications::update // to be called from any thread. -class UpdateItem +struct UpdateItem { -public: char const* sigtype; LLNotificationPtr pNotif; UpdateItem(char const* st, LLNotificationPtr const& np) : sigtype(st), pNotif(np) { } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index df0168ae7..f6f267f57 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -197,7 +197,7 @@ class LLNotification : { LOG_CLASS(LLNotification); friend class LLNotifications; -friend class UpdateItem; +friend struct UpdateItem; public: // parameter object used to instantiate a new notification @@ -568,7 +568,7 @@ class LLNotificationChannelBase : public boost::signals2::trackable { LOG_CLASS(LLNotificationChannelBase); - friend class UpdateItem; + friend struct UpdateItem; public: LLNotificationChannelBase(LLNotificationFilter filter, LLNotificationComparator comp) : mFilter(filter), mItems_sf(comp) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fbcc7c4d4..03284d6e0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1518,7 +1518,7 @@ if (WINDOWS) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --arch=${ARCH} + --arch=${ARCH} --artwork=${ARTWORK_DIR} --branding_id=${VIEWER_BRANDING_ID} --build=${CMAKE_CURRENT_BINARY_DIR} @@ -1540,7 +1540,7 @@ if (WINDOWS) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --arch=${ARCH} + --arch=${ARCH} --artwork=${ARTWORK_DIR} --actions=copy --branding_id=${VIEWER_BRANDING_ID} diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 61597128a..fb5fee7c1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -573,7 +573,7 @@ CheckForGridUpdates Comment - Fetch list of grids from Hippo server + Fetch list of grids from location set in GridUpdateList Persist 1 Type @@ -592,6 +592,17 @@ Value Second Life + GridUpdateList + + Comment + URL to fetch Grid updates from + Persist + 1 + Type + String + Value + + VivoxLicenseAccepted diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 9057109d2..b0fd2b254 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -891,6 +891,8 @@ void HippoGridManager::loadFromFile() void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) { + if (url.empty()) return; + llinfos << "Loading grid info from '" << url << "'." << llendl; // query update server diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index f1066076a..5c21a75a3 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2076,7 +2076,7 @@ void LLAgentCamera::handleScrollWheel(S32 clicks) if (MASK mask = gKeyboard->currentMask(true)) // Singu Note: Conveniently set view offsets while modifier keys are held during scroll { static const LLCachedControl enableCameraOffsetScroll("SinguOffsetScrollKeys"); - if (mask & MASK_CONTROL|MASK_SHIFT && enableCameraOffsetScroll) + if (mask & (MASK_CONTROL|MASK_SHIFT) && enableCameraOffsetScroll) { const F32 change(static_cast(clicks) * 0.1f); if (mask & MASK_SHIFT) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d5c0629e0..8ab198d3b 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3030,7 +3030,7 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id) const LLViewerInventoryItem* item = item_array.get(i).get(); if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { -#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG +#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG // NOTE-RLVa: debug-only, can be removed down the line if (rlv_handler_t::isEnabled()) { @@ -3062,7 +3062,7 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type) if (item->getIsLinkType()) // we must operate on links only { // [RLVa:KB] - Checked: 2013-02-12 (RLVa-1.4.8) -#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG +#if 0 // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG // NOTE-RLVa: debug-only, can be removed down the line if (rlv_handler_t::isEnabled()) { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index eb1a28576..4647bd8cb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -304,6 +304,8 @@ const std::string MARKER_FILE_NAME("Singularity.exec_marker"); const std::string ERROR_MARKER_FILE_NAME("Singularity.error_marker"); const std::string LLERROR_MARKER_FILE_NAME("Singularity.llerror_marker"); const std::string LOGOUT_MARKER_FILE_NAME("Singularity.logout_marker"); +const std::string LOG_FILE("Singularity.log"); +extern const std::string OLD_LOG_FILE("Singularity.old"); static BOOL gDoDisconnect = FALSE; static std::string gLaunchFileOnQuit; @@ -1946,13 +1948,11 @@ bool LLAppViewer::initLogging() LLError::setFatalFunction(errorCallback); // Remove the last ".old" log file. - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "Singularity.old"); + std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, OLD_LOG_FILE); LLFile::remove(old_log_file); // Rename current log file to ".old" - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "Singularity.log"); + std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LOG_FILE); LLFile::rename(log_file, old_log_file); // Set the log file to Singularity.log @@ -2664,7 +2664,7 @@ void LLAppViewer::writeSystemInfo() // that the crash report will go to the proper location in the case of a // prior freeze. std::string crashHostUrl = gSavedSettings.get("CrashHostUrl"); - if(crashHostUrl != "") + if (!crashHostUrl.empty()) { gDebugInfo["CrashHostUrl"] = crashHostUrl; } @@ -2725,7 +2725,7 @@ void LLAppViewer::handleViewerCrash() // Insert crash host url (url to post crash log to) if configured. std::string crashHostUrl = gSavedSettings.get("CrashHostUrl"); - if(crashHostUrl != "") + if (!crashHostUrl.empty()) { gDebugInfo["Dynamic"]["CrashHostUrl"] = crashHostUrl; } diff --git a/indra/newview/llcrashlogger.cpp b/indra/newview/llcrashlogger.cpp index e0a52cc62..7a3d7c8af 100644 --- a/indra/newview/llcrashlogger.cpp +++ b/indra/newview/llcrashlogger.cpp @@ -47,6 +47,7 @@ class AIHTTPTimeoutPolicy; extern AIHTTPTimeoutPolicy crashLoggerResponder_timeout; +extern const std::string OLD_LOG_FILE; class LLCrashLoggerResponder : public LLHTTPClient::ResponderWithResult { @@ -284,7 +285,7 @@ void LLCrashLogger::gatherFiles() mCrashInfo["DebugLog"] = mDebugLog; mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); // Singu Note: we have just started again, log has been renamed - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "Singularity.old"); + mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, OLD_LOG_FILE); llinfos << "Encoding files..." << llendl; @@ -395,6 +396,8 @@ void LLCrashLogger::checkCrashDump() if (pref == 2) return; //never send mCrashHost = gSavedSettings.getString("CrashHostUrl"); + // Don't send if there's no crash host. :O + if (mCrashHost.empty()) return; std::string dumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + "singularity-debug"; // Do we have something to send, and somewhere to send it diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index f97d320a2..af2659486 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -442,12 +442,12 @@ LLFloaterIMPanel::~LLFloaterIMPanel() // virtual void LLFloaterIMPanel::changed(U32 mask) { - if (mask & REMOVE|ADD) // Fix remove/add friend choices + if (mask & (REMOVE|ADD)) // Fix remove/add friend choices rebuildDynamics(getChild("instant_message_flyout")); /* Singu TODO: Chat UI - Online icons? if (mask & ONLINE) // Show online icon here - else if (mask & NONE) + else // Show offline icon here */ } diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 31038b4aa..654cba5a0 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -92,7 +92,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); template -static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -106,7 +106,7 @@ static typename T::iterator find_matching_request(T &c, const LLMediaDataClient: } template -static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) { @@ -123,7 +123,7 @@ static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMedi // to other elements in the container (such as std::vector). // If the implementation is changed to use a container with this property, this will need to be revisited. template -static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) { for(typename T::iterator iter = c.begin(); iter != c.end();) { @@ -171,10 +171,10 @@ bool LLMediaDataClient::isEmpty() const bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) { - if(find_matching_request(mQueue, object->getID()) != mQueue.end()) + if(find_matching_request(mQueue, object->getID(), LLMediaDataClient::Request::ANY) != mQueue.end()) return true; - if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end()) + if(find_matching_request(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY) != mUnQueuedRequests.end()) return true; return false; @@ -183,8 +183,8 @@ bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) { LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL; - remove_matching_requests(mQueue, object->getID()); - remove_matching_requests(mUnQueuedRequests, object->getID()); + remove_matching_requests(mQueue, object->getID(), LLMediaDataClient::Request::ANY); + remove_matching_requests(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY); } void LLMediaDataClient::startQueueTimer() @@ -776,7 +776,7 @@ bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &ob if(LLMediaDataClient::isInQueue(object)) return true; - if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end()) + if(find_matching_request(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY) != mRoundRobinQueue.end()) return true; return false; @@ -787,7 +787,7 @@ void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr // First, call parent impl. LLMediaDataClient::removeFromQueue(object); - remove_matching_requests(mRoundRobinQueue, object->getID()); + remove_matching_requests(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY); } bool LLObjectMediaDataClient::processQueueTimer() @@ -937,7 +937,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } // If there's already a matching request in the queue, remove it. - request_queue_t::iterator iter = find_matching_request(mQueue, request); + request_queue_t::iterator iter = find_matching_request(mQueue, request, LLMediaDataClient::Request::ANY); if(iter != mQueue.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL; @@ -945,7 +945,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request) } else { - request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request); + request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request, LLMediaDataClient::Request::ANY); if(set_iter != mUnQueuedRequests.end()) { LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL; diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 19ea5c6ce..093b84468 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -282,9 +282,9 @@ private: bool mQueueTimerIsRunning; - template friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); - template friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); + template friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type); + template friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); + template friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type); }; diff --git a/indra/newview/skins/default/xui/en-us/floater_about.xml b/indra/newview/skins/default/xui/en-us/floater_about.xml index 151fdb0ec..1d4e1d275 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about.xml @@ -2,7 +2,7 @@ + title="About [APP_NAME]" width="470"> diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 7453a18f6..77e3f12de 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -66,7 +66,7 @@ Make sure you entered the correct Login URI. An example of a Login URI is: \"htt Requesting region capabilities, attempt [NUMBER]... Waiting for region handshake... Connecting to region... - Downloading clothing... + Dry cleaning clothing... Login failed. Quit