Migrated LLUUIDs and some float constants out of headers into .cpp files

Moved some functions with llinfos into .cpp files
Linker optimizations, all
meow-7.2.2
James Cook 2009-11-28 20:08:09 -08:00
parent 3838a7dfa5
commit 8ff96a3515
12 changed files with 235 additions and 58 deletions

View File

@ -40,6 +40,7 @@ set(llcommon_SOURCE_FILES
llcursortypes.cpp
lldate.cpp
lldependencies.cpp
lldictionary.cpp
llerror.cpp
llerrorthread.cpp
llevent.cpp

View File

@ -0,0 +1,46 @@
/**
* @file indra_constants.cpp
* @brief some useful short term constants for Indra
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* 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://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* 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://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "indra_constants.h"
#include "lluuid.h"
// "agent id" for things that should be done to ALL agents
const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb");
// Governor Linden's agent id.
const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f");
const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
// Maintenance's group id.
const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd");

View File

@ -34,7 +34,8 @@
#define LL_INDRA_CONSTANTS_H
#include "stdtypes.h"
#include "lluuid.h"
class LLUUID;
// At 45 Hz collisions seem stable and objects seem
// to settle down at a reasonable rate.
@ -46,7 +47,7 @@
#define PHYSICS_TIMESTEP (1.f / 45.f)
const F32 COLLISION_TOLERANCE = 0.1f;
const F32 HALF_COLLISION_TOLERANCE = COLLISION_TOLERANCE * 0.5f;
const F32 HALF_COLLISION_TOLERANCE = 0.05f;
// Time constants
const U32 HOURS_PER_LINDEN_DAY = 4;
@ -97,9 +98,9 @@ const F32 MIN_AGENT_WIDTH = 0.40f;
const F32 DEFAULT_AGENT_WIDTH = 0.60f;
const F32 MAX_AGENT_WIDTH = 0.80f;
const F32 MIN_AGENT_HEIGHT = 1.3f - 2.0f * COLLISION_TOLERANCE;
const F32 MIN_AGENT_HEIGHT = 1.1f;
const F32 DEFAULT_AGENT_HEIGHT = 1.9f;
const F32 MAX_AGENT_HEIGHT = 2.65f - 2.0f * COLLISION_TOLERANCE;
const F32 MAX_AGENT_HEIGHT = 2.45f;
// For linked sets
const S32 MAX_CHILDREN_PER_TASK = 255;
@ -266,14 +267,14 @@ const U8 GOD_LIKE = 1;
const U8 GOD_NOT = 0;
// "agent id" for things that should be done to ALL agents
const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb");
extern const LLUUID LL_UUID_ALL_AGENTS;
// Governor Linden's agent id.
const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f");
const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
extern const LLUUID ALEXANDRIA_LINDEN_ID; // inventory library owner
extern const LLUUID GOVERNOR_LINDEN_ID;
extern const LLUUID REALESTATE_LINDEN_ID;
// Maintenance's group id.
const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd");
extern const LLUUID MAINTENANCE_GROUP_ID;
// Flags for kick message
const U32 KICK_FLAGS_DEFAULT = 0x0;

View File

@ -64,6 +64,8 @@
#pragma warning (disable : 4244) // conversion from time_t to S32
#endif // LL_WINDOWS
// *TODO: Eliminate these, most library .cpp files don't need them.
// Add them to llviewerprecompiledheaders.h if necessary.
#include <list>
#include <map>
#include <vector>

View File

@ -0,0 +1,52 @@
/**
* @file lldictionary.cpp
* @brief Lldictionary class header file
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2007, Linden Research, Inc.
*
* 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
*
* 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
*
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "lldictionary.h"
#include "llstring.h"
// Define in .cpp file to prevent header include of llstring.h
LLDictionaryEntry::LLDictionaryEntry(const std::string &name)
: mName(name)
{
mNameCapitalized = mName;
LLStringUtil::replaceChar(mNameCapitalized, '-', ' ');
LLStringUtil::replaceChar(mNameCapitalized, '_', ' ');
for (U32 i=0; i < mNameCapitalized.size(); i++)
{
if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash
{
mNameCapitalized[i] = toupper(mNameCapitalized[i]);
}
}
}

View File

@ -33,23 +33,11 @@
#define LL_LLDICTIONARY_H
#include <map>
#include <string>
struct LLDictionaryEntry
{
LLDictionaryEntry(const std::string &name) :
mName(name)
{
mNameCapitalized = mName;
LLStringUtil::replaceChar(mNameCapitalized, '-', ' ');
LLStringUtil::replaceChar(mNameCapitalized, '_', ' ');
for (U32 i=0; i < mNameCapitalized.size(); i++)
{
if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash
{
mNameCapitalized[i] = toupper(mNameCapitalized[i]);
}
}
}
LLDictionaryEntry(const std::string &name);
virtual ~LLDictionaryEntry() {}
const std::string mName;
std::string mNameCapitalized;

View File

@ -92,6 +92,7 @@ set(llmessage_SOURCE_FILES
llxfer_mem.cpp
llxfer_vfile.cpp
llxorcipher.cpp
machine.cpp
message.cpp
message_prehash.cpp
message_string_table.cpp

View File

@ -0,0 +1,62 @@
/**
* @file machine.cpp
* @brief LLMachine class header file
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* 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://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* 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://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "machine.h"
#include "llerror.h"
void LLMachine::setMachinePort(S32 port)
{
if (port < 0)
{
llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl;
mHost.setPort(0);
}
else
{
mHost.setPort(port);
}
}
void LLMachine::setControlPort( S32 port )
{
if (port < 0)
{
llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl;
mControlPort = 0;
}
else
{
mControlPort = port;
}
}

View File

@ -33,7 +33,6 @@
#ifndef LL_MACHINE_H
#define LL_MACHINE_H
#include "llerror.h"
#include "net.h"
#include "llhost.h"
@ -79,31 +78,8 @@ public:
void setMachineIP(U32 ip) { mHost.setAddress(ip); }
void setMachineHost(const LLHost &host) { mHost = host; }
void setMachinePort(S32 port)
{
if (port < 0)
{
llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl;
mHost.setPort(0);
}
else
{
mHost.setPort(port);
}
}
void setControlPort( S32 port )
{
if (port < 0)
{
llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl;
mControlPort = 0;
}
else
{
mControlPort = port;
}
}
void setMachinePort(S32 port);
void setControlPort( S32 port );
// member variables

View File

@ -25,6 +25,7 @@ set(llprimitive_SOURCE_FILES
lltreeparams.cpp
llvolumemessage.cpp
llvolumexml.cpp
material_codes.cpp
)
set(llprimitive_HEADER_FILES

View File

@ -0,0 +1,46 @@
/**
* @file material_codes.cpp
* @brief Material_codes definitions
*
* $LicenseInfo:firstyear=2000&license=viewergpl$
*
* Copyright (c) 2000-2009, Linden Research, Inc.
*
* 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://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* 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://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* 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.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "material_codes.h"
#include "lluuid.h"
const LLUUID LL_DEFAULT_STONE_UUID("87c5765b-aa26-43eb-b8c6-c09a1ca6208e");
const LLUUID LL_DEFAULT_METAL_UUID("6f3c53e9-ba60-4010-8f3e-30f51a762476");
const LLUUID LL_DEFAULT_GLASS_UUID("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d");
const LLUUID LL_DEFAULT_WOOD_UUID("89556747-24cb-43ed-920b-47caed15465f");
const LLUUID LL_DEFAULT_FLESH_UUID("80736669-e4b9-450e-8890-d5169f988a50");
const LLUUID LL_DEFAULT_PLASTIC_UUID("304fcb4e-7d33-4339-ba80-76d3d22dc11a");
const LLUUID LL_DEFAULT_RUBBER_UUID("9fae0bc5-666d-477e-9f70-84e8556ec867");
const LLUUID LL_DEFAULT_LIGHT_UUID("00000000-0000-0000-0000-000000000000");

View File

@ -33,7 +33,7 @@
#ifndef LL_MATERIAL_CODES_H
#define LL_MATERIAL_CODES_H
#include "lluuid.h"
class LLUUID;
// material types
const U8 LL_MCODE_STONE = 0;
@ -47,13 +47,14 @@ const U8 LL_MCODE_LIGHT = 7;
const U8 LL_MCODE_END = 8;
const U8 LL_MCODE_MASK = 0x0F;
const LLUUID LL_DEFAULT_STONE_UUID("87c5765b-aa26-43eb-b8c6-c09a1ca6208e");
const LLUUID LL_DEFAULT_METAL_UUID("6f3c53e9-ba60-4010-8f3e-30f51a762476");
const LLUUID LL_DEFAULT_GLASS_UUID("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d");
const LLUUID LL_DEFAULT_WOOD_UUID("89556747-24cb-43ed-920b-47caed15465f");
const LLUUID LL_DEFAULT_FLESH_UUID("80736669-e4b9-450e-8890-d5169f988a50");
const LLUUID LL_DEFAULT_PLASTIC_UUID("304fcb4e-7d33-4339-ba80-76d3d22dc11a");
const LLUUID LL_DEFAULT_RUBBER_UUID("9fae0bc5-666d-477e-9f70-84e8556ec867");
const LLUUID LL_DEFAULT_LIGHT_UUID("00000000-0000-0000-0000-000000000000");
// *NOTE: Define these in .cpp file to reduce duplicate instances
extern const LLUUID LL_DEFAULT_STONE_UUID;
extern const LLUUID LL_DEFAULT_METAL_UUID;
extern const LLUUID LL_DEFAULT_GLASS_UUID;
extern const LLUUID LL_DEFAULT_WOOD_UUID;
extern const LLUUID LL_DEFAULT_FLESH_UUID;
extern const LLUUID LL_DEFAULT_PLASTIC_UUID;
extern const LLUUID LL_DEFAULT_RUBBER_UUID;
extern const LLUUID LL_DEFAULT_LIGHT_UUID;
#endif