From 990b5f9bb49bcc3b58122b41267e40b3b8d77fbe Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 19 Jun 2015 19:55:56 -0400 Subject: [PATCH] Linux Build Foxes --- indra/llcommon/lldictionary.h | 40 +++++++++++++------------------ indra/llcommon/llerror.cpp | 2 -- indra/llcommon/llerror.h | 9 ++----- indra/llrender/llglslshader.h | 4 ++-- indra/newview/llviewertexture.cpp | 6 ++++- 5 files changed, 26 insertions(+), 35 deletions(-) diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index f7356d514..5800ec5e5 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -2,33 +2,26 @@ * @file lldictionary.h * @brief Lldictionary class header file * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2010, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - * */ #ifndef LL_LLDICTIONARY_H @@ -36,7 +29,8 @@ #include #include -#include "llpreprocessor.h" + +#include "llerror.h" struct LL_COMMON_API LLDictionaryEntry { diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 67aaee588..e6b688ee0 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -485,8 +485,6 @@ namespace LLError SettingsConfigPtr mSettingsConfig; }; - static AIThreadSafeSimple* sSettings; - SettingsConfig::SettingsConfig() : LLRefCount(), mPrintLocation(false), diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 331e08ddc..dc7274312 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -72,14 +72,9 @@ const int LL_ERR_NOERR = 0; #endif // !_DEBUG -#define liru_slashpos std::string(__FILE__).find_last_of("/\\") -#define liru_slashpos2 std::string(__FILE__).substr(0,liru_slashpos).find_last_of("/\\") -#define liru_assert_strip /*strip path down to lastlevel directory and filename for assert.*/\ - (liru_slashpos == std::string::npos ? std::string(__FILE__)/*just filename, print as is*/\ - : liru_slashpos2 == std::string::npos ? std::string(__FILE__)/*Apparently, we're in / or perhaps the top of the drive, print as is*/\ - : std::string(__FILE__).substr(1+liru_slashpos2))/*print foo/bar.cpp or perhaps foo\bar.cpp*/ +static const std::string liru_assert_strip(const std::string& file) { return file.substr(1+file.substr(0, file.find_last_of("/\\")).find_last_of("/\\")); } //return foo/bar.cpp or perhaps foo\bar.cpp -#define llassert_always_msg(func, msg) do { if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << LL_ENDL; } while (0) +#define llassert_always_msg(func, msg) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip(__FILE__) << " line:" << std::dec << __LINE__ << LL_ENDL #define llassert_always(func) llassert_always_msg(func, #func) diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 7e91f9ab1..e57ac1702 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -108,7 +108,7 @@ public: { if (uniform >= 0) { - std::vector >::iterator iter = std::find_if(cache.begin(), cache.end(), boost::bind(&std::pair::first, _1) == uniform); + typename std::vector >::iterator iter = std::find_if(cache.begin(), cache.end(), boost::bind(&std::pair::first, _1) == uniform); if (iter == cache.end()) { T tmp; @@ -166,7 +166,7 @@ public: } void uniform1iv(U32 index, U32 count, const GLint* v) { - F32 val[] = { v[0] }; + F32 val[] = { static_cast(v[0]) }; if (updateUniform(mValueVec4, getUniformFromIndex(index), val) || count > 1) { glUniform1ivARB(mUniform[index], count, v); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index db8b84cd3..11b05813c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -752,7 +752,11 @@ void LLViewerTexture::addFace(U32 ch, LLFace* facep) //virtual void LLViewerTexture::removeFace(U32 ch, LLFace* facep) { - llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); + if (ch >= LLRender::NUM_TEXTURE_CHANNELS) // Suppress Linux warning, this should NEVER happen! + { + LL_ERRS() << ch << " >= LLRender::NUM_TEXTURE_CHANNELS!!!" << LL_ENDL; + return; + } if(mNumFaces[ch] > 1) {