Frosting touchups

Cleaned up flaws in LLUUID
- Removed deprecated LLUUID::toString(char*) and LLUUID::toCompressedString(char*)
Cleaned up some comments
This commit is contained in:
Lirusaito
2013-05-11 23:14:16 -04:00
parent 9b5360a40b
commit 417dcb4e49
7 changed files with 11 additions and 44 deletions

View File

@@ -171,14 +171,6 @@ void LLUUID::toString(std::string& out) const
(U8)(mData[15]));
}
// *TODO: deprecate
void LLUUID::toString(char *out) const
{
std::string buffer;
toString(buffer);
strcpy(out,buffer.c_str()); /* Flawfinder: ignore */
}
void LLUUID::toCompressedString(std::string& out) const
{
char bytes[UUID_BYTES+1];
@@ -187,13 +179,6 @@ void LLUUID::toCompressedString(std::string& out) const
out.assign(bytes, UUID_BYTES);
}
// *TODO: deprecate
void LLUUID::toCompressedString(char *out) const
{
memcpy(out, mData, UUID_BYTES); /* Flawfinder: ignore */
out[UUID_BYTES] = '\0';
}
std::string LLUUID::getString() const
{
return asString();
@@ -422,14 +407,9 @@ std::ostream& operator<<(std::ostream& s, const LLUUID &uuid)
std::istream& operator>>(std::istream &s, LLUUID &uuid)
{
U32 i;
char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
for (i = 0; i < UUID_STR_LENGTH-1; i++)
{
s >> uuid_str[i];
}
uuid_str[i] = '\0';
uuid.set(std::string(uuid_str));
std::string uuid_str;
s >> uuid_str;
uuid.set(uuid_str);
return s;
}

View File

@@ -106,9 +106,7 @@ public:
friend LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLUUID &uuid);
friend LL_COMMON_API std::istream& operator>>(std::istream& s, LLUUID &uuid);
void toString(char *out) const; // Does not allocate memory, needs 36 characters (including \0)
void toString(std::string& out) const;
void toCompressedString(char *out) const; // Does not allocate memory, needs 17 characters (including \0)
void toCompressedString(std::string& out) const;
std::string asString() const;

View File

@@ -154,7 +154,7 @@ export SL_OPT="`cat gridargs.dat` $@"
eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr
# Handle any resulting errors
if [ -n "$LL_RUN_ERR" = "runerr" ]; then
if [ "$LL_RUN_ERR" = "runerr" ]; then
# generic error running the binary
echo '*** Bad shutdown. ***'
fi

View File

@@ -1385,12 +1385,7 @@ void LLFloaterAvatarList::onClickGetKey()
if (NULL == item) return;
LLUUID agent_id = item->getUUID();
char buffer[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
agent_id.toString(buffer);
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getUUID().asString()));
}
void LLFloaterAvatarList::sendKeys()

View File

@@ -1876,11 +1876,9 @@ void LLPanelAvatar::onClickGetKey(void *userdata)
LLPanelAvatar* self = (LLPanelAvatar*)userdata;
LLUUID agent_id = self->getAvatarID();
char buffer[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
agent_id.toString(buffer);
llinfos << "Copy agent id: " << agent_id << " buffer: " << buffer << llendl;
llinfos << "Copy agent id: " << agent_id << llendl;
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(agent_id.asString()));
}
// static

View File

@@ -3247,10 +3247,7 @@ class LLAvatarCopyUUID : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
if(!avatar) return true;
LLUUID uuid = avatar->getID();
char buffer[UUID_STR_LENGTH]; /*Flawfinder: ignore*/
uuid.toString(buffer);
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(avatar->getID().asString()));
return true;
}
};

View File

@@ -3,10 +3,9 @@
* @brief LLVOVolume class implementation
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Second Life Viewer Source Code
* 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
@@ -252,7 +251,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
S32 res2 = unpackTEMessage(*dp);
if (TEM_INVALID == res2)
{
// Well, crap, there's something bogus in the data that we're unpacking.
// There's something bogus in the data that we're unpacking.
dp->dumpBufferToLog();
llwarns << "Flushing cache files" << llendl;
@@ -3108,7 +3107,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
F32 w = wght[k];
LLMatrix4a src;
// Insure ref'd bone is in our clamped array of mats
// Ensure ref'd bone is in our clamped array of mats
llassert(idx[k] < kMaxJoints);
// clamp k to kMaxJoints to avoid reading garbage off stack in release
src.setMul(mp[idx[(k < kMaxJoints) ? k : 0]], w);