From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/newview/llpathfindingcharacter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpathfindingcharacter.cpp') diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 00f2ebc4bb..b609afce60 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -47,7 +47,7 @@ LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData) : LLPathfindingObject(pUUID, pCharacterData), mCPUTime(0U), - mIsHorizontal(FALSE), + mIsHorizontal(false), mLength(0.0f), mRadius(0.0f) { -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/newview/llpathfindingcharacter.cpp | 198 +++++++++++++++---------------- 1 file changed, 99 insertions(+), 99 deletions(-) (limited to 'indra/newview/llpathfindingcharacter.cpp') diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 1ac2bc5b7b..66cc26469e 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -1,99 +1,99 @@ -/** -* @file llpathfindingcharacter.cpp -* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. -* @author Stinson@lindenlab.com -* -* $LicenseInfo:firstyear=2012&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2012, Linden Research, Inc. -* -* 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. -* -* 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. -* -* 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$ -*/ - - -#include "llviewerprecompiledheaders.h" - -#include "llpathfindingcharacter.h" - -#include - -#include "llpathfindingobject.h" -#include "llsd.h" - -#define CHARACTER_CPU_TIME_FIELD "cpu_time" -#define CHARACTER_HORIZONTAL_FIELD "horizontal" -#define CHARACTER_LENGTH_FIELD "length" -#define CHARACTER_RADIUS_FIELD "radius" - -//--------------------------------------------------------------------------- -// LLPathfindingCharacter -//--------------------------------------------------------------------------- - -LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData) - : LLPathfindingObject(pUUID, pCharacterData), - mCPUTime(0U), - mIsHorizontal(false), - mLength(0.0f), - mRadius(0.0f) -{ - parseCharacterData(pCharacterData); -} - -LLPathfindingCharacter::LLPathfindingCharacter(const LLPathfindingCharacter& pOther) - : LLPathfindingObject(pOther), - mCPUTime(pOther.mCPUTime), - mIsHorizontal(pOther.mIsHorizontal), - mLength(pOther.mLength), - mRadius(pOther.mRadius) -{ -} - -LLPathfindingCharacter::~LLPathfindingCharacter() -{ -} - -LLPathfindingCharacter& LLPathfindingCharacter::operator =(const LLPathfindingCharacter& pOther) -{ - dynamic_cast(*this) = pOther; - - mCPUTime = pOther.mCPUTime; - mIsHorizontal = pOther.mIsHorizontal; - mLength = pOther.mLength; - mRadius = pOther.mRadius; - - return *this; -} - -void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) -{ - llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD)); - llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal()); - mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); - - llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD)); - llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean()); - mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean(); - - llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD)); - llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal()); - mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); - - llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD)); - llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal()); - mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); -} +/** +* @file llpathfindingcharacter.cpp +* @brief Definition of a pathfinding character that contains various properties required for havok pathfinding. +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* 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. +* +* 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. +* +* 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$ +*/ + + +#include "llviewerprecompiledheaders.h" + +#include "llpathfindingcharacter.h" + +#include + +#include "llpathfindingobject.h" +#include "llsd.h" + +#define CHARACTER_CPU_TIME_FIELD "cpu_time" +#define CHARACTER_HORIZONTAL_FIELD "horizontal" +#define CHARACTER_LENGTH_FIELD "length" +#define CHARACTER_RADIUS_FIELD "radius" + +//--------------------------------------------------------------------------- +// LLPathfindingCharacter +//--------------------------------------------------------------------------- + +LLPathfindingCharacter::LLPathfindingCharacter(const std::string &pUUID, const LLSD& pCharacterData) + : LLPathfindingObject(pUUID, pCharacterData), + mCPUTime(0U), + mIsHorizontal(false), + mLength(0.0f), + mRadius(0.0f) +{ + parseCharacterData(pCharacterData); +} + +LLPathfindingCharacter::LLPathfindingCharacter(const LLPathfindingCharacter& pOther) + : LLPathfindingObject(pOther), + mCPUTime(pOther.mCPUTime), + mIsHorizontal(pOther.mIsHorizontal), + mLength(pOther.mLength), + mRadius(pOther.mRadius) +{ +} + +LLPathfindingCharacter::~LLPathfindingCharacter() +{ +} + +LLPathfindingCharacter& LLPathfindingCharacter::operator =(const LLPathfindingCharacter& pOther) +{ + dynamic_cast(*this) = pOther; + + mCPUTime = pOther.mCPUTime; + mIsHorizontal = pOther.mIsHorizontal; + mLength = pOther.mLength; + mRadius = pOther.mRadius; + + return *this; +} + +void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) +{ + llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD)); + llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal()); + mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); + + llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD)); + llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean()); + mIsHorizontal = pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).asBoolean(); + + llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD)); + llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal()); + mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); + + llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD)); + llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal()); + mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); +} -- cgit v1.2.3 From 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 Jul 2024 20:27:14 +0200 Subject: Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now --- indra/newview/llpathfindingcharacter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpathfindingcharacter.cpp') diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 66cc26469e..a6d26727f4 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -83,7 +83,7 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) { llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD)); llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal()); - mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); + mCPUTime = (F32)pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD)); llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean()); @@ -91,9 +91,9 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD)); llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal()); - mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); + mLength = (F32)pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD)); llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal()); - mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); + mRadius = (F32)pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); } -- cgit v1.2.3