diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 6afac951c..58c0518d5 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -320,7 +320,7 @@ void print_statemachine_diagnostics(U64 total_clocks, AIStateMachine::StateTimer AIStateMachine::StateTimerBase::DumpTimers(msg); - llwarns << msg.str() << llendl; + LL_WARNS() << msg.str() << LL_ENDL; } #endif @@ -1264,7 +1264,7 @@ void AIStateMachine::abort(void) // Block until the current run finished. if (!mRunMutex.try_lock()) { - llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl; + LL_WARNS() << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << LL_ENDL; mRunMutex.lock(); } mRunMutex.unlock(); @@ -1463,6 +1463,6 @@ void stopEngineThread(void) { ms_sleep(10); } - llinfos << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << llendl; + LL_INFOS() << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << LL_ENDL; } diff --git a/indra/aistatemachine/aistatemachinethread.cpp b/indra/aistatemachine/aistatemachinethread.cpp index caeddea5c..325869a7d 100644 --- a/indra/aistatemachine/aistatemachinethread.cpp +++ b/indra/aistatemachine/aistatemachinethread.cpp @@ -149,7 +149,7 @@ void AIStateMachineThreadBase::abort_impl(void) { // The thread is still happily running (and will clean up itself). // Lets make sure we're not flooded with this situation. - llwarns << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << llendl; + LL_WARNS() << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << LL_ENDL; } } } diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index d26b45208..e016b4790 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -35,9 +35,9 @@ #include "llavatarappearance.h" #include "llavatarappearancedefines.h" #include "llavatarjointmesh.h" +#include "llstl.h" #include "imageids.h" #include "lldir.h" -#include "lldeleteutils.h" #include "llpolymorph.h" #include "llpolymesh.h" #include "llpolyskeletaldistortion.h" @@ -134,9 +134,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo() std::for_each(mMeshInfoList.begin(), mMeshInfoList.end(), DeletePointer()); std::for_each(mSkeletalDistortionInfoList.begin(), mSkeletalDistortionInfoList.end(), DeletePointer()); std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer()); - deleteAndClear(mTexSkinColorInfo); - deleteAndClear(mTexHairColorInfo); - deleteAndClear(mTexEyeColorInfo); + delete_and_clear(mTexSkinColorInfo); + delete_and_clear(mTexHairColorInfo); + delete_and_clear(mTexEyeColorInfo); std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer()); std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer()); std::for_each(mMorphMaskInfoList.begin(), mMorphMaskInfoList.end(), DeletePointer()); @@ -218,7 +218,7 @@ void LLAvatarAppearance::initInstance() mesh->setMeshID(mesh_index); mesh->setPickName(mesh_dict->mPickName); mesh->setIsTransparent(FALSE); - switch((int)mesh_index) + switch((S32)mesh_index) { case MESH_ID_HAIR: mesh->setIsTransparent(TRUE); @@ -254,7 +254,7 @@ void LLAvatarAppearance::initInstance() ++iter) { LLAvatarJointMesh* mesh = (*iter); - mBakedTextureDatas[(int)baked_texture_index].mJointMeshes.push_back(mesh); + mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh); } } @@ -269,13 +269,13 @@ void LLAvatarAppearance::initInstance() // virtual LLAvatarAppearance::~LLAvatarAppearance() { - deleteAndClear(mTexSkinColor); - deleteAndClear(mTexHairColor); - deleteAndClear(mTexEyeColor); + delete_and_clear(mTexSkinColor); + delete_and_clear(mTexHairColor); + delete_and_clear(mTexEyeColor); for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - deleteAndClear(mBakedTextureDatas[i].mTexLayerSet); + delete_and_clear(mBakedTextureDatas[i].mTexLayerSet); mBakedTextureDatas[i].mJointMeshes.clear(); for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin(); @@ -286,12 +286,15 @@ LLAvatarAppearance::~LLAvatarAppearance() } } - if (mRoot) mRoot->removeAllChildren(); - deleteAndClear(mRoot); + if (mRoot) + { + mRoot->removeAllChildren(); + delete_and_clear(mRoot); + } mJointMap.clear(); clearSkeleton(); - clearCollisionVolumes(); + delete_and_clear(mCollisionVolumes); std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer()); mPolyMeshes.clear(); @@ -317,14 +320,14 @@ void LLAvatarAppearance::initClass() BOOL success = sXMLTree.parseFile( xmlFile, FALSE ); if (!success) { - llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl; + LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL; } // now sanity check xml file LLXmlTreeNode* root = sXMLTree.getRoot(); if (!root) { - llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl; + LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL; return; } @@ -333,14 +336,14 @@ void LLAvatarAppearance::initClass() //------------------------------------------------------------------------- if( !root->hasName( "linden_avatar" ) ) { - llerrs << "Invalid avatar file header: " << xmlFile << llendl; + LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL; } std::string version; static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version"); if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") ) { - llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl; + LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL; } S32 wearable_def_version = 1; @@ -353,7 +356,7 @@ void LLAvatarAppearance::initClass() LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" ); if (!skeleton_node) { - llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl; + LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL; return; } @@ -361,14 +364,14 @@ void LLAvatarAppearance::initClass() static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name"); if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name)) { - llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl; + LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL; } std::string skeleton_path; skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name); if (!parseSkeletonFile(skeleton_path)) { - llerrs << "Error parsing skeleton file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL; } // Process XML data @@ -381,44 +384,44 @@ void LLAvatarAppearance::initClass() sAvatarSkeletonInfo = new LLAvatarSkeletonInfo; if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot())) { - llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL; } // parse avatar_lad.xml if (sAvatarXmlInfo) { //this can happen if a login attempt failed - deleteAndClear(sAvatarXmlInfo); + delete_and_clear(sAvatarXmlInfo); } sAvatarXmlInfo = new LLAvatarXmlInfo; if (!sAvatarXmlInfo->parseXmlSkeletonNode(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } if (!sAvatarXmlInfo->parseXmlMeshNodes(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } if (!sAvatarXmlInfo->parseXmlColorNodes(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } if (!sAvatarXmlInfo->parseXmlLayerNodes(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } if (!sAvatarXmlInfo->parseXmlDriverNodes(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } if (!sAvatarXmlInfo->parseXmlMorphNodes(root)) { - llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl; + LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL; } } void LLAvatarAppearance::cleanupClass() { - deleteAndClear(sAvatarXmlInfo); - deleteAndClear(sAvatarSkeletonInfo); + delete_and_clear(sAvatarXmlInfo); + delete_and_clear(sAvatarSkeletonInfo); sSkeletonXMLTree.cleanup(); sXMLTree.cleanup(); } @@ -524,7 +527,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename) if (!parsesuccess) { - llerrs << "Can't parse skeleton file: " << filename << llendl; + LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL; return FALSE; } @@ -532,13 +535,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename) LLXmlTreeNode* root = sSkeletonXMLTree.getRoot(); if (!root) { - llerrs << "No root node found in avatar skeleton file: " << filename << llendl; + LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL; return FALSE; } if( !root->hasName( "linden_skeleton" ) ) { - llerrs << "Invalid avatar skeleton file header: " << filename << llendl; + LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL; return FALSE; } @@ -546,7 +549,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename) static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version"); if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") ) { - llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl; + LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL; return FALSE; } @@ -565,7 +568,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent joint = getCharacterJoint(joint_num); if (!joint) { - llwarns << "Too many bones" << llendl; + LL_WARNS() << "Too many bones" << LL_ENDL; return FALSE; } joint->setName( info->mName ); @@ -574,7 +577,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent { if (volume_num >= (S32)mCollisionVolumes.size()) { - llwarns << "Too many bones" << llendl; + LL_WARNS() << "Too many bones" << LL_ENDL; return FALSE; } joint = (mCollisionVolumes[volume_num]); @@ -652,7 +655,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) //------------------------------------------------------------------------- if (!allocateCharacterJoints(info->mNumBones)) { - llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl; + LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL; return FALSE; } @@ -663,7 +666,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) { if (!allocateCollisionVolumes(info->mNumCollisionVolumes)) { - llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl; + LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL; return FALSE; } } @@ -676,7 +679,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) LLAvatarBoneInfo *info = *iter; if (!setupBone(info, NULL, current_volume_num, current_joint_num)) { - llerrs << "Error parsing bone in skeleton file" << llendl; + LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL; return FALSE; } } @@ -742,17 +745,17 @@ void LLAvatarAppearance::buildCharacter() } // gPrintMessagesThisFrame = TRUE; - lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl; + LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL; if (!status) { if (isSelf()) { - llerrs << "Unable to load user's avatar" << llendl; + LL_ERRS() << "Unable to load user's avatar" << LL_ENDL; } else { - llwarns << "Unable to load other's avatar" << llendl; + LL_WARNS() << "Unable to load other's avatar" << LL_ENDL; } return; } @@ -801,7 +804,7 @@ void LLAvatarAppearance::buildCharacter() mEyeLeftp && mEyeRightp)) { - llerrs << "Failed to create avatar." << llendl; + LL_ERRS() << "Failed to create avatar." << LL_ENDL; return; } @@ -827,21 +830,21 @@ BOOL LLAvatarAppearance::loadAvatar() // avatar_skeleton.xml if( !buildSkeleton(sAvatarSkeletonInfo) ) { - llwarns << "avatar file: buildSkeleton() failed" << llendl; + LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL; return FALSE; } // avatar_lad.xml : if( !loadSkeletonNode() ) { - llwarns << "avatar file: loadNodeSkeleton() failed" << llendl; + LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL; return FALSE; } // avatar_lad.xml : if( !loadMeshNodes() ) { - llwarns << "avatar file: loadNodeMesh() failed" << llendl; + LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL; return FALSE; } @@ -851,13 +854,13 @@ BOOL LLAvatarAppearance::loadAvatar() mTexSkinColor = new LLTexGlobalColor( this ); if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) ) { - llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl; + LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL; return FALSE; } } else { - llwarns << " name=\"skin_color\" not found" << llendl; + LL_WARNS() << " name=\"skin_color\" not found" << LL_ENDL; return FALSE; } if( sAvatarXmlInfo->mTexHairColorInfo ) @@ -865,13 +868,13 @@ BOOL LLAvatarAppearance::loadAvatar() mTexHairColor = new LLTexGlobalColor( this ); if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) ) { - llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl; + LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL; return FALSE; } } else { - llwarns << " name=\"hair_color\" not found" << llendl; + LL_WARNS() << " name=\"hair_color\" not found" << LL_ENDL; return FALSE; } if( sAvatarXmlInfo->mTexEyeColorInfo ) @@ -879,26 +882,26 @@ BOOL LLAvatarAppearance::loadAvatar() mTexEyeColor = new LLTexGlobalColor( this ); if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) ) { - llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl; + LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL; return FALSE; } } else { - llwarns << " name=\"eye_color\" not found" << llendl; + LL_WARNS() << " name=\"eye_color\" not found" << LL_ENDL; return FALSE; } // avatar_lad.xml : if (sAvatarXmlInfo->mLayerInfoList.empty()) { - llwarns << "avatar file: missing node" << llendl; + LL_WARNS() << "avatar file: missing node" << LL_ENDL; return FALSE; } if (sAvatarXmlInfo->mMorphMaskInfoList.empty()) { - llwarns << "avatar file: missing node" << llendl; + LL_WARNS() << "avatar file: missing node" << LL_ENDL; return FALSE; } @@ -940,14 +943,14 @@ BOOL LLAvatarAppearance::loadAvatar() LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam; if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false)) { - llwarns << "could not link driven params for avatar " << this->getFullname() << " param id: " << driver_param->getID() << llendl; + LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL; continue; } } else { delete driver_param; - llwarns << "avatar file: driver_param->parseData() failed" << llendl; + LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL; return FALSE; } } @@ -1067,17 +1070,17 @@ BOOL LLAvatarAppearance::loadMeshNodes() } else { - llwarns << "Avatar file: has invalid lod setting " << lod << llendl; + LL_WARNS() << "Avatar file: has invalid lod setting " << lod << LL_ENDL; return FALSE; } } - else + else { - llwarns << "Ignoring unrecognized mesh type: " << type << llendl; + LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL; return FALSE; } - // llinfos << "Parsing mesh data for " << type << "..." << llendl; + // LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL; // If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings. // Do not touch!!! @@ -1107,7 +1110,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() if( !poly_mesh ) { - llwarns << "Failed to load mesh of type " << type << llendl; + LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL; return FALSE; } @@ -1167,7 +1170,7 @@ BOOL LLAvatarAppearance::loadLayersets() { stop_glerror(); delete layer_set; - llwarns << "avatar file: layer_set->setInfo() failed" << llendl; + LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL; return FALSE; } @@ -1190,7 +1193,7 @@ BOOL LLAvatarAppearance::loadLayersets() // if no baked texture was found, warn and cleanup if (baked_index == BAKED_NUM_INDICES) { - llwarns << " has invalid body_region attribute" << llendl; + LL_WARNS() << " has invalid body_region attribute" << LL_ENDL; delete layer_set; return FALSE; } @@ -1208,7 +1211,7 @@ BOOL LLAvatarAppearance::loadLayersets() } else { - llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl; + LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL; success = FALSE; } } @@ -1354,7 +1357,7 @@ void LLAvatarAppearance::getMeshInfo (mesh_info_t* mesh_info) else { // Should never happen - llwarns << "Duplicate mesh LOD " << type << " " << lod << " " << file << llendl; + LL_WARNS() << "Duplicate mesh LOD " << type << " " << lod << " " << file << LL_ENDL; } } } @@ -1367,7 +1370,7 @@ BOOL LLAvatarAppearance::isValid() const // This should only be called on ourself. if (!isSelf()) { - llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl; + LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL; } return TRUE; } @@ -1460,7 +1463,7 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) return TRUE; } -void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake ) +void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, bool upload_bake ) { U32 param_name[3]; if( teToColorParams( te, param_name ) ) @@ -1527,18 +1530,12 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in return mBakedTextureDatas[baked_index].mTexLayerSet; } -void LLAvatarAppearance::clearCollisionVolumes() -{ - std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(), - DeletePointer()); - mCollisionVolumes.clear(); -} - //----------------------------------------------------------------------------- // allocateCollisionVolumes() //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num ) { + delete_and_clear(mCollisionVolumes); mCollisionVolumes.reserve(num); LLAvatarJointCollisionVolume* cv; @@ -1551,7 +1548,7 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num ) } else { - clearCollisionVolumes(); + delete_and_clear(mCollisionVolumes); return false; } } @@ -1569,7 +1566,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!node->getFastAttributeString(name_string, mName)) { - llwarns << "Bone without name" << llendl; + LL_WARNS() << "Bone without name" << LL_ENDL; return FALSE; } } @@ -1584,28 +1581,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) } else { - llwarns << "Invalid node " << node->getName() << llendl; + LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL; return FALSE; } static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos"); if (!node->getFastAttributeVector3(pos_string, mPos)) { - llwarns << "Bone without position" << llendl; + LL_WARNS() << "Bone without position" << LL_ENDL; return FALSE; } static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot"); if (!node->getFastAttributeVector3(rot_string, mRot)) { - llwarns << "Bone without rotation" << llendl; + LL_WARNS() << "Bone without rotation" << LL_ENDL; return FALSE; } static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale"); if (!node->getFastAttributeVector3(scale_string, mScale)) { - llwarns << "Bone without scale" << llendl; + LL_WARNS() << "Bone without scale" << LL_ENDL; return FALSE; } @@ -1614,7 +1611,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot"); if (!node->getFastAttributeVector3(pivot_string, mPivot)) { - llwarns << "Bone without pivot" << llendl; + LL_WARNS() << "Bone without pivot" << LL_ENDL; return FALSE; } } @@ -1642,7 +1639,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones"); if (!node->getFastAttributeS32(num_bones_string, mNumBones)) { - llwarns << "Couldn't find number of bones." << llendl; + LL_WARNS() << "Couldn't find number of bones." << LL_ENDL; return FALSE; } @@ -1656,7 +1653,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node) if (!info->parseXml(child)) { delete info; - llwarns << "Error parsing bone in skeleton file" << llendl; + LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL; return FALSE; } mBoneInfoList.push_back(info); @@ -1673,7 +1670,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro LLXmlTreeNode* node = root->getChildByName( "skeleton" ); if( !node ) { - llwarns << "avatar file: missing " << llendl; + LL_WARNS() << "avatar file: missing " << LL_ENDL; return FALSE; } @@ -1688,11 +1685,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro { if (child->getChildByName("param_morph")) { - llwarns << "Can't specify morph param in skeleton definition." << llendl; + LL_WARNS() << "Can't specify morph param in skeleton definition." << LL_ENDL; } else { - llwarns << "Unknown param type." << llendl; + LL_WARNS() << "Unknown param type." << LL_ENDL; } continue; } @@ -1717,7 +1714,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!child->getFastAttributeString(name_string, info->mName)) { - llwarns << "No name supplied for attachment point." << llendl; + LL_WARNS() << "No name supplied for attachment point." << LL_ENDL; delete info; continue; } @@ -1725,7 +1722,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint"); if (!child->getFastAttributeString(joint_string, info->mJointName)) { - llwarns << "No bone declared in attachment point " << info->mName << llendl; + LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL; delete info; continue; } @@ -1751,7 +1748,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id"); if (!child->getFastAttributeS32(id_string, info->mAttachmentID)) { - llwarns << "No id supplied for attachment point " << info->mName << llendl; + LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL; delete info; continue; } @@ -1786,7 +1783,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type"); if( !node->getFastAttributeString( type_string, info->mType ) ) { - llwarns << "Avatar file: is missing type attribute. Ignoring element. " << llendl; + LL_WARNS() << "Avatar file: is missing type attribute. Ignoring element. " << LL_ENDL; delete info; return FALSE; // Ignore this element } @@ -1794,7 +1791,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod"); if (!node->getFastAttributeS32( lod_string, info->mLOD )) { - llwarns << "Avatar file: is missing lod attribute. Ignoring element. " << llendl; + LL_WARNS() << "Avatar file: is missing lod attribute. Ignoring element. " << LL_ENDL; delete info; return FALSE; // Ignore this element } @@ -1802,7 +1799,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name"); if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) ) { - llwarns << "Avatar file: is missing file_name attribute. Ignoring: " << info->mType << llendl; + LL_WARNS() << "Avatar file: is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL; delete info; return FALSE; // Ignore this element } @@ -1833,11 +1830,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) { if (child->getChildByName("param_skeleton")) { - llwarns << "Can't specify skeleton param in a mesh definition." << llendl; + LL_WARNS() << "Can't specify skeleton param in a mesh definition." << LL_ENDL; } else { - llwarns << "Unknown param type." << llendl; + LL_WARNS() << "Unknown param type." << LL_ENDL; } continue; } @@ -1878,14 +1875,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root { if (mTexSkinColorInfo) { - llwarns << "avatar file: multiple instances of skin_color" << llendl; + LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL; return FALSE; } mTexSkinColorInfo = new LLTexGlobalColorInfo; if( !mTexSkinColorInfo->parseXml( color_node ) ) { - deleteAndClear(mTexSkinColorInfo); - llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl; + delete_and_clear(mTexSkinColorInfo); + LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL; return FALSE; } } @@ -1893,14 +1890,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root { if (mTexHairColorInfo) { - llwarns << "avatar file: multiple instances of hair_color" << llendl; + LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL; return FALSE; } mTexHairColorInfo = new LLTexGlobalColorInfo; if( !mTexHairColorInfo->parseXml( color_node ) ) { - deleteAndClear(mTexHairColorInfo); - llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl; + delete_and_clear(mTexHairColorInfo); + LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL; return FALSE; } } @@ -1908,13 +1905,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root { if (mTexEyeColorInfo) { - llwarns << "avatar file: multiple instances of eye_color" << llendl; + LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL; return FALSE; } mTexEyeColorInfo = new LLTexGlobalColorInfo; if( !mTexEyeColorInfo->parseXml( color_node ) ) { - llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl; + LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL; return FALSE; } } @@ -1940,7 +1937,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root else { delete layer_info; - llwarns << "avatar file: layer_set->parseXml() failed" << llendl; + LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL; return FALSE; } } @@ -1969,7 +1966,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo else { delete driver_info; - llwarns << "avatar file: driver_param->parseXml() failed" << llendl; + LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL; return FALSE; } } @@ -1998,7 +1995,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name"); if (!grand_child->getFastAttributeString(name_string, info->mName)) { - llwarns << "No name supplied for morph mask." << llendl; + LL_WARNS() << "No name supplied for morph mask." << LL_ENDL; delete info; continue; } @@ -2006,7 +2003,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region"); if (!grand_child->getFastAttributeString(region_string, info->mRegion)) { - llwarns << "No region supplied for morph mask." << llendl; + LL_WARNS() << "No region supplied for morph mask." << LL_ENDL; delete info; continue; } @@ -2014,7 +2011,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer"); if (!grand_child->getFastAttributeString(layer_string, info->mLayer)) { - llwarns << "No layer supplied for morph mask." << llendl; + LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL; delete info; continue; } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index da4e09b42..f691d7378 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -262,7 +262,7 @@ protected: // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: - void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); + void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, bool upload_bake = false); LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); @@ -271,7 +271,7 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; - virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake = false) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; @@ -339,7 +339,6 @@ protected: public: std::vector mCollisionVolumes; protected: - void clearCollisionVolumes(); BOOL allocateCollisionVolumes(U32 num); /** Physics diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index b40475fdc..eb9601fc1 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -249,7 +249,7 @@ LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume() /*virtual*/ U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) { - llerrs << "Cannot call render() on LLAvatarJointCollisionVolume" << llendl; + LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL; return 0; } diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index 7a9508968..4853a6670 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -91,7 +91,7 @@ void LLSkinJoint::setupSkinJoint( LLJoint *joint) // find the named joint if (!(mJoint = joint)) { - llinfos << "Can't find joint" << llendl; + LL_INFOS() << "Can't find joint" << LL_ENDL; return; } @@ -304,7 +304,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh ) U32 jn; for (jn = 0; jn < numJointNames; jn++) { - //llinfos << "Setting up joint " << jointNames[jn] << llendl; + //LL_INFOS() << "Setting up joint " << jointNames[jn] << LL_ENDL; mSkinJoints[jn].setupSkinJoint( getRoot()->findJoint(jointNames[jn]) ); } } @@ -315,7 +315,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh ) setupJoint(getRoot()); } -// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl; + LL_DEBUGS() << "joint render entries: " << mMesh->mJointRenderData.size() << LL_ENDL; } //----------------------------------------------------------------------------- @@ -323,7 +323,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh ) //----------------------------------------------------------------------------- void LLAvatarJointMesh::setupJoint(LLJoint* current_joint) { -// llinfos << "Mesh: " << getName() << llendl; +// LL_INFOS() << "Mesh: " << getName() << LL_ENDL; // S32 joint_count = 0; U32 sj; @@ -339,22 +339,22 @@ void LLAvatarJointMesh::setupJoint(LLJoint* current_joint) // we've found a skinjoint for this joint.. // is the last joint in the array our parent? - if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix()) + if(mMesh->mJointRenderData.size() && mMesh->mJointRenderData[mMesh->mJointRenderData.size() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix()) { // ...then just add ourselves LLJoint* jointp = js.mJoint; - mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js)); -// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl; + mMesh->mJointRenderData.push_back(new LLJointRenderData(&jointp->getWorldMatrix(), &js)); +// LL_INFOS() << "joint " << joint_count << js.mJoint->getName() << LL_ENDL; // joint_count++; } // otherwise add our parent and ourselves else { - mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL)); -// llinfos << "joint " << joint_count << current_joint->getParent()->getName() << llendl; + mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL)); +// LL_INFOS() << "joint " << joint_count << current_joint->getParent()->getName() << LL_ENDL; // joint_count++; - mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js)); -// llinfos << "joint " << joint_count << current_joint->getName() << llendl; + mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js)); +// LL_INFOS() << "joint " << joint_count << current_joint->getName() << LL_ENDL; // joint_count++; } } diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 8a3181702..d7e3ce858 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -89,7 +89,7 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node) } else { - llerrs << " Unable to resolve driven parameter: " << driven_id << llendl; + LL_ERRS() << " Unable to resolve driven parameter: " << driven_id << LL_ENDL; return FALSE; } } @@ -139,9 +139,9 @@ void LLDriverParamInfo::toStream(std::ostream &out) } else { - llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " + LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar " << mDriverParam->getAvatarAppearance() - << " for driver parameter " << getID() << llendl; + << " for driver parameter " << getID() << LL_ENDL; } out << std::endl; } @@ -152,19 +152,31 @@ void LLDriverParamInfo::toStream(std::ostream &out) // LLDriverParam //----------------------------------------------------------------------------- -LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) : +LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) + : LLViewerVisualParam(), + mDefaultVec(), + mDriven(), mCurrentDistortionParam( NULL ), mAvatarAppearance(appearance), mWearablep(wearable) { llassert(mAvatarAppearance); - if (mWearablep) - { - llassert(mAvatarAppearance->isSelf()); - } + llassert((mWearablep == NULL) || mAvatarAppearance->isSelf()); mDefaultVec.clear(); } +LLDriverParam::LLDriverParam(const LLDriverParam& pOther) + : LLViewerVisualParam(pOther), + mDefaultVec(pOther.mDefaultVec), + mDriven(pOther.mDriven), + mCurrentDistortionParam(pOther.mCurrentDistortionParam), + mAvatarAppearance(pOther.mAvatarAppearance), + mWearablep(pOther.mWearablep) +{ + llassert(mAvatarAppearance); + llassert((mWearablep == NULL) || mAvatarAppearance->isSelf()); +} + LLDriverParam::~LLDriverParam() { } @@ -178,7 +190,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) mID = info->mID; info->mDriverParam = this; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); return TRUE; } @@ -186,31 +198,10 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) /*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const { llassert(wearable); - LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable); - // FIXME DRANO this clobbers mWearablep, which means any code - // currently using mWearablep is wrong, or at least untested. - *new_param = *this; - //new_param->mWearablep = wearable; -// new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables. - return new_param; + return new LLDriverParam(*this); } -#if 0 // obsolete -BOOL LLDriverParam::parseData(LLXmlTreeNode* node) -{ - LLDriverParamInfo* info = new LLDriverParamInfo; - - info->parseXml(node); - if (!setInfo(info)) - { - delete info; - return FALSE; - } - return TRUE; -} -#endif - -void LLDriverParam::setWeight(F32 weight, BOOL upload_bake) +void LLDriverParam::setWeight(F32 weight, bool upload_bake) { F32 min_weight = getMinWeight(); F32 max_weight = getMaxWeight(); @@ -445,7 +436,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake ) +void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake ) { LLVisualParam::setAnimationTarget(target_value, upload_bake); @@ -463,7 +454,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake ) //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLDriverParam::stopAnimating(BOOL upload_bake) +void LLDriverParam::stopAnimating(bool upload_bake) { LLVisualParam::stopAnimating(upload_bake); @@ -545,7 +536,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type); if (wearable) { - wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false); + wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID)); } } } diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index 47d14d2a1..ce6fa6345 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -112,9 +112,9 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param. - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake ); - /*virtual*/ void stopAnimating(BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight, bool upload_bake = false); + /*virtual*/ void setAnimationTarget( F32 target_value, bool upload_bake = false); + /*virtual*/ void stopAnimating(bool upload_bake = false); /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); /*virtual*/ void resetDrivenParams(); /*virtual*/ char const* getTypeString(void) const { return "param_driver"; } @@ -131,8 +131,9 @@ public: const LLViewerVisualParam* getDrivenParam(S32 index) const; protected: + LLDriverParam(const LLDriverParam& pOther); F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); - void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake); + void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake = false); LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index 7e36a0679..f49cf2151 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -64,7 +64,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) : LLTexLayer* original_layer = lto.getTexLayer(index); if (!original_layer) { - llerrs << "could not clone Local Texture Object: unable to extract texlayer!" << llendl; + LL_ERRS() << "could not clone Local Texture Object: unable to extract texlayer!" << LL_ENDL; continue; } diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index fd2a845c4..9e6b6d406 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -162,7 +162,7 @@ void LLPolyMeshSharedData::freeMeshData() } // compate_int is used by the qsort function to sort the index array -int compare_int(const void *a, const void *b); +S32 compare_int(const void *a, const void *b); //----------------------------------------------------------------------------- // genIndices() @@ -277,13 +277,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) //------------------------------------------------------------------------- if(fileName.empty()) { - llerrs << "Filename is Empty!" << llendl; + LL_ERRS() << "Filename is Empty!" << LL_ENDL; return FALSE; } LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/ if (!fp) { - llerrs << "can't open: " << fileName << llendl; + LL_ERRS() << "can't open: " << fileName << LL_ENDL; return FALSE; } @@ -293,7 +293,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) char header[128]; /*Flawfinder: ignore*/ if (fread(header, sizeof(char), 128, fp) != 128) { - llwarns << "Short read" << llendl; + LL_WARNS() << "Short read" << LL_ENDL; } //------------------------------------------------------------------------- @@ -302,7 +302,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) BOOL status = FALSE; if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/ { - lldebugs << "Loading " << fileName << llendl; + LL_DEBUGS() << "Loading " << fileName << LL_ENDL; //---------------------------------------------------------------- // File Header (seek past it) @@ -316,7 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) size_t numRead = fread(&hasWeights, sizeof(U8), 1, fp); if (numRead != 1) { - llerrs << "can't read HasWeights flag from " << fileName << llendl; + LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL; return FALSE; } if (!isLOD()) @@ -331,7 +331,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) numRead = fread(&hasDetailTexCoords, sizeof(U8), 1, fp); if (numRead != 1) { - llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl; + LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL; return FALSE; } @@ -343,7 +343,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(position.mV, sizeof(float), 3); if (numRead != 3) { - llerrs << "can't read Position from " << fileName << llendl; + LL_ERRS() << "can't read Position from " << fileName << LL_ENDL; return FALSE; } setPosition( position ); @@ -356,7 +356,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(rotationAngles.mV, sizeof(float), 3); if (numRead != 3) { - llerrs << "can't read RotationAngles from " << fileName << llendl; + LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL; return FALSE; } @@ -365,7 +365,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) if (numRead != 1) { - llerrs << "can't read RotationOrder from " << fileName << llendl; + LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL; return FALSE; } @@ -384,7 +384,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(scale.mV, sizeof(float), 3); if (numRead != 3) { - llerrs << "can't read Scale from " << fileName << llendl; + LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL; return FALSE; } setScale( scale ); @@ -405,7 +405,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&numVertices, sizeof(U16), 1); if (numRead != 1) { - llerrs << "can't read NumVertices from " << fileName << llendl; + LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL; return FALSE; } @@ -420,7 +420,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&mBaseCoords[i], sizeof(float), 3); if (numRead != 3) { - llerrs << "can't read Coordinates from " << fileName << llendl; + LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL; return FALSE; } } @@ -434,7 +434,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&mBaseNormals[i], sizeof(float), 3); if (numRead != 3) { - llerrs << " can't read Normals from " << fileName << llendl; + LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL; return FALSE; } } @@ -448,7 +448,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&mBaseBinormals[i], sizeof(float), 3); if (numRead != 3) { - llerrs << " can't read Binormals from " << fileName << llendl; + LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL; return FALSE; } } @@ -460,7 +460,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(mTexCoords, sizeof(float), 2*numVertices); if (numRead != numVertices) { - llerrs << "can't read TexCoords from " << fileName << llendl; + LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL; return FALSE; } @@ -473,7 +473,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(mDetailTexCoords, sizeof(float), 2*numVertices); if (numRead != numVertices) { - llerrs << "can't read DetailTexCoords from " << fileName << llendl; + LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL; return FALSE; } } @@ -487,7 +487,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(mWeights, sizeof(float), numVertices); if (numRead != numVertices) { - llerrs << "can't read Weights from " << fileName << llendl; + LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL; return FALSE; } } @@ -501,7 +501,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&numFaces, sizeof(U16), 1); if (numRead != 1) { - llerrs << "can't read NumFaces from " << fileName << llendl; + LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL; return FALSE; } allocateFaceData( numFaces ); @@ -519,7 +519,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(face, sizeof(U16), 3); if (numRead != 3) { - llerrs << "can't read Face[" << i << "] from " << fileName << llendl; + LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL; return FALSE; } if (mReferenceData) @@ -559,10 +559,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) numTris++; } - lldebugs << "verts: " << numVertices + LL_DEBUGS() << "verts: " << numVertices << ", faces: " << numFaces << ", tris: " << numTris - << llendl; + << LL_ENDL; //---------------------------------------------------------------- // NumSkinJoints @@ -576,7 +576,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) llendianswizzle(&numSkinJoints, sizeof(U16), 1); if (numRead != 1) { - llerrs << "can't read NumSkinJoints from " << fileName << llendl; + LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL; return FALSE; } allocateJointNames( numSkinJoints ); @@ -592,7 +592,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination if (numRead != 1) { - llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl; + LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL; return FALSE; } @@ -687,12 +687,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) S32 remapDst; if (fread(&remapSrc, sizeof(S32), 1, fp) != 1) { - llerrs << "can't read source vertex in vertex remap data" << llendl; + LL_ERRS() << "can't read source vertex in vertex remap data" << LL_ENDL; break; } if (fread(&remapDst, sizeof(S32), 1, fp) != 1) { - llerrs << "can't read destination vertex in vertex remap data" << llendl; + LL_ERRS() << "can't read destination vertex in vertex remap data" << LL_ENDL; break; } llendianswizzle(&remapSrc, sizeof(S32), 1); @@ -707,7 +707,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) } else { - llerrs << "invalid mesh file header: " << fileName << llendl; + LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL; status = FALSE; } @@ -808,15 +808,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ //----------------------------------------------------------------------------- LLPolyMesh::~LLPolyMesh() { - S32 i; - for (i = 0; i < mJointRenderData.count(); i++) - { - delete mJointRenderData[i]; - mJointRenderData[i] = NULL; - } - - ll_aligned_free_16(mVertexData); - + delete_and_clear(mJointRenderData); + ll_aligned_free_16(mVertexData); } @@ -831,7 +824,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL); if (meshSharedData) { -// llinfos << "Polymesh " << name << " found in global mesh table." << llendl; +// LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL; LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh); return poly_mesh; } @@ -855,7 +848,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh); -// llinfos << "Polymesh " << name << " added to global mesh table." << llendl; +// LL_INFOS() << "Polymesh " << name << " added to global mesh table." << LL_ENDL; sGlobalSharedMeshList[name] = poly_mesh->mSharedData; return poly_mesh; @@ -887,7 +880,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) //------------------------------------------------------------------------- if (fwrite(HEADER_BINARY, 1, strlen(HEADER_BINARY), fp) != strlen(HEADER_BINARY)) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } if (strlen(HEADER_BINARY) < 24) @@ -896,7 +889,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) int pad = 24 - strlen(HEADER_BINARY); if (fwrite(&padding, 1, pad, fp) != pad) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -906,7 +899,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) U8 hasWeights = (U8) mSharedData->mHasWeights; if (fwrite(&hasWeights, sizeof(U8), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //---------------------------------------------------------------- @@ -915,7 +908,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) U8 hasDetailTexCoords = (U8) mSharedData->mHasDetailTexCoords; if (fwrite(&hasDetailTexCoords, sizeof(U8), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //---------------------------------------------------------------- @@ -925,7 +918,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(position.mV, sizeof(float), 3); if (fwrite(position.mV, sizeof(float), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //---------------------------------------------------------------- @@ -946,13 +939,13 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(rotationAngles.mV, sizeof(float), 3); if (fwrite(rotationAngles.mV, sizeof(float), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } U8 rotationOrder = 0; if (fwrite(&rotationOrder, sizeof(U8), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //---------------------------------------------------------------- @@ -962,7 +955,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(scale.mV, sizeof(float), 3); if (fwrite(scale.mV, sizeof(float), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //---------------------------------------------------------------- @@ -975,7 +968,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&numVertices, sizeof(U16), 1); if (fwrite(&numVertices, sizeof(U16), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } numVertices = mSharedData->mNumVertices; // without the swizzle again @@ -989,7 +982,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(coords.getF32ptr(), sizeof(float), 3); if (fwrite(coords.getF32ptr(), 3*sizeof(float), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(coords.getF32ptr(), sizeof(float), 3); } @@ -1004,7 +997,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(normals.getF32ptr(), sizeof(float), 3); if (fwrite(normals.getF32ptr(), 3*sizeof(float), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(normals.getF32ptr(), sizeof(float), 3); } @@ -1019,7 +1012,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(binormals.getF32ptr(), sizeof(float), 3); if (fwrite(binormals.getF32ptr(), 3*sizeof(float), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(binormals.getF32ptr(), sizeof(float), 3); } @@ -1032,7 +1025,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(tex, sizeof(float), 2*numVertices); if (fwrite(tex, 2*sizeof(float), numVertices, fp) != numVertices) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(tex, sizeof(float), 2*numVertices); @@ -1046,7 +1039,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(detail, sizeof(float), 2*numVertices); if (fwrite(detail, 2*sizeof(float), numVertices, fp) != numVertices) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(detail, sizeof(float), 2*numVertices); } @@ -1061,7 +1054,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(weights, sizeof(float), numVertices); if (fwrite(weights, sizeof(float), numVertices, fp) != numVertices) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(weights, sizeof(float), numVertices); } @@ -1075,7 +1068,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&numFaces, sizeof(U16), 1); if (fwrite(&numFaces, sizeof(U16), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } numFaces = mSharedData->mNumFaces; // without the swizzle again @@ -1094,7 +1087,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(face, sizeof(U16), 3); if (fwrite(face, sizeof(U16), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1121,7 +1114,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&numSkinJoints, sizeof(U16), 1); if (fwrite(&numSkinJoints, sizeof(U16), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(&numSkinJoints, sizeof(U16), 1); @@ -1134,7 +1127,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) jn = &mSharedData->mJointNames[i]; if (fwrite(jn->c_str(), 1, jn->length(), fp) != jn->length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } if (jn->length() < 64) @@ -1142,7 +1135,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) int pad = 64 - jn->length(); if (fwrite(&padding, 1, pad, fp) != pad) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } } @@ -1173,7 +1166,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) if (fwrite(morph_name.c_str(), 1, morph_name.length(), fp) != morph_name.length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } if (morph_name.length() < 64) @@ -1181,20 +1174,20 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) int pad = 64 - morph_name.length(); if (fwrite(&padding, 1, pad, fp) != pad) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } if (!morph_data->saveLLM(fp)) { - llwarns << "Problem writing morph" << llendl; + LL_WARNS() << "Problem writing morph" << LL_ENDL; } } char end_morphs[64] = "End Morphs"; // padded with zeroes if (fwrite(end_morphs, sizeof(char), 64, fp) != 64) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } //------------------------------------------------------------------------- @@ -1204,7 +1197,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&numRemaps, sizeof(S32), 1); if (fwrite(&numRemaps, sizeof(S32), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } std::map::iterator remap_iter = mSharedData->mSharedVerts.begin(); @@ -1217,7 +1210,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&remapSrc, sizeof(S32), 1); if (fwrite(&remapSrc, sizeof(S32), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } S32 remapDst = remap_iter->second; @@ -1225,7 +1218,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp) llendianswizzle(&remapDst, sizeof(S32), 1); if (fwrite(&remapDst, sizeof(S32), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1257,7 +1250,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp) coords[i].getF32ptr()[2]); if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1269,7 +1262,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp) normals[i].getF32ptr()[2]); if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1280,7 +1273,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp) tex[i][1]); if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1295,7 +1288,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp) f3, f3, f3); if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length()) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } @@ -1404,12 +1397,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp) values = sscanf (buffer," %255s %f %f %f", keyword, &tempX, &tempY, &tempZ); if (values != 4) { - llwarns << "Expecting v x y z, but found: " << buffer < mJointRenderData; + std::vector mJointRenderData; U32 mFaceVertexOffset; U32 mFaceVertexCount; diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 669c2e5fb..873169cba 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -115,7 +115,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&numVertices, sizeof(S32), 1); if (numRead != 1) { - llwarns << "Can't read number of morph target vertices" << llendl; + LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL; return FALSE; } @@ -152,13 +152,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&mVertexIndices[v], sizeof(U32), 1); if (numRead != 1) { - llwarns << "Can't read morph target vertex number" << llendl; + LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL; return FALSE; } if (mVertexIndices[v] > 10000) { - llerrs << "Bad morph index: " << mVertexIndices[v] << llendl; + LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL; } @@ -166,7 +166,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&mCoords[v], sizeof(F32), 3); if (numRead != 3) { - llwarns << "Can't read morph target vertex coordinates" << llendl; + LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL; return FALSE; } @@ -186,7 +186,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&mNormals[v], sizeof(F32), 3); if (numRead != 3) { - llwarns << "Can't read morph target normal" << llendl; + LL_WARNS() << "Can't read morph target normal" << LL_ENDL; return FALSE; } @@ -194,7 +194,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&mBinormals[v], sizeof(F32), 3); if (numRead != 3) { - llwarns << "Can't read morph target binormal" << llendl; + LL_WARNS() << "Can't read morph target binormal" << LL_ENDL; return FALSE; } @@ -203,7 +203,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2); if (numRead != 2) { - llwarns << "Can't read morph target uv" << llendl; + LL_WARNS() << "Can't read morph target uv" << LL_ENDL; return FALSE; } @@ -265,7 +265,7 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp) llendianswizzle(&numVertices, sizeof(S32), 1); if (fwrite(&numVertices, sizeof(S32), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } numVertices = mNumIndices; // without the swizzle again @@ -277,35 +277,35 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp) llendianswizzle(&mVertexIndices[v], sizeof(U32), 1); if (fwrite(&mVertexIndices[v], sizeof(U32), 1, fp) != 1) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(&mVertexIndices[v], sizeof(U32), 1); llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3); if (fwrite(mCoords[v].getF32ptr(), sizeof(F32), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3); llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3); if (fwrite(mNormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3); llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3); if (fwrite(mBinormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3); llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2); if (fwrite(&mTexCoords[v].mV, sizeof(F32), 2, fp) != 2) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2); } @@ -566,7 +566,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if( !node->getFastAttributeString( name_string, mMorphName ) ) { - llwarns << "Avatar file: is missing name attribute" << llendl; + LL_WARNS() << "Avatar file: is missing name attribute" << LL_ENDL; return FALSE; // Continue, ignoring this tag } @@ -577,8 +577,8 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) if (NULL == paramNode) { - llwarns << "Failed to getChildByName(\"param_morph\")" - << llendl; + LL_WARNS() << "Failed to getChildByName(\"param_morph\")" + << LL_ENDL; return FALSE; } @@ -612,10 +612,27 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) // LLPolyMorphTarget() //----------------------------------------------------------------------------- LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) - : mMorphData(NULL), mMesh(poly_mesh), - mVertMask(NULL), - mLastSex(SEX_FEMALE), - mNumMorphMasksPending(0) + : LLViewerVisualParam(), + mMorphData(NULL), + mMesh(poly_mesh), + mVertMask(NULL), + mLastSex(SEX_FEMALE), + mNumMorphMasksPending(0), + mVolumeMorphs() +{ +} + +//----------------------------------------------------------------------------- +// LLPolyMorphTarget() +//----------------------------------------------------------------------------- +LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther) + : LLViewerVisualParam(pOther), + mMorphData(pOther.mMorphData), + mMesh(pOther.mMesh), + mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)), + mLastSex(pOther.mLastSex), + mNumMorphMasksPending(pOther.mNumMorphMasksPending), + mVolumeMorphs(pOther.mVolumeMorphs) { } @@ -624,10 +641,8 @@ LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) //----------------------------------------------------------------------------- LLPolyMorphTarget::~LLPolyMorphTarget() { - if (mVertMask) - { - delete mVertMask; - } + delete mVertMask; + mVertMask = NULL; } //----------------------------------------------------------------------------- @@ -640,7 +655,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); LLAvatarAppearance* avatarp = mMesh->getAvatar(); LLPolyMorphTargetInfo::volume_info_list_t::iterator iter; @@ -674,7 +689,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) } if (!mMorphData) { - llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl; + LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL; return FALSE; // Continue, ignoring this tag } return TRUE; @@ -682,9 +697,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) /*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const { - LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh); - *new_param = *this; - return new_param; + return new LLPolyMorphTarget(*this); } #if 0 // obsolete @@ -1019,10 +1032,25 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3 // LLPolyVertexMask() //----------------------------------------------------------------------------- LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data) + : mWeights(new F32[morph_data->mNumIndices]), + mMorphData(morph_data), + mWeightsGenerated(FALSE) { - mWeights = new F32[morph_data->mNumIndices]; - mMorphData = morph_data; - mWeightsGenerated = FALSE; + llassert(mMorphData != NULL); + llassert(mMorphData->mNumIndices > 0); +} + +//----------------------------------------------------------------------------- +// LLPolyVertexMask() +//----------------------------------------------------------------------------- +LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther) + : mWeights(new F32[pOther.mMorphData->mNumIndices]), + mMorphData(pOther.mMorphData), + mWeightsGenerated(pOther.mWeightsGenerated) +{ + llassert(mMorphData != NULL); + llassert(mMorphData->mNumIndices > 0); + memcpy(mWeights, pOther.mWeights, sizeof(F32) * mMorphData->mNumIndices); } //----------------------------------------------------------------------------- @@ -1030,7 +1058,8 @@ LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data) //----------------------------------------------------------------------------- LLPolyVertexMask::~LLPolyVertexMask() { - delete[] mWeights; + delete [] mWeights; + mWeights = NULL; } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index b00fef4ac..aa1591bf7 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -95,6 +95,7 @@ class LLPolyVertexMask { public: LLPolyVertexMask(LLPolyMorphData* morph_data); + LLPolyVertexMask(const LLPolyVertexMask& pOther); ~LLPolyVertexMask(); void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights); @@ -163,16 +164,6 @@ public: LLPolyMorphTarget(LLPolyMesh *poly_mesh); ~LLPolyMorphTarget(); - void* operator new(size_t size) - { - return ll_aligned_malloc_16(size); - } - - void operator delete(void* ptr) - { - ll_aligned_free_16(ptr); - } - // Special: These functions are overridden by child classes LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; } // This sets mInfo and calls initialization functions @@ -196,7 +187,19 @@ public: void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert); void addPendingMorphMask() { mNumMorphMasksPending++; } + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + protected: + LLPolyMorphTarget(const LLPolyMorphTarget& pOther); + LLPolyMorphData* mMorphData; LLPolyMesh* mMesh; LLPolyVertexMask * mVertMask; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 3157cc965..4bfef71a1 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -61,8 +61,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) if (NULL == skeletalParam) { - llwarns << "Failed to getChildByName(\"param_skeleton\")" - << llendl; + LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")" + << LL_ENDL; return FALSE; } @@ -78,14 +78,14 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!bone->getFastAttributeString(name_string, name)) { - llwarns << "No bone name specified for skeletal param." << llendl; + LL_WARNS() << "No bone name specified for skeletal param." << LL_ENDL; continue; } static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale"); if (!bone->getFastAttributeVector3(scale_string, scale)) { - llwarns << "No scale specified for bone " << name << "." << llendl; + LL_WARNS() << "No scale specified for bone " << name << "." << LL_ENDL; continue; } @@ -99,7 +99,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) } else { - llwarns << "Unrecognized element " << bone->getName() << " in skeletal distortion" << llendl; + LL_WARNS() << "Unrecognized element " << bone->getName() << " in skeletal distortion" << LL_ENDL; continue; } } @@ -110,9 +110,25 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) // LLPolySkeletalDistortion() //----------------------------------------------------------------------------- LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp) + : LLViewerVisualParam(), + mDefaultVec(), + mJointScales(), + mJointOffsets(), + mAvatar(avatarp) +{ + mDefaultVec.splat(0.001f); +} + +//----------------------------------------------------------------------------- +// LLPolySkeletalDistortion() +//----------------------------------------------------------------------------- +LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther) + : LLViewerVisualParam(pOther), + mDefaultVec(pOther.mDefaultVec), + mJointScales(pOther.mJointScales), + mJointOffsets(pOther.mJointOffsets), + mAvatar(pOther.mAvatar) { - mAvatar = avatarp; - mDefaultVec.splat(0.001f); } //----------------------------------------------------------------------------- @@ -129,7 +145,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++) @@ -138,13 +154,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName); if (!joint) { - llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl; + LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL; continue; } if (mJointScales.find(joint) != mJointScales.end()) { - llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl; + LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; } // store it @@ -167,7 +183,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) { if (mJointOffsets.find(joint) != mJointOffsets.end()) { - llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl; + LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; } mJointOffsets[joint] = bone_info->mPositionDeformation; } @@ -177,9 +193,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) /*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const { - LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar); - *new_param = *this; - return new_param; + return new LLPolySkeletalDistortion(*this); } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 0e2f6e05d..e6ffbfe4e 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -68,6 +68,14 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo { friend class LLPolySkeletalDistortion; public: + + LLPolySkeletalDistortionInfo(); + /*virtual*/ ~LLPolySkeletalDistortionInfo() {}; + + /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); + + + void* operator new(size_t size) { return ll_aligned_malloc_16(size); @@ -78,10 +86,6 @@ public: ll_aligned_free_16(ptr); } - LLPolySkeletalDistortionInfo(); - /*virtual*/ ~LLPolySkeletalDistortionInfo() {}; - - /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); protected: typedef std::vector bone_info_list_t; @@ -129,6 +133,8 @@ public: /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;}; protected: + LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); + LL_ALIGN_16(LLVector4a mDefaultVec); typedef std::map joint_vec_map_t; joint_vec_map_t mJointScales; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index c3abbfd90..a241df8e4 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -90,17 +90,31 @@ const std::string& LLTexGlobalColor::getName() const //----------------------------------------------------------------------------- // LLTexParamGlobalColor //----------------------------------------------------------------------------- -LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) : - LLTexLayerParamColor(tex_global_color->getAvatarAppearance()), +LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) + : LLTexLayerParamColor(tex_global_color->getAvatarAppearance()), mTexGlobalColor(tex_global_color) { } +//----------------------------------------------------------------------------- +// LLTexParamGlobalColor +//----------------------------------------------------------------------------- +LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther) + : LLTexLayerParamColor(pOther), + mTexGlobalColor(pOther.mTexGlobalColor) +{ +} + +//----------------------------------------------------------------------------- +// ~LLTexParamGlobalColor +//----------------------------------------------------------------------------- +LLTexParamGlobalColor::~LLTexParamGlobalColor() +{ +} + /*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const { - LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor); - *new_param = *this; - return new_param; + return new LLTexParamGlobalColor(*this); } void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) @@ -129,7 +143,7 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!node->getFastAttributeString(name_string, mName)) { - llwarns << " element is missing name attribute." << llendl; + LL_WARNS() << " element is missing name attribute." << LL_ENDL; return FALSE; } // sub-element diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 286747987..e32e08bf0 100644 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -73,9 +73,11 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor { public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); + virtual ~LLTexParamGlobalColor(); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: - /*virtual*/ void onGlobalColorChanged(bool upload_bake); + LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther); + /*virtual*/ void onGlobalColorChanged(bool upload_bake = false); private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 297cfd471..b0f922b95 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -43,6 +43,7 @@ #include "llwearabledata.h" #include "llvertexbuffer.h" #include "llviewervisualparam.h" +#include "lllocaltextureobject.h" //#include "../tools/imdebug/imdebug.h" @@ -155,7 +156,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet() gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.00f); } - LLVertexBuffer::unbind(); + //LLVertexBuffer::unbind(); // Composite the color data LLGLSUIDefault gls_ui; @@ -170,7 +171,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet() gAlphaMaskProgram.unbind(); } - LLVertexBuffer::unbind(); + //LLVertexBuffer::unbind(); // reset GL state gGL.setColorMask(true, true); @@ -209,7 +210,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle body_region_string = LLXmlTree::addAttributeString("body_region"); if( !node->getFastAttributeString( body_region_string, mBodyRegion ) ) { - llwarns << " is missing body_region attribute" << llendl; + LL_WARNS() << " is missing body_region attribute" << LL_ENDL; return FALSE; } @@ -737,13 +738,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) } if (mLocalTexture == TEX_NUM_INDICES) { - llwarns << " element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl; + LL_WARNS() << " element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL; return FALSE; } } else { - llwarns << " element is missing a required attribute. " << mName << llendl; + LL_WARNS() << " element is missing a required attribute. " << mName << LL_ENDL; return FALSE; } } @@ -806,7 +807,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); if (!param_color->setInfo(color_info, TRUE)) { - llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl; + LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL; delete param_color; success = FALSE; } @@ -820,7 +821,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); if (!param_alpha->setInfo(alpha_info, TRUE)) { - llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl; + LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL; delete param_alpha; success = FALSE; } @@ -853,7 +854,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab // Not a critical warning, but could be useful for debugging later issues. -Nyx if (mInfo != NULL) { - llwarns << "mInfo != NULL" << llendl; + LL_WARNS() << "mInfo != NULL" << LL_ENDL; } mInfo = info; //mID = info->mID; // No ID @@ -1209,7 +1210,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) } else { - llinfos << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << llendl; + LL_INFOS() << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << LL_ENDL; } // if( mTexLayerSet->getAvatarAppearance()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) ) { @@ -1297,7 +1298,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) if( !success ) { - llinfos << "LLTexLayer::render() partial: " << getInfo()->mName << llendl; + LL_INFOS() << "LLTexLayer::render() partial: " << getInfo()->mName << LL_ENDL; } return success; } @@ -1434,7 +1435,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC { if (!force_render && !hasMorph()) { - lldebugs << "skipping renderMorphMasks for " << getUUID() << llendl; + LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL; return; } LLFastTimer t(FTM_RENDER_MORPH_MASKS); @@ -1475,7 +1476,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC success &= param->render( x, y, width, height ); if (!success && !force_render) { - lldebugs << "Failed to render param " << param->getID() << " ; skipping morph mask." << llendl; + LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL; return; } } @@ -1517,8 +1518,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } else { - llwarns << "Skipping rendering of " << getInfo()->mStaticImageFileName - << "; expected 1 or 4 components." << llendl; + LL_WARNS() << "Skipping rendering of " << getInfo()->mStaticImageFileName + << "; expected 1 or 4 components." << LL_ENDL; } } } @@ -1556,8 +1557,11 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } U32 cache_index = alpha_mask_crc.getCRC(); - U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL); - if (!alpha_data) + U8* alpha_data = NULL;//get_if_there(mAlphaCache,cache_index,(U8*)NULL); + // We believe we need to generate morph masks, do not assume that the cached version is accurate. + // We can get bad morph masks during login, on minimize, and occasional gl errors. + // We should only be doing this when we believe something has changed with respect to the user's appearance. + //if (!alpha_data) { // clear out a slot if we have filled our cache S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1; @@ -1897,18 +1901,18 @@ LLTexLayerStaticImageList::~LLTexLayerStaticImageList() void LLTexLayerStaticImageList::dumpByteCount() const { - llinfos << "Avatar Static Textures " << + LL_INFOS() << "Avatar Static Textures " << "KB GL:" << (mGLBytes / 1024) << - "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl; + "KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL; } void LLTexLayerStaticImageList::deleteCachedImages() { if( mGLBytes || mTGABytes ) { - llinfos << "Clearing Static Textures " << + LL_INFOS() << "Clearing Static Textures " << "KB GL:" << (mGLBytes / 1024) << - "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl; + "KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL; //mStaticImageLists uses LLPointers, clear() will cause deletion diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 64b3b6218..42cb163a5 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -39,7 +39,8 @@ //----------------------------------------------------------------------------- // LLTexLayerParam //----------------------------------------------------------------------------- -LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) : +LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) + : LLViewerVisualParam(), mTexLayer(layer), mAvatarAppearance(NULL) { @@ -49,16 +50,23 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) : } else { - llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl; + LL_ERRS() << "LLTexLayerParam constructor passed with NULL reference for layer!" << LL_ENDL; } } -LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) : +LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) + : LLViewerVisualParam(), mTexLayer(NULL), mAvatarAppearance(appearance) { } +LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther) + : LLViewerVisualParam(pOther), + mTexLayer(pOther.mTexLayer), + mAvatarAppearance(pOther.mAvatarAppearance) +{ +} BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance) { @@ -86,7 +94,7 @@ void LLTexLayerParamAlpha::dumpCacheByteCount() { S32 gl_bytes = 0; getCacheByteCount( &gl_bytes); - llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl; + LL_INFOS() << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << LL_ENDL; } // static @@ -111,9 +119,11 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) } } -LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) : - LLTexLayerParam(layer), +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) + : LLTexLayerParam(layer), mCachedProcessedTexture(NULL), + mStaticImageTGA(), + mStaticImageRaw(), mNeedsCreateTexture(FALSE), mStaticImageInvalid(FALSE), mAvgDistortionVec(1.f, 1.f, 1.f), @@ -122,9 +132,11 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) : sInstances.push_front(this); } -LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) : - LLTexLayerParam(appearance), +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) + : LLTexLayerParam(appearance), mCachedProcessedTexture(NULL), + mStaticImageTGA(), + mStaticImageRaw(), mNeedsCreateTexture(FALSE), mStaticImageInvalid(FALSE), mAvgDistortionVec(1.f, 1.f, 1.f), @@ -133,6 +145,18 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) : sInstances.push_front(this); } +LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther) + : LLTexLayerParam(pOther), + mCachedProcessedTexture(pOther.mCachedProcessedTexture), + mStaticImageTGA(pOther.mStaticImageTGA), + mStaticImageRaw(pOther.mStaticImageRaw), + mNeedsCreateTexture(pOther.mNeedsCreateTexture), + mStaticImageInvalid(pOther.mStaticImageInvalid), + mAvgDistortionVec(pOther.mAvgDistortionVec), + mCachedEffectiveWeight(pOther.mCachedEffectiveWeight) +{ + sInstances.push_front(this); +} LLTexLayerParamAlpha::~LLTexLayerParamAlpha() { @@ -142,9 +166,7 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha() /*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const { - LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer); - *new_param = *this; - return new_param; + return new LLTexLayerParamAlpha(*this); } void LLTexLayerParamAlpha::deleteCaches() @@ -160,7 +182,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; } -void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) +void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake) { if (mIsAnimating || mTexLayer == NULL) { @@ -184,7 +206,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) } } -void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake) { // do not animate dummy parameters if (mIsDummy) @@ -202,7 +224,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake } } -void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake) +void LLTexLayerParamAlpha::animate(F32 delta, bool upload_bake) { if (mNext) { @@ -278,7 +300,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) if (mStaticImageTGA.isNull()) { - llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl; + LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL; mStaticImageInvalid = TRUE; // don't try again. return FALSE; } @@ -309,7 +331,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mStaticImageRaw = new LLImageRaw; mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight); mNeedsCreateTexture = TRUE; - lldebugs << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << llendl; + LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL; } if (mCachedProcessedTexture) @@ -380,7 +402,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) } // else // { -// llwarns << " element is missing tga_file attribute." << llendl; +// LL_WARNS() << " element is missing tga_file attribute." << LL_ENDL; // } static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend"); @@ -398,27 +420,31 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) -LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) : - LLTexLayerParam(layer), +LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) + : LLTexLayerParam(layer), mAvgDistortionVec(1.f, 1.f, 1.f) { } -LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) : - LLTexLayerParam(appearance), +LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) + : LLTexLayerParam(appearance), mAvgDistortionVec(1.f, 1.f, 1.f) { } +LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther) + : LLTexLayerParam(pOther), + mAvgDistortionVec(pOther.mAvgDistortionVec) +{ +} + LLTexLayerParamColor::~LLTexLayerParamColor() { } /*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const { - LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer); - *new_param = *this; - return new_param; + return new LLTexLayerParamColor(*this); } LLColor4 LLTexLayerParamColor::getNetColor() const @@ -449,14 +475,13 @@ LLColor4 LLTexLayerParamColor::getNetColor() const } } -void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) +void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake) { if (mIsAnimating) { return; } - const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); F32 min_weight = getMinWeight(); F32 max_weight = getMaxWeight(); F32 new_weight = llclamp(weight, min_weight, max_weight); @@ -466,6 +491,8 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) { mCurWeight = new_weight; + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); + if (info->mNumColors <= 0) { // This will happen when we set the default weight the first time. @@ -481,11 +508,11 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) } } -// llinfos << "param " << mName << " = " << new_weight << llendl; +// LL_INFOS() << "param " << mName << " = " << new_weight << LL_ENDL; } } -void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake) { // set value first then set interpolating flag to ignore further updates mTargetWeight = target_value; @@ -497,7 +524,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake } } -void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake) +void LLTexLayerParamColor::animate(F32 delta, bool upload_bake) { if (mNext) { @@ -556,13 +583,13 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node) } if (!mNumColors) { - llwarns << " is missing sub-elements" << llendl; + LL_WARNS() << " is missing sub-elements" << LL_ENDL; return FALSE; } if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1)) { - llwarns << " with operation\"blend\" must have exactly one " << llendl; + LL_WARNS() << " with operation\"blend\" must have exactly one " << LL_ENDL; return FALSE; } diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 64a465a59..cadfd660a 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -52,6 +52,8 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; protected: + LLTexLayerParam(const LLTexLayerParam& pOther); + LLTexLayerInterface* mTexLayer; LLAvatarAppearance* mAvatarAppearance; }; @@ -83,9 +85,9 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight, bool upload_bake = false); + /*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false); + /*virtual*/ void animate(F32 delta, bool upload_bake = false); /*virtual*/ char const* getTypeString(void) const { return "param_alpha"; } // LLViewerVisualParam Virtual functions @@ -103,6 +105,8 @@ public: BOOL getMultiplyBlend() const; private: + LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther); + LLPointer mCachedProcessedTexture; LLPointer mStaticImageTGA; LLPointer mStaticImageRaw; @@ -175,9 +179,9 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight, bool upload_bake = false); + /*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false); + /*virtual*/ void animate(F32 delta, bool upload_bake = false); /*virtual*/ char const* getTypeString(void) const { return "param_color"; } // LLViewerVisualParam Virtual functions @@ -191,7 +195,9 @@ public: // New functions LLColor4 getNetColor() const; protected: - virtual void onGlobalColorChanged(bool upload_bake) {} + LLTexLayerParamColor(const LLTexLayerParamColor& pOther); + + virtual void onGlobalColorChanged(bool upload_bake = false) {} private: LL_ALIGN_16(LLVector4a mAvgDistortionVec); } LL_ALIGN_POSTFIX(16); diff --git a/indra/llappearance/lltexturemanagerbridge.cpp b/indra/llappearance/lltexturemanagerbridge.cpp index 939f6d620..33f2185e4 100644 --- a/indra/llappearance/lltexturemanagerbridge.cpp +++ b/indra/llappearance/lltexturemanagerbridge.cpp @@ -24,7 +24,6 @@ * $/LicenseInfo$ */ -#include "linden_common.h" #include "lltexturemanagerbridge.h" // Define a null texture manager bridge. Applications must provide their own bridge implementaton. diff --git a/indra/llappearance/lltexturemanagerbridge.h b/indra/llappearance/lltexturemanagerbridge.h index 355bcf02b..101704b16 100644 --- a/indra/llappearance/lltexturemanagerbridge.h +++ b/indra/llappearance/lltexturemanagerbridge.h @@ -35,7 +35,8 @@ class LLTextureManagerBridge { public: - virtual ~LLTextureManagerBridge(){}; + virtual ~LLTextureManagerBridge() {} + virtual LLPointer getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0; virtual LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0; virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0; diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp index 4a4f69c56..9e5deb07d 100644 --- a/indra/llappearance/llviewervisualparam.cpp +++ b/indra/llappearance/llviewervisualparam.cpp @@ -125,6 +125,22 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) // LLViewerVisualParam() //----------------------------------------------------------------------------- LLViewerVisualParam::LLViewerVisualParam() + : LLVisualParam() +{ +} + +//----------------------------------------------------------------------------- +// LLViewerVisualParam() +//----------------------------------------------------------------------------- +LLViewerVisualParam::LLViewerVisualParam(const LLViewerVisualParam& pOther) + : LLVisualParam(pOther) +{ +} + +//----------------------------------------------------------------------------- +// ~LLViewerVisualParam() +//----------------------------------------------------------------------------- +LLViewerVisualParam::~LLViewerVisualParam() { } @@ -139,7 +155,7 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); return TRUE; } diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index 39d29fccb..eacd09dc3 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -71,7 +71,7 @@ class LLViewerVisualParam : public LLVisualParam { public: LLViewerVisualParam(); - /*virtual*/ ~LLViewerVisualParam(){}; + virtual ~LLViewerVisualParam(); // Special: These functions are overridden by child classes LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; }; @@ -108,6 +108,8 @@ public: BOOL getCrossWearable() const { return getInfo()->mCrossWearable; } +protected: + LLViewerVisualParam(const LLViewerVisualParam& pOther); } LL_ALIGN_POSTFIX(16); #endif // LL_LLViewerVisualParam_H diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 6f163dd16..45962d898 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -43,15 +43,32 @@ S32 LLWearable::sCurrentDefinitionVersion = 1; // Private local functions static std::string terse_F32_to_string(F32 f); -LLWearable::LLWearable() : - mDefinitionVersion(0), - mType(LLWearableType::WT_INVALID) +LLWearable::LLWearable() + : mDefinitionVersion(-1), + mName(), + mDescription(), + mPermissions(), + mSaleInfo(), + mType(LLWearableType::WT_NONE), + mSavedVisualParamMap(), + mVisualParamIndexMap(), + mTEMap(), + mSavedTEMap() { } // virtual LLWearable::~LLWearable() { + for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter) + { + LLVisualParam* vp = vpIter->second; + vp->clearNextParam(); + delete vp; + vpIter->second = NULL; + } + + destroyTextures(); } const std::string& LLWearable::getTypeLabel() const @@ -156,7 +173,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp) { if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true)) { - llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl; + LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL; continue; } } @@ -180,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) } else { - llerrs << "could not find layerset for LTO in wearable!" << llendl; + LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL; } } @@ -214,7 +231,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // read header and version if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Failed to read wearable asset input stream." << llendl; + LL_WARNS() << "Failed to read wearable asset input stream." << LL_ENDL; return LLWearable::FAILURE; } if ( 1 != sscanf( /* Flawfinder: ignore */ @@ -232,25 +249,25 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // these wearables get re-saved with version definition 22. if( mDefinitionVersion > LLWearable::sCurrentDefinitionVersion && mDefinitionVersion != 24 ) { - llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl; + LL_WARNS() << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << LL_ENDL; return LLWearable::FAILURE; } - // name - if (!input_stream.good()) + // name may be empty + if (!input_stream.good()) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading name" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading name" << LL_ENDL; return LLWearable::FAILURE; } input_stream.getline(buffer, PARSE_BUFFER_SIZE); mName = buffer; - // description + // description may be empty if (!input_stream.good()) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading description" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading description" << LL_ENDL; return LLWearable::FAILURE; } input_stream.getline(buffer, PARSE_BUFFER_SIZE); @@ -259,15 +276,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // permissions may have extra empty lines before the correct line if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading permissions" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading permissions" << LL_ENDL; return LLWearable::FAILURE; } S32 perm_version = -1; if ( 1 != sscanf( buffer, " permissions %d\n", &perm_version ) || perm_version != 0 ) { - llwarns << "Bad Wearable asset: missing valid permissions" << llendl; + LL_WARNS() << "Bad Wearable asset: missing valid permissions" << LL_ENDL; return LLWearable::FAILURE; } if( !mPermissions.importStream( input_stream ) ) @@ -278,15 +295,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // sale info if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading sale info" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading sale info" << LL_ENDL; return LLWearable::FAILURE; } S32 sale_info_version = -1; if ( 1 != sscanf( buffer, " sale_info %d\n", &sale_info_version ) || sale_info_version != 0 ) { - llwarns << "Bad Wearable asset: missing valid sale_info" << llendl; + LL_WARNS() << "Bad Wearable asset: missing valid sale_info" << LL_ENDL; return LLWearable::FAILURE; } // Sale info used to contain next owner perm. It is now in the @@ -312,14 +329,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // wearable type if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading type" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading type" << LL_ENDL; return LLWearable::FAILURE; } S32 type = -1; if ( 1 != sscanf( buffer, "type %d\n", &type ) ) { - llwarns << "Bad Wearable asset: bad type" << llendl; + LL_WARNS() << "Bad Wearable asset: bad type" << LL_ENDL; return LLWearable::FAILURE; } if( 0 <= type && type < LLWearableType::WT_COUNT ) @@ -329,36 +346,36 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, else { mType = LLWearableType::WT_COUNT; - llwarns << "Bad Wearable asset: bad type #" << type << llendl; + LL_WARNS() << "Bad Wearable asset: bad type #" << type << LL_ENDL; return LLWearable::FAILURE; } // parameters header if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading parameters header" << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading parameters header" << LL_ENDL; return LLWearable::FAILURE; } S32 num_parameters = -1; if ( 1 != sscanf( buffer, "parameters %d\n", &num_parameters ) ) { - llwarns << "Bad Wearable asset: missing parameters block" << llendl; + LL_WARNS() << "Bad Wearable asset: missing parameters block" << LL_ENDL; return LLWearable::FAILURE; } if ( num_parameters > MAX_WEARABLE_ASSET_PARAMETERS ) { - llwarns << "Bad Wearable asset: too many parameters, " - << num_parameters << llendl; + LL_WARNS() << "Bad Wearable asset: too many parameters, " + << num_parameters << LL_ENDL; return LLWearable::FAILURE; } if( num_parameters != mVisualParamIndexMap.size() ) { - llwarns << "Wearable parameter mismatch. Reading in " + LL_WARNS() << "Wearable parameter mismatch. Reading in " << num_parameters << " from file, but created " << mVisualParamIndexMap.size() << " from avatar parameters. type: " - << getType() << llendl; + << getType() << LL_ENDL; } // parameters @@ -367,15 +384,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, { if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading parameter #" << i << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading parameter #" << i << LL_ENDL; return LLWearable::FAILURE; } S32 param_id = 0; F32 param_weight = 0.f; if ( 2 != sscanf( buffer, "%d %f\n", ¶m_id, ¶m_weight ) ) { - llwarns << "Bad Wearable asset: bad parameter, #" << i << llendl; + LL_WARNS() << "Bad Wearable asset: bad parameter, #" << i << LL_ENDL; return LLWearable::FAILURE; } mSavedVisualParamMap[param_id] = param_weight; @@ -384,20 +401,20 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, // textures header if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading textures header" << i << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading textures header" << i << LL_ENDL; return LLWearable::FAILURE; } S32 num_textures = -1; if ( 1 != sscanf( buffer, "textures %d\n", &num_textures) ) { - llwarns << "Bad Wearable asset: missing textures block" << llendl; + LL_WARNS() << "Bad Wearable asset: missing textures block" << LL_ENDL; return LLWearable::FAILURE; } if ( num_textures > MAX_WEARABLE_ASSET_TEXTURES ) { - llwarns << "Bad Wearable asset: too many textures, " - << num_textures << llendl; + LL_WARNS() << "Bad Wearable asset: too many textures, " + << num_textures << LL_ENDL; return LLWearable::FAILURE; } @@ -406,8 +423,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, { if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE)) { - llwarns << "Bad Wearable asset: early end of input stream " - << "while reading textures #" << i << llendl; + LL_WARNS() << "Bad Wearable asset: early end of input stream " + << "while reading textures #" << i << LL_ENDL; return LLWearable::FAILURE; } S32 te = 0; @@ -416,14 +433,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, "%d %36s\n", &te, uuid_buffer) ) { - llwarns << "Bad Wearable asset: bad texture, #" << i << llendl; + LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL; return LLWearable::FAILURE; } if( !LLUUID::validate( uuid_buffer ) ) { - llwarns << "Bad Wearable asset: bad texture uuid: " - << uuid_buffer << llendl; + LL_WARNS() << "Bad Wearable asset: bad texture uuid: " + << uuid_buffer << LL_ENDL; return LLWearable::FAILURE; } LLUUID id = LLUUID(uuid_buffer); @@ -626,17 +643,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst) void LLWearable::destroyTextures() { - for( te_map_t::iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter ) - { - LLLocalTextureObject *lto = iter->second; - delete lto; - } + std::for_each(mTEMap.begin(), mTEMap.end(), DeletePairedPointer()); mTEMap.clear(); - for( te_map_t::iterator iter = mSavedTEMap.begin(); iter != mSavedTEMap.end(); ++iter ) - { - LLLocalTextureObject *lto = iter->second; - delete lto; - } + + std::for_each(mSavedTEMap.begin(), mSavedTEMap.end(), DeletePairedPointer()); mSavedTEMap.clear(); } @@ -653,7 +663,7 @@ void LLWearable::addVisualParam(LLVisualParam *param) } -void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake) +void LLWearable::setVisualParamWeight(S32 param_index, F32 value, bool upload_bake) { if( is_in_map(mVisualParamIndexMap, param_index ) ) { @@ -662,7 +672,7 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_ba } else { - llerrs << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl; + LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; } } @@ -675,7 +685,7 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const } else { - llwarns << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl; + LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; } return (F32)-1.0; } @@ -700,7 +710,7 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) } } -void LLWearable::animateParams(F32 delta, BOOL upload_bake) +void LLWearable::animateParams(F32 delta, bool upload_bake) { for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); @@ -725,7 +735,7 @@ LLColor4 LLWearable::getClothesColor(S32 te) const return color; } -void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake ) +void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake ) { U32 param_name[3]; if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) ) diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index a944a16fd..3ffcc7516 100644 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -28,20 +28,17 @@ #define LL_LLWEARABLE_H #include "llavatarappearancedefines.h" -#include "llextendedstatus.h" #include "llpermissions.h" #include "llsaleinfo.h" #include "llsortedvector.h" #include "llwearabletype.h" -#include "lllocaltextureobject.h" -class LLAPRFile; class LLMD5; class LLVisualParam; class LLTexGlobalColorInfo; class LLTexGlobalColor; +class LLLocalTextureObject; class LLAvatarAppearance; -class AIArchetype; // Abstract class. class LLWearable @@ -99,14 +96,14 @@ public: void setLocalTextureObject(S32 index, LLLocalTextureObject <o); void addVisualParam(LLVisualParam *param); - void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake); + void setVisualParamWeight(S32 index, F32 value, bool upload_bake = false); F32 getVisualParamWeight(S32 index) const; LLVisualParam* getVisualParam(S32 index) const; void getVisualParams(visual_param_vec_t &list); - void animateParams(F32 delta, BOOL upload_bake); + void animateParams(F32 delta, bool upload_bake = false); LLColor4 getClothesColor(S32 te) const; - void setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake ); + void setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake = false); virtual void revertValues(); virtual void saveValues(); @@ -117,6 +114,9 @@ public: // Update the baked texture hash. virtual void addToBakedTextureHash(LLMD5& hash) const = 0; + typedef LLSortedVector visual_param_index_map_t; + visual_param_index_map_t mVisualParamIndexMap; + protected: typedef std::map te_map_t; void syncImages(te_map_t &src, te_map_t &dst); @@ -136,9 +136,6 @@ protected: typedef std::map param_map_t; param_map_t mSavedVisualParamMap; // last saved version of visual params - typedef LLSortedVector visual_param_index_map_t; - visual_param_index_map_t mVisualParamIndexMap; - te_map_t mTEMap; // maps TE to LocalTextureObject te_map_t mSavedTEMap; // last saved version of TEMap }; diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index 61b45a94d..25c0883b5 100644 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -73,17 +73,17 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL pushWearable(type,wearable); return; } - + wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) { - llwarns << "invalid type, type " << type << " index " << index << llendl; + LL_WARNS() << "invalid type, type " << type << " index " << index << LL_ENDL; return; } wearableentry_vec_t& wearable_vec = wearable_iter->second; if (index>=wearable_vec.size()) { - llwarns << "invalid index, type " << type << " index " << index << llendl; + LL_WARNS() << "invalid index, type " << type << " index " << index << LL_ENDL; } else { @@ -101,7 +101,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, if (wearable == NULL) { // no null wearables please! - llwarns << "Null wearable sent for type " << type << llendl; + LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL; return MAX_CLOTHING_PER_TYPE; } // [RLVa:KB] - Checked: 2010-06-08 (RLVa-1.2.0g) | Added: RLVa-1.2.0g @@ -140,13 +140,6 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed) { wearable->setUpdated(); - // FIXME DRANO avoid updating params via wearables when rendering server-baked appearance. -#if 0 - if (mAvatarAppearance->isUsingServerBakes() && !mAvatarAppearance->isUsingLocalAppearance()) - { - return; - } -#endif if (!removed) { pullCrossWearableValues(wearable->getType()); @@ -243,7 +236,7 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) { - llwarns << "tried to get wearable index with an invalid type!" << llendl; + LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL; return MAX_CLOTHING_PER_TYPE; } const wearableentry_vec_t& wearable_vec = wearable_iter->second; diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 596486123..8ad8b09bd 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llwearabletype.h" #include "llinventorytype.h" +#include "llinventorydefines.h" static LLTranslationBridge* sTrans = NULL; @@ -180,3 +181,9 @@ BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type) return entry->mAllowMultiwear; } +// static +LLWearableType::EType LLWearableType::inventoryFlagsToWearableType(U32 flags) +{ + return (LLWearableType::EType)(flags & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK); +} + diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 8434a4fd8..26c9fc230 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -35,7 +35,9 @@ class LLTranslationBridge { public: - virtual ~LLTranslationBridge(){}; + // clang needs this to be happy + virtual ~LLTranslationBridge() {} + virtual std::string getString(const std::string &xml_desc) = 0; }; @@ -81,6 +83,7 @@ public: static LLInventoryType::EIconName getIconName(EType type); static BOOL getDisableCameraSwitch(EType type); static BOOL getAllowMultiwear(EType type); + static EType inventoryFlagsToWearableType(U32 flags); protected: LLWearableType() {} diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 92a0b27e9..18635737b 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -142,7 +142,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence) origin = -1; break; default: - llerrs << "Invalid whence argument to vfs_seek" << llendl; + LL_ERRS() << "Invalid whence argument to vfs_seek" << LL_ENDL; return -1; } @@ -196,12 +196,12 @@ BOOL LLVorbisDecodeState::initDecode() vfs_callbacks.close_func = vfs_close; vfs_callbacks.tell_func = vfs_tell; - //llinfos << "Initing decode from vfile: " << mUUID << llendl; + //LL_INFOS() << "Initing decode from vfile: " << mUUID << LL_ENDL; mInFilep = new LLVFile(gVFS, mUUID, LLAssetType::AT_SOUND); if (!mInFilep || !mInFilep->getSize()) { - llwarns << "unable to open vorbis source vfile for reading" << llendl; + LL_WARNS() << "unable to open vorbis source vfile for reading" << LL_ENDL; delete mInFilep; mInFilep = NULL; return FALSE; @@ -210,7 +210,7 @@ BOOL LLVorbisDecodeState::initDecode() int r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks); if(r < 0) { - llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << llendl; + LL_WARNS() << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL; return(FALSE); } @@ -228,20 +228,20 @@ BOOL LLVorbisDecodeState::initDecode() if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS ) { abort_decode = true; - llwarns << "Bad channel count: " << vi->channels << llendl; + LL_WARNS() << "Bad channel count: " << vi->channels << LL_ENDL; } } else // !vi { abort_decode = true; - llwarns << "No default bitstream found" << llendl; + LL_WARNS() << "No default bitstream found" << LL_ENDL; } // // This magic value is equivalent to 150MiB of data. // Prevents griefers from utilizing a huge xbox sound the size of god to instafry the viewer if(size_guess >= 157286400) { - llwarns << "Bad sound caught by zmagic" << llendl; + LL_WARNS() << "Bad sound caught by zmagic" << LL_ENDL; abort_decode = true; } else if(!gAudiop->getAllowLargeSounds()) @@ -252,25 +252,25 @@ BOOL LLVorbisDecodeState::initDecode() (size_t)sample_count <= 0) { abort_decode = true; - llwarns << "Illegal sample count: " << sample_count << llendl; + LL_WARNS() << "Illegal sample count: " << sample_count << LL_ENDL; } if( size_guess > LLVORBIS_CLIP_REJECT_SIZE || size_guess < 0) { abort_decode = true; - llwarns << "Illegal sample size: " << size_guess << llendl; + LL_WARNS() << "Illegal sample size: " << size_guess << LL_ENDL; } // } // if( abort_decode ) { - llwarns << "Canceling initDecode. Bad asset: " << mUUID << llendl; + LL_WARNS() << "Canceling initDecode. Bad asset: " << mUUID << LL_ENDL; vorbis_comment* comment = ov_comment(&mVF,-1); if (comment && comment->vendor) { - llwarns << "Bad asset encoded by: " << comment->vendor << llendl; + LL_WARNS() << "Bad asset encoded by: " << comment->vendor << LL_ENDL; } delete mInFilep; mInFilep = NULL; @@ -287,7 +287,7 @@ BOOL LLVorbisDecodeState::initDecode() } catch(std::bad_alloc) { - llwarns << "bad_alloc" << llendl; + LL_WARNS() << "bad_alloc" << LL_ENDL; if(mInFilep) { delete mInFilep; @@ -388,12 +388,12 @@ BOOL LLVorbisDecodeState::decodeSection() { if (!mInFilep) { - llwarns << "No VFS file to decode in vorbis!" << llendl; + LL_WARNS() << "No VFS file to decode in vorbis!" << LL_ENDL; return TRUE; } if (mDone) { -// llwarns << "Already done with decode, aborting!" << llendl; +// LL_WARNS() << "Already done with decode, aborting!" << LL_ENDL; return TRUE; } char pcmout[4096]; /*Flawfinder: ignore*/ @@ -406,14 +406,14 @@ BOOL LLVorbisDecodeState::decodeSection() eof = TRUE; mDone = TRUE; mValid = TRUE; -// llinfos << "Vorbis EOF" << llendl; +// LL_INFOS() << "Vorbis EOF" << LL_ENDL; } else if (ret < 0) { /* error in the stream. Not a problem, just reporting it in case we (the app) cares. In this case, we don't. */ - llwarns << "BAD vorbis decode in decodeSection." << llendl; + LL_WARNS() << "BAD vorbis decode in decodeSection." << LL_ENDL; mValid = FALSE; mDone = TRUE; @@ -422,7 +422,7 @@ BOOL LLVorbisDecodeState::decodeSection() } else { -// llinfos << "Vorbis read " << ret << "bytes" << llendl; +// LL_INFOS() << "Vorbis read " << ret << "bytes" << LL_ENDL; /* we don't bother dealing with sample rate changes, etc, but. you'll have to*/ std::copy(pcmout, pcmout+ret, std::back_inserter(mWAVBuffer)); @@ -434,7 +434,7 @@ BOOL LLVorbisDecodeState::finishDecode() { if (!isValid()) { - llwarns << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << llendl; + LL_WARNS() << "Bogus vorbis decode state for " << getUUID() << ", aborting!" << LL_ENDL; return TRUE; // We've finished } @@ -515,7 +515,7 @@ BOOL LLVorbisDecodeState::finishDecode() if (36 == data_length) { - llwarns << "BAD Vorbis decode in finishDecode!" << llendl; + LL_WARNS() << "BAD Vorbis decode in finishDecode!" << LL_ENDL; mValid = FALSE; return TRUE; // we've finished } @@ -532,7 +532,7 @@ BOOL LLVorbisDecodeState::finishDecode() { if (mBytesRead == 0) { - llwarns << "Unable to write file in LLVorbisDecodeState::finishDecode" << llendl; + LL_WARNS() << "Unable to write file in LLVorbisDecodeState::finishDecode" << LL_ENDL; mValid = FALSE; return TRUE; // we've finished } @@ -550,7 +550,7 @@ BOOL LLVorbisDecodeState::finishDecode() LLVFile output(gVFS, mUUID, LLAssetType::AT_SOUND_WAV); output.write(&mWAVBuffer[0], mWAVBuffer.size()); #endif - //llinfos << "Finished decode for " << getUUID() << llendl; + //LL_INFOS() << "Finished decode for " << getUUID() << LL_ENDL; return TRUE; } @@ -559,7 +559,7 @@ void LLVorbisDecodeState::flushBadFile() { if (mInFilep) { - llwarns << "Flushing bad vorbis file from VFS for " << mUUID << llendl; + LL_WARNS() << "Flushing bad vorbis file from VFS for " << mUUID << LL_ENDL; mInFilep->remove(); } } @@ -603,12 +603,12 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) { // decodeSection does all of the work above } - /* */ }catch(std::bad_alloc){llerrs<<"bad_alloc whilst decoding"< */ + /* */ }catch(std::bad_alloc){LL_ERRS() << "bad_alloc whilst decoding" << LL_ENDL;} /* */ if (mCurrentDecodep->isDone() && !mCurrentDecodep->isValid()) { // We had an error when decoding, abort. - llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl; + LL_WARNS() << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << LL_ENDL; mCurrentDecodep->flushBadFile(); LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID()); if(adp) @@ -632,7 +632,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID()); if (!adp) { - llwarns << "Missing LLAudioData for decode of " << mCurrentDecodep->getUUID() << llendl; + LL_WARNS() << "Missing LLAudioData for decode of " << mCurrentDecodep->getUUID() << LL_ENDL; } else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone()) { @@ -640,12 +640,12 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) // At this point, we could see if anyone needs this sound immediately, but // I'm not sure that there's a reason to - we need to poll all of the playing // sounds anyway. - //llinfos << "Finished the vorbis decode, now what?" << llendl; + //LL_INFOS() << "Finished the vorbis decode, now what?" << LL_ENDL; } else { adp->setLoadState(LLAudioData::STATE_LOAD_ERROR); - llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl; + LL_INFOS() << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << LL_ENDL; } mCurrentDecodep = NULL; } @@ -670,7 +670,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs) continue; } - lldebugs << "Decoding " << uuid << " from audio queue!" << llendl; + LL_DEBUGS() << "Decoding " << uuid << " from audio queue!" << LL_ENDL; std::string uuid_str; std::string d_path; diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index ffcf0b590..0911cea3b 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -65,33 +65,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata) if(!alutInit(NULL, NULL)) { - llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; return false; } - llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl; + LL_INFOS() << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL; - llinfos << "OpenAL version: " - << ll_safe_string(alGetString(AL_VERSION)) << llendl; - llinfos << "OpenAL vendor: " - << ll_safe_string(alGetString(AL_VENDOR)) << llendl; - llinfos << "OpenAL renderer: " - << ll_safe_string(alGetString(AL_RENDERER)) << llendl; + LL_INFOS() << "OpenAL version: " + << ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL; + LL_INFOS() << "OpenAL vendor: " + << ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL; + LL_INFOS() << "OpenAL renderer: " + << ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL; ALint major = alutGetMajorVersion (); ALint minor = alutGetMinorVersion (); - llinfos << "ALUT version: " << major << "." << minor << llendl; + LL_INFOS() << "ALUT version: " << major << "." << minor << LL_ENDL; ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); - llinfos << "ALC version: " << major << "." << minor << llendl; + LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL; - llinfos << "ALC default device: " + LL_INFOS() << "ALC default device: " << ll_safe_string(alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER)) - << llendl; + << LL_ENDL; return true; } @@ -131,24 +131,24 @@ void LLAudioEngine_OpenAL::allocateListener() mListenerp = (LLListener *) new LLListener_OpenAL(); if(!mListenerp) { - llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL; } } // virtual void LLAudioEngine_OpenAL::shutdown() { - llinfos << "About to LLAudioEngine::shutdown()" << llendl; + LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL; LLAudioEngine::shutdown(); - llinfos << "About to alutExit()" << llendl; + LL_INFOS() << "About to alutExit()" << LL_ENDL; if(!alutExit()) { - llwarns << "Nuts." << llendl; - llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl; + LL_WARNS() << "Nuts." << LL_ENDL; + LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL; } - llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl; + LL_INFOS() << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL; delete mListenerp; mListenerp = NULL; @@ -166,7 +166,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel() void LLAudioEngine_OpenAL::setInternalGain(F32 gain) { - //llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl; + //LL_INFOS() << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL; alListenerf(AL_GAIN, gain); } @@ -196,7 +196,7 @@ void LLAudioChannelOpenAL::play() { if (mALSource == AL_NONE) { - llwarns << "Playing without a mALSource, aborting" << llendl; + LL_WARNS() << "Playing without a mALSource, aborting" << LL_ENDL; return; } @@ -223,8 +223,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp) alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET, &master_offset); - llinfos << "Syncing with master at " << master_offset - << "sec" << llendl; + LL_INFOS() << "Syncing with master at " << master_offset + << "sec" << LL_ENDL; // *TODO: detect when this fails, maybe use AL_SAMPLE_ alSourcef(mALSource, AL_SEC_OFFSET, master_offset); } @@ -351,18 +351,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename) ALenum error = alutGetError(); if (gDirUtilp->fileExists(filename)) { - llwarns << + LL_WARNS() << "LLAudioBufferOpenAL::loadWAV() Error loading " << filename - << " " << alutGetErrorString(error) << llendl; + << " " << alutGetErrorString(error) << LL_ENDL; } else { // It's common for the file to not actually exist. - lldebugs << + LL_DEBUGS() << "LLAudioBufferOpenAL::loadWAV() Error loading " << filename - << " " << alutGetErrorString(error) << llendl; + << " " << alutGetErrorString(error) << LL_ENDL; } return false; } @@ -386,7 +386,7 @@ U32 LLAudioBufferOpenAL::getLength() bool LLAudioEngine_OpenAL::initWind() { ALenum error; - llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl; + LL_INFOS() << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL; mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS; @@ -396,7 +396,7 @@ bool LLAudioEngine_OpenAL::initWind() if((error=alGetError()) != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<; @@ -409,18 +409,18 @@ bool LLAudioEngine_OpenAL::initWind() if(mWindBuf==NULL) { - llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl; + LL_ERRS() << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL; return false; } - llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl; + LL_INFOS() << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL; return true; } void LLAudioEngine_OpenAL::cleanupWind() { - llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl; + LL_INFOS() << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL; if (mWindSource != AL_NONE) { @@ -497,7 +497,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed); mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0); - //llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl; + //LL_INFOS() << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL; //delete the old wind buffers buffers = new ALuint[processed]; @@ -506,7 +506,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) error = alGetError(); if(error != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL; } else { @@ -523,7 +523,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) alGenBuffers(mNumEmptyWindALBuffers,&buffers[0]); if((error=alGetError()) != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << LL_ENDL; //break; } @@ -540,7 +540,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) error = alGetError(); if(error != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL; errors++; } } @@ -550,7 +550,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) error = alGetError(); if(error != AL_NO_ERROR) { - llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl; + LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL; } mNumEmptyWindALBuffers = errors; @@ -566,7 +566,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude) { alSourcePlay(mWindSource); - lldebugs << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl; + LL_DEBUGS() << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL; } } diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp index 7c8fd852f..462484e33 100644 --- a/indra/llaudio/lllistener_openal.cpp +++ b/indra/llaudio/lllistener_openal.cpp @@ -48,13 +48,13 @@ void LLListener_OpenAL::init() void LLListener_OpenAL::translate(LLVector3 offset) { - //llinfos << "LLListener_OpenAL::translate() : " << offset << llendl; + //LL_INFOS() << "LLListener_OpenAL::translate() : " << offset << LL_ENDL; LLListener::translate(offset); } void LLListener_OpenAL::setPosition(LLVector3 pos) { - //llinfos << "LLListener_OpenAL::setPosition() : " << pos << llendl; + //LL_INFOS() << "LLListener_OpenAL::setPosition() : " << pos << LL_ENDL; LLListener::setPosition(pos); } @@ -65,7 +65,7 @@ void LLListener_OpenAL::setVelocity(LLVector3 vel) void LLListener_OpenAL::orient(LLVector3 up, LLVector3 at) { - //llinfos << "LLListener_OpenAL::orient() up: " << up << " at: " << at << llendl; + //LL_INFOS() << "LLListener_OpenAL::orient() up: " << up << " at: " << at << LL_ENDL; LLListener::orient(up, at); } @@ -91,7 +91,7 @@ void LLListener_OpenAL::commitDeferredChanges() void LLListener_OpenAL::setDopplerFactor(F32 factor) { - //llinfos << "LLListener_OpenAL::setDopplerFactor() : " << factor << llendl; + //LL_INFOS() << "LLListener_OpenAL::setDopplerFactor() : " << factor << LL_ENDL; alDopplerFactor(factor); } @@ -99,7 +99,7 @@ F32 LLListener_OpenAL::getDopplerFactor() { ALfloat factor; factor = alGetFloat(AL_DOPPLER_FACTOR); - //llinfos << "LLListener_OpenAL::getDopplerFactor() : " << factor << llendl; + //LL_INFOS() << "LLListener_OpenAL::getDopplerFactor() : " << factor << LL_ENDL; return factor; } diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp index 0716e09d5..e5066a417 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.cpp +++ b/indra/llaudio/llstreamingaudio_fmodex.cpp @@ -114,7 +114,7 @@ void LLStreamingAudio_FMODEX::start(const std::string& url) { //if (!mInited) //{ - // llwarns << "startInternetStream before audio initialized" << llendl; + // LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL; // return; //} @@ -125,20 +125,20 @@ void LLStreamingAudio_FMODEX::start(const std::string& url) { if(mDeadStreams.empty()) { - llinfos << "Starting internet stream: " << url << llendl; + LL_INFOS() << "Starting internet stream: " << url << LL_ENDL; mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,url); mURL = url; mMetaData = new LLSD; } else { - llinfos << "Deferring stream load until buffer release: " << url << llendl; + LL_INFOS() << "Deferring stream load until buffer release: " << url << LL_ENDL; mPendingURL = url; } } else { - llinfos << "Set internet stream to null" << llendl; + LL_INFOS() << "Set internet stream to null" << LL_ENDL; mURL.clear(); } } @@ -194,7 +194,7 @@ void LLStreamingAudio_FMODEX::update() if(!mPendingURL.empty()) { llassert_always(mCurrentInternetStreamp == NULL); - llinfos << "Starting internet stream: " << mPendingURL << llendl; + LL_INFOS() << "Starting internet stream: " << mPendingURL << LL_ENDL; mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,mPendingURL); mURL = mPendingURL; mMetaData = new LLSD; @@ -265,7 +265,7 @@ void LLStreamingAudio_FMODEX::update() case(FMOD_TAGTYPE_FMOD): if (!LLStringUtil::compareInsensitive(name, "Sample Rate Change")) { - llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl; + LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL; Check_FMOD_Error(mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data)), "FMOD::Channel::setFrequency"); } continue; @@ -280,11 +280,11 @@ void LLStreamingAudio_FMODEX::update() { case(FMOD_TAGDATATYPE_INT): (*mMetaData)[name]=*(LLSD::Integer*)(tag.data); - llinfos << tag.name << ": " << *(int*)(tag.data) << llendl; + LL_INFOS() << tag.name << ": " << *(int*)(tag.data) << LL_ENDL; break; case(FMOD_TAGDATATYPE_FLOAT): (*mMetaData)[name]=*(LLSD::Float*)(tag.data); - llinfos << tag.name << ": " << *(float*)(tag.data) << llendl; + LL_INFOS() << tag.name << ": " << *(float*)(tag.data) << LL_ENDL; break; case(FMOD_TAGDATATYPE_STRING): { @@ -292,7 +292,7 @@ void LLStreamingAudio_FMODEX::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name]=out; - llinfos << tag.name << "(RAW): " << out << llendl; + LL_INFOS() << tag.name << "(RAW): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF8) : @@ -304,7 +304,7 @@ void LLStreamingAudio_FMODEX::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF8): " << out << llendl; + LL_INFOS() << tag.name << "(UTF8): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF16): @@ -313,7 +313,7 @@ void LLStreamingAudio_FMODEX::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF16): " << out << llendl; + LL_INFOS() << tag.name << "(UTF16): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF16BE): @@ -322,7 +322,7 @@ void LLStreamingAudio_FMODEX::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF16BE): " << out << llendl; + LL_INFOS() << tag.name << "(UTF16BE): " << out << LL_ENDL; } default: break; @@ -334,9 +334,9 @@ void LLStreamingAudio_FMODEX::update() bool paused = false; if (mFMODInternetStreamChannelp->getPaused(&paused) == FMOD_OK && !paused) { - llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl; - llinfos << " (diskbusy="<setPaused(true), "FMOD::Channel::setPaused"); } } @@ -366,14 +366,14 @@ void LLStreamingAudio_FMODEX::stop() if (mCurrentInternetStreamp) { - llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl; + LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL; if (mCurrentInternetStreamp->stopStream()) { delete mCurrentInternetStreamp; } else { - llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl; + LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL; mDeadStreams.push_back(mCurrentInternetStreamp); } mCurrentInternetStreamp = NULL; @@ -492,9 +492,9 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con if (result!= FMOD_OK) { - llwarns << "Couldn't open fmod stream, error " + LL_WARNS() << "Couldn't open fmod stream, error " << FMOD_ErrorString(result) - << llendl; + << LL_ENDL; mReady = false; return; } @@ -508,7 +508,7 @@ FMOD::Channel *LLAudioStreamManagerFMODEX::startStream() FMOD_OPENSTATE open_state; if (getOpenState(open_state) != FMOD_OK || open_state != FMOD_OPENSTATE_READY) { - llwarns << "No internet stream to start playing!" << llendl; + LL_WARNS() << "No internet stream to start playing!" << LL_ENDL; return NULL; } @@ -582,7 +582,7 @@ bool LLStreamingAudio_FMODEX::releaseDeadStreams() LLAudioStreamManagerFMODEX *streamp = *iter; if (streamp->stopStream()) { - llinfos << "Closed dead stream" << llendl; + LL_INFOS() << "Closed dead stream" << LL_ENDL; delete streamp; mDeadStreams.erase(iter++); } diff --git a/indra/llaudio/llstreamingaudio_fmodstudio.cpp b/indra/llaudio/llstreamingaudio_fmodstudio.cpp index 5a530c557..2818e7248 100644 --- a/indra/llaudio/llstreamingaudio_fmodstudio.cpp +++ b/indra/llaudio/llstreamingaudio_fmodstudio.cpp @@ -173,7 +173,7 @@ void LLStreamingAudio_FMODSTUDIO::start(const std::string& url) { //if (!mInited) //{ - // llwarns << "startInternetStream before audio initialized" << llendl; + // LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL; // return; //} @@ -184,20 +184,20 @@ void LLStreamingAudio_FMODSTUDIO::start(const std::string& url) { if(mDeadStreams.empty()) { - llinfos << "Starting internet stream: " << url << llendl; + LL_INFOS() << "Starting internet stream: " << url << LL_ENDL; mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem, mStreamGroup, url); mURL = url; mMetaData = new LLSD; } else { - llinfos << "Deferring stream load until buffer release: " << url << llendl; + LL_INFOS() << "Deferring stream load until buffer release: " << url << LL_ENDL; mPendingURL = url; } } else { - llinfos << "Set internet stream to null" << llendl; + LL_INFOS() << "Set internet stream to null" << LL_ENDL; mURL.clear(); } } @@ -253,7 +253,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if(!mPendingURL.empty()) { llassert_always(mCurrentInternetStreamp == NULL); - llinfos << "Starting internet stream: " << mPendingURL << llendl; + LL_INFOS() << "Starting internet stream: " << mPendingURL << LL_ENDL; mCurrentInternetStreamp = new LLAudioStreamManagerFMODSTUDIO(mSystem,mStreamGroup, mPendingURL); mURL = mPendingURL; mMetaData = new LLSD; @@ -329,7 +329,7 @@ void LLStreamingAudio_FMODSTUDIO::update() case(FMOD_TAGTYPE_FMOD): if (!LLStringUtil::compareInsensitive(name, "Sample Rate Change")) { - llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl; + LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL; Check_FMOD_Error(mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data)), "FMOD::Channel::setFrequency"); } continue; @@ -344,11 +344,11 @@ void LLStreamingAudio_FMODSTUDIO::update() { case(FMOD_TAGDATATYPE_INT): (*mMetaData)[name]=*(LLSD::Integer*)(tag.data); - llinfos << tag.name << ": " << *(int*)(tag.data) << llendl; + LL_INFOS() << tag.name << ": " << *(int*)(tag.data) << LL_ENDL; break; case(FMOD_TAGDATATYPE_FLOAT): (*mMetaData)[name]=*(LLSD::Float*)(tag.data); - llinfos << tag.name << ": " << *(float*)(tag.data) << llendl; + LL_INFOS() << tag.name << ": " << *(float*)(tag.data) << LL_ENDL; break; case(FMOD_TAGDATATYPE_STRING): { @@ -356,7 +356,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name]=out; - llinfos << tag.name << "(RAW): " << out << llendl; + LL_INFOS() << tag.name << "(RAW): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF8) : @@ -368,7 +368,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF8): " << out << llendl; + LL_INFOS() << tag.name << "(UTF8): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF16): @@ -377,7 +377,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF16): " << out << llendl; + LL_INFOS() << tag.name << "(UTF16): " << out << LL_ENDL; } break; case(FMOD_TAGDATATYPE_STRING_UTF16BE): @@ -386,7 +386,7 @@ void LLStreamingAudio_FMODSTUDIO::update() if (out.length() && out[out.size() - 1] == 0) out.erase(out.size() - 1); (*mMetaData)[name] = out; - llinfos << tag.name << "(UTF16BE): " << out << llendl; + LL_INFOS() << tag.name << "(UTF16BE): " << out << LL_ENDL; } default: break; @@ -398,9 +398,9 @@ void LLStreamingAudio_FMODSTUDIO::update() bool paused = false; if (mFMODInternetStreamChannelp->getPaused(&paused) == FMOD_OK && !paused) { - llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl; - llinfos << " (diskbusy="<setPaused(true), "FMOD::Channel::setPaused"); } } @@ -435,14 +435,14 @@ void LLStreamingAudio_FMODSTUDIO::stop() if (mCurrentInternetStreamp) { - llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl; + LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL; if (mCurrentInternetStreamp->stopStream()) { delete mCurrentInternetStreamp; } else { - llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl; + LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL; mDeadStreams.push_back(mCurrentInternetStreamp); } mCurrentInternetStreamp = NULL; @@ -558,9 +558,9 @@ LLAudioStreamManagerFMODSTUDIO::LLAudioStreamManagerFMODSTUDIO(FMOD::System *sys if (result!= FMOD_OK) { - llwarns << "Couldn't open fmod stream, error " + LL_WARNS() << "Couldn't open fmod stream, error " << FMOD_ErrorString(result) - << llendl; + << LL_ENDL; mReady = false; return; } @@ -574,7 +574,7 @@ FMOD::Channel *LLAudioStreamManagerFMODSTUDIO::startStream() FMOD_OPENSTATE open_state; if (getOpenState(open_state) != FMOD_OK || open_state != FMOD_OPENSTATE_READY) { - llwarns << "No internet stream to start playing!" << llendl; + LL_WARNS() << "No internet stream to start playing!" << LL_ENDL; return NULL; } @@ -648,7 +648,7 @@ bool LLStreamingAudio_FMODSTUDIO::releaseDeadStreams() LLAudioStreamManagerFMODSTUDIO *streamp = *iter; if (streamp->stopStream()) { - llinfos << "Closed dead stream" << llendl; + LL_INFOS() << "Closed dead stream" << LL_ENDL; delete streamp; mDeadStreams.erase(iter++); } diff --git a/indra/llaudio/llvorbisdecode.cpp b/indra/llaudio/llvorbisdecode.cpp index 8055be96c..b1f039dcf 100644 --- a/indra/llaudio/llvorbisdecode.cpp +++ b/indra/llaudio/llvorbisdecode.cpp @@ -77,7 +77,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence) origin = -1; break; default: - llerrs << "Invalid whence argument to vfs_seek" << llendl; + LL_ERRS() << "Invalid whence argument to vfs_seek" << LL_ENDL; return -1; } @@ -124,7 +124,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) U32 data_length = 0; - llinfos << "Vorbis decode from vfile: " << in_uuid << llendl; + LL_INFOS() << "Vorbis decode from vfile: " << in_uuid << LL_ENDL; in_vfile = new LLVFile(vfs, in_uuid, LLAssetType::AT_SOUND); if (! in_vfile->getSize()) @@ -226,7 +226,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) int r = ov_open_callbacks(in_vfile, &vf, NULL, 0, vfs_callbacks); if(r < 0) { - llwarns << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << llendl; + LL_WARNS() << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << in_uuid << LL_ENDL; return(FALSE); } @@ -247,7 +247,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) if (ret == 0) { /* EOF */ eof=1; -// llinfos << "Vorbis EOF" << llendl; +// LL_INFOS() << "Vorbis EOF" << LL_ENDL; } else if (ret < 0) { /* error in the stream. Not a problem, just reporting it in case we (the app) cares. In this case, we don't. */ @@ -255,7 +255,7 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname) break; } else { -// llinfos << "Vorbis read " << ret << "bytes" << llendl; +// LL_INFOS() << "Vorbis read " << ret << "bytes" << LL_ENDL; /* we don't bother dealing with sample rate changes, etc, but. you'll have to*/ data_length += outfile.write(pcmout, ret); diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index dd301585d..c0c9d6d6b 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -127,7 +127,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro return(LLVORBISENC_CHUNK_SIZE_ERR); } -// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl; +// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL; if (!(strncmp((char *)&(wav_header[0]),"fmt ",4))) { @@ -224,7 +224,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname std::string error_msg; if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg))) { - llwarns << error_msg << ": " << in_fname << llendl; + LL_WARNS() << error_msg << ": " << in_fname << LL_ENDL; return(format_error); } @@ -237,8 +237,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname infile.open(in_fname,LL_APR_RB); if (!infile.getFileHandle()) { - llwarns << "Couldn't open temporary ogg file for writing: " << in_fname - << llendl; + LL_WARNS() << "Couldn't open temporary ogg file for writing: " << in_fname + << LL_ENDL; return(LLVORBISENC_SOURCE_OPEN_ERR); } @@ -246,8 +246,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname outfile.open(out_fname,LL_APR_WPB); if (!outfile.getFileHandle()) { - llwarns << "Couldn't open upload sound file for reading: " << in_fname - << llendl; + LL_WARNS() << "Couldn't open upload sound file for reading: " << in_fname + << LL_ENDL; return(LLVORBISENC_DEST_OPEN_ERR); } @@ -265,7 +265,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname + ((U32) wav_header[5] << 8) + wav_header[4]; -// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl; +// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL; if (!(strncmp((char *)&(wav_header[0]),"fmt ",4))) { @@ -308,8 +308,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname // vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL) || // vorbis_encode_setup_init(&vi)) { - llwarns << "unable to initialize vorbis codec at quality " << quality << llendl; - // llwarns << "unable to initialize vorbis codec at bitrate " << bitrate << llendl; + LL_WARNS() << "unable to initialize vorbis codec at quality " << quality << LL_ENDL; + // LL_WARNS() << "unable to initialize vorbis codec at bitrate " << bitrate << LL_ENDL; return(LLVORBISENC_DEST_OPEN_ERR); } @@ -498,7 +498,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname libvorbis. They're never freed or manipulated directly */ // fprintf(stderr,"Vorbis encoding: Done.\n"); - llinfos << "Vorbis encoding: Done." << llendl; + LL_INFOS() << "Vorbis encoding: Done." << LL_ENDL; #endif return(LLVORBISENC_NOERR); diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h index aa6579ac8..a44348838 100644 --- a/indra/llcharacter/llanimationstates.h +++ b/indra/llcharacter/llanimationstates.h @@ -29,7 +29,7 @@ #include -#include "string_table.h" +#include "llstringtable.h" #include "lluuid.h" //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 2249d1622..5bffb1270 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -130,14 +130,14 @@ LLQuaternion::Order bvhStringToOrder( char *str ) if (mStatus == LLBVHLoader::ST_NO_XLT_FILE) { - llwarns << "NOTE: No translation table found." << llendl; + LL_WARNS() << "NOTE: No translation table found." << LL_ENDL; return; } else { if (mStatus != LLBVHLoader::ST_OK) { - llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL; return; } } @@ -147,7 +147,7 @@ LLQuaternion::Order bvhStringToOrder( char *str ) mStatus = loadBVHFile(buffer, error_text, error_line); if (mStatus != LLBVHLoader::ST_OK) { - llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL; return; } @@ -163,10 +163,10 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error errorLine = 0; mStatus = loadTranslationTable("anim.ini"); loadStatus = mStatus; - llinfos<<"Load Status 00 : "<< loadStatus << llendl; + LL_INFOS() << "Load Status 00 : " << loadStatus << LL_ENDL; if (mStatus == E_ST_NO_XLT_FILE) { - //llwarns << "NOTE: No translation table found." << llendl; + //LL_WARNS() << "NOTE: No translation table found." << LL_ENDL; loadStatus = mStatus; return; } @@ -174,7 +174,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error { if (mStatus != E_ST_OK) { - //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + //LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL; errorLine = getLineNumber(); loadStatus = mStatus; return; @@ -187,7 +187,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error if (mStatus != E_ST_OK) { - //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl; + //LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL; loadStatus = mStatus; errorLine = getLineNumber(); return; @@ -224,7 +224,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) if (!fp) return E_ST_NO_XLT_FILE; - llinfos << "NOTE: Loading translation table: " << fileName << llendl; + LL_INFOS() << "NOTE: Loading translation table: " << fileName << LL_ENDL; //-------------------------------------------------------------------- // register file to be closed on function exit @@ -288,7 +288,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) return E_ST_NO_XLT_EMOTE; mEmoteName.assign( emote_str ); -// llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl; +// LL_INFOS() << "NOTE: Emote: " << mEmoteName.c_str() << LL_ENDL; continue; } @@ -303,7 +303,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) return E_ST_NO_XLT_PRIORITY; mPriority = priority; -// llinfos << "NOTE: Priority: " << mPriority << llendl; +// LL_INFOS() << "NOTE: Priority: " << mPriority << LL_ENDL; continue; } @@ -696,7 +696,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & if ( !strstr(line.c_str(), "HIERARCHY") ) { -// llinfos << line << llendl; +// LL_INFOS() << line << LL_ENDL; return E_ST_NO_HIER; } @@ -1043,7 +1043,7 @@ void LLBVHLoader::applyTranslations() //---------------------------------------------------------------- if ( trans.mIgnore ) { - //llinfos << "NOTE: Ignoring " << joint->mName.c_str() << llendl; + //LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL; joint->mIgnore = TRUE; continue; } @@ -1053,7 +1053,7 @@ void LLBVHLoader::applyTranslations() //---------------------------------------------------------------- if ( ! trans.mOutName.empty() ) { - //llinfos << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << llendl; + //LL_INFOS() << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << LL_ENDL; joint->mOutName = trans.mOutName; } @@ -1070,25 +1070,25 @@ void LLBVHLoader::applyTranslations() //---------------------------------------------------------------- if ( trans.mRelativePositionKey ) { -// llinfos << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << llendl; +// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL; joint->mRelativePositionKey = TRUE; } if ( trans.mRelativeRotationKey ) { -// llinfos << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << llendl; +// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL; joint->mRelativeRotationKey = TRUE; } if ( trans.mRelativePosition.magVec() > 0.0f ) { joint->mRelativePosition = trans.mRelativePosition; -// llinfos << "NOTE: Removing " << +// LL_INFOS() << "NOTE: Removing " << // joint->mRelativePosition.mV[0] << " " << // joint->mRelativePosition.mV[1] << " " << // joint->mRelativePosition.mV[2] << // " from all position keys in " << -// joint->mOutName.c_str() << llendl; +// joint->mOutName.c_str() << LL_ENDL; } //---------------------------------------------------------------- @@ -1102,9 +1102,9 @@ void LLBVHLoader::applyTranslations() //---------------------------------------------------------------- if ( ! trans.mMergeParentName.empty() ) { -// llinfos << "NOTE: Merging " << joint->mOutName.c_str() << +// LL_INFOS() << "NOTE: Merging " << joint->mOutName.c_str() << // " with parent " << -// trans.mMergeParentName.c_str() << llendl; +// trans.mMergeParentName.c_str() << LL_ENDL; joint->mMergeParentName = trans.mMergeParentName; } @@ -1113,8 +1113,8 @@ void LLBVHLoader::applyTranslations() //---------------------------------------------------------------- if ( ! trans.mMergeChildName.empty() ) { -// llinfos << "NOTE: Merging " << joint->mName.c_str() << -// " with child " << trans.mMergeChildName.c_str() << llendl; +// LL_INFOS() << "NOTE: Merging " << joint->mName.c_str() << +// " with child " << trans.mMergeChildName.c_str() << LL_ENDL; joint->mMergeChildName = trans.mMergeChildName; } @@ -1309,7 +1309,7 @@ void LLBVHLoader::optimize() // don't output joints with no motion if (!(pos_changed || rot_changed)) { - //llinfos << "Ignoring joint " << joint->mName << llendl; + //LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL; joint->mIgnore = TRUE; } } diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 2b2a193d9..1bfee5b41 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -95,7 +95,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name ) if (!joint) { - llwarns << "Failed to find joint." << llendl; + LL_WARNS() << "Failed to find joint." << LL_ENDL; } return joint; } @@ -169,7 +169,7 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id) //----------------------------------------------------------------------------- void LLCharacter::requestStopMotion( LLMotion* motion) { -// llinfos << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << llendl; +// LL_INFOS() << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << LL_ENDL; } @@ -245,14 +245,14 @@ void LLCharacter::dumpCharacter( LLJoint* joint ) // handle top level entry into recursion if (joint == NULL) { - llinfos << "DEBUG: Dumping Character @" << this << llendl; + LL_INFOS() << "DEBUG: Dumping Character @" << this << LL_ENDL; dumpCharacter( getRootJoint() ); - llinfos << "DEBUG: Done." << llendl; + LL_INFOS() << "DEBUG: Done." << LL_ENDL; return; } // print joint info - llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl; + LL_INFOS() << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << LL_ENDL; // recurse for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin(); @@ -290,7 +290,7 @@ void LLCharacter::removeAnimationData(std::string name) //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, BOOL upload_bake) +BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, bool upload_bake) { S32 index = which_param->getID(); visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); @@ -305,7 +305,7 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake) +BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake) { std::string tname(param_name); LLStringUtil::toLower(tname); @@ -316,14 +316,14 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL name_iter->second->setWeight(weight, upload_bake); return TRUE; } - llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << llendl; + LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL; return FALSE; } //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake) +BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, bool upload_bake) { visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) @@ -331,7 +331,7 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake) index_iter->second->setWeight(weight, upload_bake); return TRUE; } - llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << llendl; + LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL; return FALSE; } @@ -348,7 +348,7 @@ F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param) } else { - llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << llendl; + LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << LL_ENDL; return 0.f; } } @@ -366,7 +366,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name) { return name_iter->second->getWeight(); } - llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << llendl; + LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL; return 0.f; } @@ -382,7 +382,7 @@ F32 LLCharacter::getVisualParamWeight(S32 index) } else { - llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << llendl; + LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL; return 0.f; } } @@ -437,7 +437,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name) { return name_iter->second; } - llwarns << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << llendl; + LL_WARNS() << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << LL_ENDL; return NULL; } @@ -462,8 +462,8 @@ void LLCharacter::addSharedVisualParam(LLVisualParam *param) } else { - llwarns << "Shared visual parameter " << param->getName() << " does not already exist with ID " << - param->getID() << llendl; + LL_WARNS() << "Shared visual parameter " << param->getName() << " does not already exist with ID " << + param->getID() << LL_ENDL; } } @@ -479,8 +479,8 @@ void LLCharacter::addVisualParam(LLVisualParam *param) idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param)); if (!idxres.second) { - llwarns << "Visual parameter " << param->getName() << " already exists with same ID as " << - param->getName() << llendl; + LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " << + param->getName() << LL_ENDL; visual_param_index_map_t::iterator index_iter = idxres.first; index_iter->second = param; } @@ -502,7 +502,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param) name_iter->second = param; } } - //llinfos << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << llendl; + //LL_INFOS() << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << LL_ENDL; } //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index bfa1c0bd8..2bcd2d28d 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -35,7 +35,7 @@ #include "lljoint.h" #include "llmotioncontroller.h" #include "llvisualparam.h" -#include "string_table.h" +#include "llstringtable.h" #include "llpointer.h" #include "llthread.h" #include "llsortedvector.h" @@ -195,9 +195,9 @@ public: void addVisualParam(LLVisualParam *param); void addSharedVisualParam(LLVisualParam *param); - virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE ); - virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE ); - virtual BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE ); + virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake = false ); + virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake = false ); + virtual BOOL setVisualParamWeight(S32 index, F32 weight, bool upload_bake = false ); // get visual param weight by param or name F32 getVisualParamWeight(LLVisualParam *distortion); diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index d07f37779..8813064dd 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -89,7 +89,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte !mCharacter->getJoint("mElbowLeft") || !mCharacter->getJoint("mWristLeft")) { - llwarns << "Invalid skeleton for editing motion!" << llendl; + LL_WARNS() << "Invalid skeleton for editing motion!" << LL_ENDL; return STATUS_FAILURE; } @@ -102,7 +102,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte if ( ! mParentState->getJoint() ) { - llinfos << getName() << ": Can't get parent joint." << llendl; + LL_INFOS() << getName() << ": Can't get parent joint." << LL_ENDL; return STATUS_FAILURE; } @@ -214,22 +214,22 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) target = target * target_dist; if (!target.isFinite()) { - llwarns << "Non finite target in editing motion with target distance of " << target_dist << + LL_WARNS() << "Non finite target in editing motion with target distance of " << target_dist << " and focus point " << focus_pt << " and pointAtPt: "; if (pointAtPt) { - llcont << *pointAtPt; + LL_CONT << *pointAtPt; } else { - llcont << "NULL"; + LL_CONT << "NULL"; } - llcont << llendl; + LL_CONT << LL_ENDL; } mTarget.setPosition( target + mParentJoint.getPosition()); -// llinfos << "Point At: " << mTarget.getPosition() << llendl; +// LL_INFOS() << "Point At: " << mTarget.getPosition() << LL_ENDL; // update the ikSolver if (!mTarget.getPosition().isExactlyZero()) diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index c23694639..1549c41e6 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -93,14 +93,14 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs) BOOL LLGesture::trigger(KEY key, MASK mask) { - llwarns << "Parent class trigger called: you probably didn't mean this." << llendl; + LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL; return FALSE; } BOOL LLGesture::trigger(const std::string& trigger_string) { - llwarns << "Parent class trigger called: you probably didn't mean this." << llendl; + LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL; return FALSE; } @@ -130,7 +130,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size) if (tmp + sizeof(mKey) + sizeof(mMask) + 16 > buffer + max_size) { - llwarns << "Attempt to read past end of buffer, bad data!!!!" << llendl; + LL_WARNS() << "Attempt to read past end of buffer, bad data!!!!" << LL_ENDL; return buffer; } @@ -155,7 +155,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size) if (tmp > buffer + max_size) { - llwarns << "Read past end of buffer, bad data!!!!" << llendl; + LL_WARNS() << "Read past end of buffer, bad data!!!!" << LL_ENDL; return tmp; } @@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize() LLGestureList::LLGestureList() : mList(0) -{ - // add some gestures for debugging -// LLGesture *gesture = NULL; -/* - gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)", - SND_CHIRP, "dance2", ":-)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance", - SND_OBJECT_CREATE, "dance3", "(dances)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie", - LLUUID::null, "dance4", LLStringUtil::null ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue", - LLUUID::null, "Express_Tongue_Out", LLStringUtil::null ); - mList.put(gesture); - */ -} +{} LLGestureList::~LLGestureList() { @@ -203,12 +183,7 @@ LLGestureList::~LLGestureList() void LLGestureList::deleteAll() { - S32 count = mList.count(); - for (S32 i = 0; i < count; i++) - { - delete mList.get(i); - } - mList.reset(); + delete_and_clear(mList); } // Iterates through space delimited tokens in string, triggering any gestures found. @@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin std::string cur_token_lower = *token_iter; LLStringUtil::toLower(cur_token_lower); - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - gesture = mList.get(i); + gesture = mList.at(i); if (gesture->trigger(cur_token_lower)) { if( !gesture->getOutputString().empty() ) @@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin BOOL LLGestureList::trigger(KEY key, MASK mask) { - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - LLGesture* gesture = mList.get(i); + LLGesture* gesture = mList.at(i); if( gesture ) { if (gesture->trigger(key, mask)) @@ -298,7 +273,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) } else { - llwarns << "NULL gesture in gesture list (" << i << ")" << llendl; + LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL; } } return FALSE; @@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) U8 *LLGestureList::serialize(U8 *buffer) const { // a single S32 serves as the header that tells us how many to read - S32 count = mList.count(); + U32 count = mList.size(); htonmemcpy(buffer, &count, MVT_S32, 4); buffer += sizeof(count); @@ -331,7 +306,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size) if (tmp + sizeof(count) > buffer + max_size) { - llwarns << "Invalid max_size" << llendl; + LL_WARNS() << "Invalid max_size" << LL_ENDL; return buffer; } @@ -339,20 +314,20 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size) if (count > MAX_GESTURES) { - llwarns << "Unreasonably large gesture list count in deserialize: " << count << llendl; + LL_WARNS() << "Unreasonably large gesture list count in deserialize: " << count << LL_ENDL; return tmp; } tmp += sizeof(count); - mList.reserve_block(count); + mList.resize(count); for (S32 i = 0; i < count; i++) { mList[i] = create_gesture(&tmp, max_size - (S32)(tmp - buffer)); if (tmp - buffer > max_size) { - llwarns << "Deserialization read past end of buffer, bad data!!!!" << llendl; + LL_WARNS() << "Deserialization read past end of buffer, bad data!!!!" << LL_ENDL; return tmp; } } diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h index 66b618c47..f2a2d95b0 100644 --- a/indra/llcharacter/llgesture.h +++ b/indra/llcharacter/llgesture.h @@ -31,7 +31,6 @@ #include "llanimationstates.h" #include "lluuid.h" #include "llstring.h" -#include "lldarray.h" class LLGesture { @@ -91,9 +90,9 @@ public: BOOL triggerAndReviseString(const std::string &string, std::string* revised_string); // Used for construction from UI - S32 count() const { return mList.count(); } - virtual LLGesture* get(S32 i) const { return mList.get(i); } - virtual void put(LLGesture* gesture) { mList.put( gesture ); } + S32 count() const { return mList.size(); } + virtual LLGesture* get(S32 i) const { return mList.at(i); } + virtual void put(LLGesture* gesture) { mList.push_back( gesture ); } void deleteAll(); // non-endian-neutral serialization @@ -106,7 +105,7 @@ protected: virtual LLGesture *create_gesture(U8 **buffer, S32 max_size); protected: - LLDynamicArray mList; + std::vector mList; static const S32 SERIAL_HEADER_SIZE; }; diff --git a/indra/llcharacter/llhandmotion.cpp b/indra/llcharacter/llhandmotion.cpp index be6dbb050..793393dfa 100644 --- a/indra/llcharacter/llhandmotion.cpp +++ b/indra/llcharacter/llhandmotion.cpp @@ -192,7 +192,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) } else { - llwarns << "Requested hand pose out of range. Ignoring requested pose." << llendl; + LL_WARNS() << "Requested hand pose out of range. Ignoring requested pose." << LL_ENDL; } } @@ -200,7 +200,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) mCharacter->removeAnimationData("Hand Pose Priority"); // if (requestedHandPose) -// llinfos << "Hand Pose " << *requestedHandPose << llendl; +// LL_INFOS() << "Hand Pose " << *requestedHandPose << LL_ENDL; // if we are still blending... if (mCurrentPose != mNewPose) diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 79912f9d5..ef670f158 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -105,7 +105,7 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte { if (!character) { - llwarns << "character is NULL." << llendl; + LL_WARNS() << "character is NULL." << LL_ENDL; return STATUS_FAILURE; } mCharacter = character; @@ -113,49 +113,49 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte mPelvisJoint = character->getJoint("mPelvis"); if ( ! mPelvisJoint ) { - llinfos << getName() << ": Can't get pelvis joint." << llendl; + LL_INFOS() << getName() << ": Can't get pelvis joint." << LL_ENDL; return STATUS_FAILURE; } mRootJoint = character->getJoint("mRoot"); if ( ! mRootJoint ) { - llinfos << getName() << ": Can't get root joint." << llendl; + LL_INFOS() << getName() << ": Can't get root joint." << LL_ENDL; return STATUS_FAILURE; } mTorsoJoint = character->getJoint("mTorso"); if ( ! mTorsoJoint ) { - llinfos << getName() << ": Can't get torso joint." << llendl; + LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL; return STATUS_FAILURE; } mHeadJoint = character->getJoint("mHead"); if ( ! mHeadJoint ) { - llinfos << getName() << ": Can't get head joint." << llendl; + LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL; return STATUS_FAILURE; } mTorsoState->setJoint( character->getJoint("mTorso") ); if ( ! mTorsoState->getJoint() ) { - llinfos << getName() << ": Can't get torso joint." << llendl; + LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL; return STATUS_FAILURE; } mNeckState->setJoint( character->getJoint("mNeck") ); if ( ! mNeckState->getJoint() ) { - llinfos << getName() << ": Can't get neck joint." << llendl; + LL_INFOS() << getName() << ": Can't get neck joint." << LL_ENDL; return STATUS_FAILURE; } mHeadState->setJoint( character->getJoint("mHead") ); if ( ! mHeadState->getJoint() ) { - llinfos << getName() << ": Can't get head joint." << llendl; + LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL; return STATUS_FAILURE; } @@ -190,7 +190,7 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) { LLVector3 headLookAt = *targetPos; -// llinfos << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << llendl; +// LL_INFOS() << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << LL_ENDL; F32 lookatDistance = headLookAt.normVec(); @@ -301,21 +301,21 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character) mHeadJoint = character->getJoint("mHead"); if ( ! mHeadJoint ) { - llinfos << getName() << ": Can't get head joint." << llendl; + LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL; return STATUS_FAILURE; } mLeftEyeState->setJoint( character->getJoint("mEyeLeft") ); if ( ! mLeftEyeState->getJoint() ) { - llinfos << getName() << ": Can't get left eyeball joint." << llendl; + LL_INFOS() << getName() << ": Can't get left eyeball joint." << LL_ENDL; return STATUS_FAILURE; } mRightEyeState->setJoint( character->getJoint("mEyeRight") ); if ( ! mRightEyeState->getJoint() ) { - llinfos << getName() << ": Can't get Right eyeball joint." << llendl; + LL_INFOS() << getName() << ": Can't get Right eyeball joint." << LL_ENDL; return STATUS_FAILURE; } diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index e8bf2b0c5..0175a2fe4 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -434,7 +434,7 @@ const LLMatrix4a &LLJoint::getWorldMatrix() //-------------------------------------------------------------------- void LLJoint::setWorldMatrix( const LLMatrix4& mat ) { -llinfos << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << llendl; +LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL; // extract global translation LLVector3 trans( mat.mMatrix[VW][VX], mat.mMatrix[VW][VY], diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 8ce737afb..2e0fda3ad 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -141,8 +141,8 @@ void LLJointSolverRP3::setTwist( F32 twist ) //----------------------------------------------------------------------------- void LLJointSolverRP3::solve() { -// llinfos << llendl; -// llinfos << "LLJointSolverRP3::solve()" << llendl; +// LL_INFOS() << LL_ENDL; +// LL_INFOS() << "LLJointSolverRP3::solve()" << LL_ENDL; //------------------------------------------------------------------------- // setup joints in their base rotations @@ -158,15 +158,15 @@ void LLJointSolverRP3::solve() LLVector3 cPos = mJointC->getWorldPosition(); LLVector3 gPos = mJointGoal->getWorldPosition(); -// llinfos << "bPosLocal = " << mJointB->getPosition() << llendl; -// llinfos << "cPosLocal = " << mJointC->getPosition() << llendl; -// llinfos << "bRotLocal = " << mJointB->getRotation() << llendl; -// llinfos << "cRotLocal = " << mJointC->getRotation() << llendl; +// LL_INFOS() << "bPosLocal = " << mJointB->getPosition() << LL_ENDL; +// LL_INFOS() << "cPosLocal = " << mJointC->getPosition() << LL_ENDL; +// LL_INFOS() << "bRotLocal = " << mJointB->getRotation() << LL_ENDL; +// LL_INFOS() << "cRotLocal = " << mJointC->getRotation() << LL_ENDL; -// llinfos << "aPos : " << aPos << llendl; -// llinfos << "bPos : " << bPos << llendl; -// llinfos << "cPos : " << cPos << llendl; -// llinfos << "gPos : " << gPos << llendl; +// LL_INFOS() << "aPos : " << aPos << LL_ENDL; +// LL_INFOS() << "bPos : " << bPos << LL_ENDL; +// LL_INFOS() << "cPos : " << cPos << LL_ENDL; +// LL_INFOS() << "gPos : " << gPos << LL_ENDL; //------------------------------------------------------------------------- // get the poleVector in world space @@ -192,10 +192,10 @@ void LLJointSolverRP3::solve() LLVector3 acVec = cPos - aPos; LLVector3 agVec = gPos - aPos; -// llinfos << "abVec : " << abVec << llendl; -// llinfos << "bcVec : " << bcVec << llendl; -// llinfos << "acVec : " << acVec << llendl; -// llinfos << "agVec : " << agVec << llendl; +// LL_INFOS() << "abVec : " << abVec << LL_ENDL; +// LL_INFOS() << "bcVec : " << bcVec << LL_ENDL; +// LL_INFOS() << "acVec : " << acVec << LL_ENDL; +// LL_INFOS() << "agVec : " << agVec << LL_ENDL; //------------------------------------------------------------------------- // compute needed lengths of those vectors @@ -204,16 +204,16 @@ void LLJointSolverRP3::solve() F32 bcLen = bcVec.magVec(); F32 agLen = agVec.magVec(); -// llinfos << "abLen : " << abLen << llendl; -// llinfos << "bcLen : " << bcLen << llendl; -// llinfos << "agLen : " << agLen << llendl; +// LL_INFOS() << "abLen : " << abLen << LL_ENDL; +// LL_INFOS() << "bcLen : " << bcLen << LL_ENDL; +// LL_INFOS() << "agLen : " << agLen << LL_ENDL; //------------------------------------------------------------------------- // compute component vector of (A->B) orthogonal to (A->C) //------------------------------------------------------------------------- LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec)); -// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl; +// LL_INFOS() << "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL; //------------------------------------------------------------------------- // compute the normal of the original ABC plane (and store for later) @@ -281,13 +281,13 @@ void LLJointSolverRP3::solve() LLQuaternion bRot(theta - abbcAng, abbcOrthoVec); -// llinfos << "abbcAng : " << abbcAng << llendl; -// llinfos << "abbcOrthoVec : " << abbcOrthoVec << llendl; -// llinfos << "agLenSq : " << agLenSq << llendl; -// llinfos << "cosTheta : " << cosTheta << llendl; -// llinfos << "theta : " << theta << llendl; -// llinfos << "bRot : " << bRot << llendl; -// llinfos << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << llendl; +// LL_INFOS() << "abbcAng : " << abbcAng << LL_ENDL; +// LL_INFOS() << "abbcOrthoVec : " << abbcOrthoVec << LL_ENDL; +// LL_INFOS() << "agLenSq : " << agLenSq << LL_ENDL; +// LL_INFOS() << "cosTheta : " << cosTheta << LL_ENDL; +// LL_INFOS() << "theta : " << theta << LL_ENDL; +// LL_INFOS() << "bRot : " << bRot << LL_ENDL; +// LL_INFOS() << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << LL_ENDL; //------------------------------------------------------------------------- // compute rotation that rotates new A->C to A->G @@ -301,9 +301,9 @@ void LLJointSolverRP3::solve() LLQuaternion cgRot; cgRot.shortestArc( acVec, agVec ); -// llinfos << "bcVec : " << bcVec << llendl; -// llinfos << "acVec : " << acVec << llendl; -// llinfos << "cgRot : " << cgRot << llendl; +// LL_INFOS() << "bcVec : " << bcVec << LL_ENDL; +// LL_INFOS() << "acVec : " << acVec << LL_ENDL; +// LL_INFOS() << "cgRot : " << cgRot << LL_ENDL; // update A->B and B->C with rotation from C to G abVec = abVec * cgRot; @@ -361,18 +361,18 @@ void LLJointSolverRP3::solve() pRot.shortestArc( abcNorm, apgNorm ); } -// llinfos << "abcNorm = " << abcNorm << llendl; -// llinfos << "apgNorm = " << apgNorm << llendl; -// llinfos << "pRot = " << pRot << llendl; +// LL_INFOS() << "abcNorm = " << abcNorm << LL_ENDL; +// LL_INFOS() << "apgNorm = " << apgNorm << LL_ENDL; +// LL_INFOS() << "pRot = " << pRot << LL_ENDL; //------------------------------------------------------------------------- // compute twist rotation //------------------------------------------------------------------------- LLQuaternion twistRot( mTwist, agVec ); -// llinfos << "twist : " << mTwist*180.0/F_PI << llendl; -// llinfos << "agNormVec: " << agNormVec << llendl; -// llinfos << "twistRot : " << twistRot << llendl; +// LL_INFOS() << "twist : " << mTwist*180.0/F_PI << LL_ENDL; +// LL_INFOS() << "agNormVec: " << agNormVec << LL_ENDL; +// LL_INFOS() << "twistRot : " << twistRot << LL_ENDL; //------------------------------------------------------------------------- // compute rotation of A diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index e223b329d..f1cea2f6d 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -95,14 +95,14 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const if (!silent) { - llinfos << "\tJoint " << joint_motion_p->mJointName << llendl; + LL_INFOS() << "\tJoint " << joint_motion_p->mJointName << LL_ENDL; } if (joint_motion_p->mUsage & LLJointState::SCALE) { if (!silent) { - llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at " - << joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl; + LL_INFOS() << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at " + << joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << LL_ENDL; } total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey); } @@ -110,8 +110,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const { if (!silent) { - llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at " - << joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl; + LL_INFOS() << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at " + << joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << LL_ENDL; } total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey); } @@ -119,8 +119,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const { if (!silent) { - llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at " - << joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl; + LL_INFOS() << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at " + << joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << LL_ENDL; } total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey); } @@ -130,8 +130,8 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const total_size += constraints_size; if (!silent) { - llinfos << "\t" << mConstraints.size() << " constraints at " << constraints_size << " bytes" << llendl; - llinfos << "Size: " << total_size << " bytes" << llendl; + LL_INFOS() << "\t" << mConstraints.size() << " constraints at " << constraints_size << " bytes" << LL_ENDL; + LL_INFOS() << "Size: " << total_size << " bytes" << LL_ENDL; } return total_size; @@ -482,7 +482,7 @@ LLPointer& LLKeyframeMotion::getJointState(U32 index) //llassert_always (index < (S32)mJointStates.size()); if(index >= (S32)mJointStates.size()) { - llwarns << "LLKeyframeMotion::getJointState: index >= size" << llendl; + LL_WARNS() << "LLKeyframeMotion::getJointState: index >= size" << LL_ENDL; index = (S32)mJointStates.size() - 1; } // @@ -533,7 +533,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact case ASSET_FETCHED: return STATUS_HOLD; case ASSET_FETCH_FAILED: - llwarns << "Trying to initialize a motion that failed to be fetched." << llendl; + LL_WARNS() << "Trying to initialize a motion that failed to be fetched." << LL_ENDL; return STATUS_FAILURE; case ASSET_LOADED: return STATUS_SUCCESS; @@ -585,7 +585,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact if (!sVFS) { - llerrs << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << llendl; + LL_ERRS() << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << LL_ENDL; } BOOL success = FALSE; @@ -611,18 +611,18 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact if (!success) { - llwarns << "Can't open animation file " << mID << llendl; + LL_WARNS() << "Can't open animation file " << mID << LL_ENDL; mAssetStatus = ASSET_FETCH_FAILED; return STATUS_FAILURE; } - lldebugs << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << llendl; + LL_DEBUGS() << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << LL_ENDL; LLDataPackerBinaryBuffer dp(anim_data, anim_file_size); if (!deserialize(dp)) { - llwarns << "Failed to decode asset for animation " << getName() << ":" << getID() << llendl; + LL_WARNS() << "Failed to decode asset for animation " << getName() << ":" << getID() << LL_ENDL; mAssetStatus = ASSET_FETCH_FAILED; return STATUS_FAILURE; } @@ -1150,7 +1150,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 // convert intermediate joint positions to world coordinates positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition(); F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f); -// llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; +// LL_INFOS() << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; positions[joint_num] = lerp(positions[joint_num], kinematic_position, LLCriticalDamp::getInterpolant(time_constant, FALSE)); } @@ -1181,8 +1181,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 if ((iteration_count >= MIN_ITERATION_COUNT) && (num_joints_finished == shared_data->mChainLength - 1)) { -// llinfos << iteration_count << " iterations on " << -// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; +// LL_INFOS() << iteration_count << " iterations on " << +// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; break; } } @@ -1330,13 +1330,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackU16(version, "version")) { - llwarns << "can't read version number" << llendl; + LL_WARNS() << "can't read version number" << LL_ENDL; return FALSE; } if (!dp.unpackU16(sub_version, "sub_version")) { - llwarns << "can't read sub version number" << llendl; + LL_WARNS() << "can't read sub version number" << LL_ENDL; return FALSE; } @@ -1347,16 +1347,16 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) else if (version != KEYFRAME_MOTION_VERSION || sub_version != KEYFRAME_MOTION_SUBVERSION) { #if LL_RELEASE - llwarns << "Bad animation version " << version << "." << sub_version << llendl; + LL_WARNS() << "Bad animation version " << version << "." << sub_version << LL_ENDL; return FALSE; #else - llerrs << "Bad animation version " << version << "." << sub_version << llendl; + LL_ERRS() << "Bad animation version " << version << "." << sub_version << LL_ENDL; #endif } if (!dp.unpackS32(temp_priority, "base_priority")) { - llwarns << "can't read animation base_priority" << llendl; + LL_WARNS() << "can't read animation base_priority" << LL_ENDL; return FALSE; } mJointMotionList->mBasePriority = (LLJoint::JointPriority) temp_priority; @@ -1368,7 +1368,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) } else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY) { - llwarns << "bad animation base_priority " << mJointMotionList->mBasePriority << llendl; + LL_WARNS() << "bad animation base_priority " << mJointMotionList->mBasePriority << LL_ENDL; return FALSE; } @@ -1377,14 +1377,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) //------------------------------------------------------------------------- if (!dp.unpackF32(mJointMotionList->mDuration, "duration")) { - llwarns << "can't read duration" << llendl; + LL_WARNS() << "can't read duration" << LL_ENDL; return FALSE; } if (mJointMotionList->mDuration > MAX_ANIM_DURATION || !llfinite(mJointMotionList->mDuration)) { - llwarns << "invalid animation duration" << llendl; + LL_WARNS() << "invalid animation duration" << LL_ENDL; return FALSE; } @@ -1393,13 +1393,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) //------------------------------------------------------------------------- if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name")) { - llwarns << "can't read optional_emote_animation" << llendl; + LL_WARNS() << "can't read optional_emote_animation" << LL_ENDL; return FALSE; } if(mJointMotionList->mEmoteName==mID.asString()) { - llwarns << "Malformed animation mEmoteName==mID" << llendl; + LL_WARNS() << "Malformed animation mEmoteName==mID" << LL_ENDL; return FALSE; } @@ -1409,20 +1409,20 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") || !llfinite(mJointMotionList->mLoopInPoint)) { - llwarns << "can't read loop point" << llendl; + LL_WARNS() << "can't read loop point" << LL_ENDL; return FALSE; } if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") || !llfinite(mJointMotionList->mLoopOutPoint)) { - llwarns << "can't read loop point" << llendl; + LL_WARNS() << "can't read loop point" << LL_ENDL; return FALSE; } if (!dp.unpackS32(mJointMotionList->mLoop, "loop")) { - llwarns << "can't read loop" << llendl; + LL_WARNS() << "can't read loop" << LL_ENDL; return FALSE; } @@ -1432,14 +1432,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") || !llfinite(mJointMotionList->mEaseInDuration)) { - llwarns << "can't read easeIn" << llendl; + LL_WARNS() << "can't read easeIn" << LL_ENDL; return FALSE; } if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") || !llfinite(mJointMotionList->mEaseOutDuration)) { - llwarns << "can't read easeOut" << llendl; + LL_WARNS() << "can't read easeOut" << LL_ENDL; return FALSE; } @@ -1449,13 +1449,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) U32 word; if (!dp.unpackU32(word, "hand_pose")) { - llwarns << "can't read hand pose" << llendl; + LL_WARNS() << "can't read hand pose" << LL_ENDL; return FALSE; } if(word > LLHandMotion::NUM_HAND_POSES) { - llwarns << "invalid LLHandMotion::eHandPose index: " << word << llendl; + LL_WARNS() << "invalid LLHandMotion::eHandPose index: " << word << LL_ENDL; return FALSE; } @@ -1467,18 +1467,18 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) U32 num_motions = 0; if (!dp.unpackU32(num_motions, "num_joints")) { - llwarns << "can't read number of joints" << llendl; + LL_WARNS() << "can't read number of joints" << LL_ENDL; return FALSE; } if (num_motions == 0) { - llwarns << "no joints in animation" << llendl; + LL_WARNS() << "no joints in animation" << LL_ENDL; return FALSE; } else if (num_motions > LL_CHARACTER_MAX_JOINTS) { - llwarns << "too many joints in animation" << llendl; + LL_WARNS() << "too many joints in animation" << LL_ENDL; return FALSE; } @@ -1512,13 +1512,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) std::string joint_name; if (!dp.unpackString(joint_name, "joint_name")) { - llwarns << "can't read joint name" << llendl; + LL_WARNS() << "can't read joint name" << LL_ENDL; return FALSE; } if (joint_name == "mScreen" || joint_name == "mRoot") { - llwarns << "attempted to animate special " << joint_name << " joint" << llendl; + LL_WARNS() << "attempted to animate special " << joint_name << " joint" << LL_ENDL; return FALSE; } @@ -1528,7 +1528,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) LLJoint *joint = mCharacter->getJoint( joint_name ); if (joint) { -// llinfos << " joint: " << joint_name << llendl; +// LL_INFOS() << " joint: " << joint_name << LL_ENDL; } else { @@ -1544,7 +1544,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) i++; } // - llwarns << "joint not found: " << joint_name << llendl; + LL_WARNS() << "joint not found: " << joint_name << LL_ENDL; //return FALSE; } @@ -1561,13 +1561,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) S32 joint_priority; if (!dp.unpackS32(joint_priority, "joint_priority")) { - llwarns << "can't read joint priority." << llendl; + LL_WARNS() << "can't read joint priority." << LL_ENDL; return FALSE; } if (joint_priority < LLJoint::USE_MOTION_PRIORITY) { - llwarns << "joint priority unknown - too low." << llendl; + LL_WARNS() << "joint priority unknown - too low." << LL_ENDL; return FALSE; } @@ -1585,7 +1585,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) //--------------------------------------------------------------------- if (!dp.unpackS32(joint_motion->mRotationCurve.mNumKeys, "num_rot_keys") || joint_motion->mRotationCurve.mNumKeys < 0) { - llwarns << "can't read number of rotation keys" << llendl; + LL_WARNS() << "can't read number of rotation keys" << LL_ENDL; return FALSE; } @@ -1610,7 +1610,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackF32(time, "time") || !llfinite(time)) { - llwarns << "can't read rotation key (" << k << ")" << llendl; + LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL; return FALSE; } @@ -1619,7 +1619,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) { if (!dp.unpackU16(time_short, "time")) { - llwarns << "can't read rotation key (" << k << ")" << llendl; + LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL; return FALSE; } @@ -1627,7 +1627,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (time < 0 || time > mJointMotionList->mDuration) { - llwarns << "invalid frame time" << llendl; + LL_WARNS() << "invalid frame time" << LL_ENDL; return FALSE; } } @@ -1661,13 +1661,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if( !(rot_key.mRotation.isFinite()) ) { - llwarns << "non-finite angle in rotation key" << llendl; + LL_WARNS() << "non-finite angle in rotation key" << LL_ENDL; success = FALSE; } if (!success) { - llwarns << "can't read rotation key (" << k << ")" << llendl; + LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL; return FALSE; } @@ -1679,7 +1679,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) //--------------------------------------------------------------------- if (!dp.unpackS32(joint_motion->mPositionCurve.mNumKeys, "num_pos_keys") || joint_motion->mPositionCurve.mNumKeys < 0) { - llwarns << "can't read number of position keys" << llendl; + LL_WARNS() << "can't read number of position keys" << LL_ENDL; return FALSE; } @@ -1704,7 +1704,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackF32(pos_key.mTime, "time") || !llfinite(pos_key.mTime)) { - llwarns << "can't read position key (" << k << ")" << llendl; + LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL; return FALSE; } } @@ -1712,7 +1712,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) { if (!dp.unpackU16(time_short, "time")) { - llwarns << "can't read position key (" << k << ")" << llendl; + LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL; return FALSE; } @@ -1740,13 +1740,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if( !(pos_key.mPosition.isFinite()) ) { - llwarns << "non-finite position in key" << llendl; + LL_WARNS() << "non-finite position in key" << LL_ENDL; success = FALSE; } if (!success) { - llwarns << "can't read position key (" << k << ")" << llendl; + LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL; return FALSE; } @@ -1767,13 +1767,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) S32 num_constraints = 0; if (!dp.unpackS32(num_constraints, "num_constraints")) { - llwarns << "can't read number of constraints" << llendl; + LL_WARNS() << "can't read number of constraints" << LL_ENDL; return FALSE; } if (num_constraints > MAX_CONSTRAINTS || num_constraints < 0) { - llwarns << "Bad number of constraints... ignoring: " << num_constraints << llendl; + LL_WARNS() << "Bad number of constraints... ignoring: " << num_constraints << LL_ENDL; } else { @@ -1789,7 +1789,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackU8(byte, "chain_length")) { - llwarns << "can't read constraint chain length" << llendl; + LL_WARNS() << "can't read constraint chain length" << LL_ENDL; delete constraintp; return FALSE; } @@ -1797,21 +1797,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions()) { - llwarns << "invalid constraint chain length" << llendl; + LL_WARNS() << "invalid constraint chain length" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackU8(byte, "constraint_type")) { - llwarns << "can't read constraint type" << llendl; + LL_WARNS() << "can't read constraint type" << LL_ENDL; delete constraintp; return FALSE; } if( byte >= NUM_CONSTRAINT_TYPES ) { - llwarns << "invalid constraint type" << llendl; + LL_WARNS() << "invalid constraint type" << LL_ENDL; delete constraintp; return FALSE; } @@ -1821,7 +1821,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) U8 bin_data[BIN_DATA_LENGTH+1]; if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume")) { - llwarns << "can't read source volume name" << llendl; + LL_WARNS() << "can't read source volume name" << LL_ENDL; delete constraintp; return FALSE; } @@ -1833,7 +1833,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) // if(constraintp->mSourceConstraintVolume == -1) { - llwarns << "can't get source constraint volume" << llendl; + LL_WARNS() << "can't get source constraint volume" << LL_ENDL; delete constraintp; return FALSE; } @@ -1841,21 +1841,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset")) { - llwarns << "can't read constraint source offset" << llendl; + LL_WARNS() << "can't read constraint source offset" << LL_ENDL; delete constraintp; return FALSE; } if( !(constraintp->mSourceConstraintOffset.isFinite()) ) { - llwarns << "non-finite constraint source offset" << llendl; + LL_WARNS() << "non-finite constraint source offset" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume")) { - llwarns << "can't read target volume name" << llendl; + LL_WARNS() << "can't read target volume name" << LL_ENDL; delete constraintp; return FALSE; } @@ -1875,28 +1875,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset")) { - llwarns << "can't read constraint target offset" << llendl; + LL_WARNS() << "can't read constraint target offset" << LL_ENDL; delete constraintp; return FALSE; } if( !(constraintp->mTargetConstraintOffset.isFinite()) ) { - llwarns << "non-finite constraint target offset" << llendl; + LL_WARNS() << "non-finite constraint target offset" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir")) { - llwarns << "can't read constraint target direction" << llendl; + LL_WARNS() << "can't read constraint target direction" << LL_ENDL; delete constraintp; return FALSE; } if( !(constraintp->mTargetConstraintDir.isFinite()) ) { - llwarns << "non-finite constraint target direction" << llendl; + LL_WARNS() << "non-finite constraint target direction" << LL_ENDL; delete constraintp; return FALSE; } @@ -1909,28 +1909,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !llfinite(constraintp->mEaseInStartTime)) { - llwarns << "can't read constraint ease in start time" << llendl; + LL_WARNS() << "can't read constraint ease in start time" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !llfinite(constraintp->mEaseInStopTime)) { - llwarns << "can't read constraint ease in stop time" << llendl; + LL_WARNS() << "can't read constraint ease in stop time" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !llfinite(constraintp->mEaseOutStartTime)) { - llwarns << "can't read constraint ease out start time" << llendl; + LL_WARNS() << "can't read constraint ease out start time" << LL_ENDL; delete constraintp; return FALSE; } if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !llfinite(constraintp->mEaseOutStopTime)) { - llwarns << "can't read constraint ease out stop time" << llendl; + LL_WARNS() << "can't read constraint ease out stop time" << LL_ENDL; delete constraintp; return FALSE; } @@ -1958,8 +1958,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) LLJoint* parent = joint->getParent(); if (!parent) { - llwarns << "Joint with no parent: " << joint->getName() - << " Emote: " << mJointMotionList->mEmoteName << llendl; + LL_WARNS() << "Joint with no parent: " << joint->getName() + << " Emote: " << mJointMotionList->mEmoteName << LL_ENDL; return FALSE; } joint = parent; @@ -1970,7 +1970,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if ( !constraint_joint ) { - llwarns << "Invalid joint " << j << llendl; + LL_WARNS() << "Invalid joint " << j << LL_ENDL; return FALSE; } @@ -1982,7 +1982,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) } if (constraintp->mJointStateIndices[i] < 0 ) { - llwarns << "No joint index for constraint " << i << llendl; + LL_WARNS() << "No joint index for constraint " << i << LL_ENDL; return FALSE; } } @@ -2300,7 +2300,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, U8* buffer = new U8[size]; file.read((U8*)buffer, size); /*Flawfinder: ignore*/ - lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl; + LL_DEBUGS() << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL; LLDataPackerBinaryBuffer dp(buffer, size); if (motionp->deserialize(dp)) @@ -2309,7 +2309,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, } else { - llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; + LL_WARNS() << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL; motionp->mAssetStatus = ASSET_FETCH_FAILED; } @@ -2317,13 +2317,13 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, } else { - llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl; + LL_WARNS() << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL; motionp->mAssetStatus = ASSET_FETCH_FAILED; } } else { - llwarns << "No existing motion for asset data. UUID: " << asset_uuid << llendl; + LL_WARNS() << "No existing motion for asset data. UUID: " << asset_uuid << LL_ENDL; } } @@ -2344,9 +2344,9 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet) if (quiet < 2) { - llinfos << "-----------------------------------------------------" << llendl; - llinfos << " Global Motion Table" << llendl; - llinfos << "-----------------------------------------------------" << llendl; + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; + LL_INFOS() << " Global Motion Table" << LL_ENDL; + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; } // print each loaded mesh, and it's memory usage @@ -2359,7 +2359,7 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet) if (quiet < 2) { - llinfos << "Motion: " << map_it->key() << llendl; + LL_INFOS() << "Motion: " << map_it->key() << LL_ENDL; } if (motion_list_p) @@ -2371,14 +2371,14 @@ void LLKeyframeDataCache::dumpDiagInfo(int quiet) if (quiet < 2) { - llinfos << "-----------------------------------------------------" << llendl; + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; } - llinfos << "Motions\tTotal Size" << llendl; + LL_INFOS() << "Motions\tTotal Size" << LL_ENDL; snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */ - llinfos << buf << llendl; + LL_INFOS() << buf << LL_ENDL; if (quiet < 2) { - llinfos << "-----------------------------------------------------" << llendl; + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; } } diff --git a/indra/llcharacter/llkeyframestandmotion.cpp b/indra/llcharacter/llkeyframestandmotion.cpp index 43675a4c8..0b0d05f9f 100644 --- a/indra/llcharacter/llkeyframestandmotion.cpp +++ b/indra/llcharacter/llkeyframestandmotion.cpp @@ -125,7 +125,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch !mKneeRightState || !mAnkleRightState ) { - llinfos << getName() << ": Can't find necessary joint states" << llendl; + LL_INFOS() << getName() << ": Can't find necessary joint states" << LL_ENDL; return STATUS_FAILURE; } @@ -333,9 +333,9 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask) mKneeRightState->setRotation( mKneeRightJoint.getRotation() ); mAnkleRightState->setRotation( mAnkleRightJoint.getRotation() ); - //llinfos << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << llendl; + //LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL; -// llinfos << "DEBUG: " << speed << " : " << mTrackAnkles << llendl; +// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL; return TRUE; } diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 21d6fce30..8a6eedaaa 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -163,7 +163,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara mPelvisState->setJoint( mPelvisJoint ); if ( !mPelvisJoint ) { - llwarns << getName() << ": Can't get pelvis joint." << llendl; + LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL; return STATUS_FAILURE; } @@ -351,7 +351,7 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac mPelvisState->setJoint( pelvisJoint ); if ( !pelvisJoint ) { - llwarns << getName() << ": Can't get pelvis joint." << llendl; + LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL; return STATUS_FAILURE; } diff --git a/indra/llcharacter/llmotion.h b/indra/llcharacter/llmotion.h index a246b08c7..8fe6010ab 100644 --- a/indra/llcharacter/llmotion.h +++ b/indra/llcharacter/llmotion.h @@ -297,10 +297,10 @@ public: LLMotionBlendType getBlendType() { return NORMAL_BLEND; } F32 getMinPixelArea() { return 0.f; } - LLMotionInitStatus onInitialize(LLCharacter*) { llinfos << "LLTestMotion::onInitialize()" << llendl; return STATUS_SUCCESS; } - BOOL onActivate() { llinfos << "LLTestMotion::onActivate()" << llendl; return TRUE; } - BOOL onUpdate(F32 time, U8* joint_mask) { llinfos << "LLTestMotion::onUpdate(" << time << ")" << llendl; return TRUE; } - void onDeactivate() { llinfos << "LLTestMotion::onDeactivate()" << llendl; } + LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; } + BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; } + BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; } + void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; } }; diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 03162ff94..6d1ae7761 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -82,7 +82,7 @@ LLMotionRegistry::~LLMotionRegistry() //----------------------------------------------------------------------------- BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) { - // llinfos << "Registering motion: " << name << llendl; + // LL_INFOS() << "Registering motion: " << name << LL_ENDL; return mMotionTable.insert(std::make_pair(id,constructor)).second; } @@ -236,7 +236,7 @@ void LLMotionController::purgeExcessMotions() if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES) { - LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << llendl; + LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL; } } @@ -384,7 +384,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) switch(stat) { case LLMotion::STATUS_FAILURE: - llinfos << "Motion " << id << " init failed." << llendl; + LL_INFOS() << "Motion " << id << " init failed." << LL_ENDL; sRegistry.markBad(id); delete motion; return NULL; @@ -396,7 +396,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) mLoadedMotions.insert(motion); break; default: - llerrs << "Invalid initialization status" << llendl; + LL_ERRS() << "Invalid initialization status" << LL_ENDL; break; } @@ -443,7 +443,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) return TRUE; } -// llinfos << "Starting motion " << name << llendl; +// LL_INFOS() << "Starting motion " << name << LL_ENDL; // F32 start_time = mAnimTime - start_offset; if (!mDisableSyncing) @@ -829,7 +829,7 @@ void LLMotionController::updateLoadingMotions() } else if (status == LLMotion::STATUS_FAILURE) { - llinfos << "Motion " << motionp->getID() << " init failed." << llendl; + LL_INFOS() << "Motion " << motionp->getID() << " init failed." << LL_ENDL; sRegistry.markBad(motionp->getID()); mLoadingMotions.erase(curiter); // Singu note: a motion in mLoadingMotions will not be in mActiveMotions @@ -941,7 +941,7 @@ void LLMotionController::updateMotions(bool force_update) } mHasRunOnce = TRUE; -// llinfos << "Motion controller time " << motionTimer.getElapsedTimeF32() << llendl; +// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL; } //----------------------------------------------------------------------------- @@ -1101,7 +1101,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const //----------------------------------------------------------------------------- void LLMotionController::dumpMotions() { - llinfos << "=====================================" << llendl; + LL_INFOS() << "=====================================" << LL_ENDL; for (motion_map_t::iterator iter = mAllMotions.begin(); iter != mAllMotions.end(); iter++) { @@ -1115,7 +1115,7 @@ void LLMotionController::dumpMotions() if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end()) state_string += std::string("A"); llassert(mDeprecatedMotions.find(motion) == mDeprecatedMotions.end()); // singu: it's impossible that a motion is in mAllMotions and mDeprecatedMotions at the same time. - llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl; + LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL; } // // Also dump the deprecated motions. @@ -1131,7 +1131,7 @@ void LLMotionController::dumpMotions() if (std::find(mActiveMotions.begin(), mActiveMotions.end(), motion)!=mActiveMotions.end()) state_string += std::string("A"); state_string += "D"; - llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl; + LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL; } // } @@ -1312,7 +1312,7 @@ void LLMotionController::pauseAllMotions() { if (!mPaused) { - //llinfos << "Pausing animations..." << llendl; + //LL_INFOS() << "Pausing animations..." << LL_ENDL; mPaused = TRUE; } @@ -1325,7 +1325,7 @@ void LLMotionController::unpauseAllMotions() { if (mPaused) { - //llinfos << "Unpausing animations..." << llendl; + //LL_INFOS() << "Unpausing animations..." << LL_ENDL; mPaused = FALSE; } } diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index ef42576dc..a689e840a 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -147,9 +147,9 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) dp.unpackS32(version, "version"); if (version != GESTURE_VERSION) { - llwarns << "Bad LLMultiGesture version " << version + LL_WARNS() << "Bad LLMultiGesture version " << version << " should be " << GESTURE_VERSION - << llendl; + << LL_ENDL; return FALSE; } @@ -165,7 +165,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) dp.unpackS32(count, "step_count"); if (count < 0) { - llwarns << "Bad LLMultiGesture step count " << count << llendl; + LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL; return FALSE; } @@ -212,7 +212,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) } default: { - llwarns << "Bad LLMultiGesture step type " << type << llendl; + LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL; return FALSE; } } @@ -222,10 +222,10 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) void LLMultiGesture::dump() { - llinfos << "key " << S32(mKey) << " mask " << U32(mMask) + LL_INFOS() << "key " << S32(mKey) << " mask " << U32(mMask) << " trigger " << mTrigger << " replace " << mReplaceText - << llendl; + << LL_ENDL; U32 i; for (i = 0; i < mSteps.size(); ++i) { @@ -313,10 +313,10 @@ std::vector LLGestureStepAnimation::getLabel() const void LLGestureStepAnimation::dump() { - llinfos << "step animation " << mAnimName + LL_INFOS() << "step animation " << mAnimName << " id " << mAnimAssetID << " flags " << mFlags - << llendl; + << LL_ENDL; } //--------------------------------------------------------------------------- @@ -375,10 +375,10 @@ std::vector LLGestureStepSound::getLabel() const void LLGestureStepSound::dump() { - llinfos << "step sound " << mSoundName + LL_INFOS() << "step sound " << mSoundName << " id " << mSoundAssetID << " flags " << mFlags - << llendl; + << LL_ENDL; } @@ -431,9 +431,9 @@ std::vector LLGestureStepChat::getLabel() const void LLGestureStepChat::dump() { - llinfos << "step chat " << mChatText + LL_INFOS() << "step chat " << mChatText << " flags " << mFlags - << llendl; + << LL_ENDL; } @@ -504,7 +504,7 @@ std::vector LLGestureStepWait::getLabel() const void LLGestureStepWait::dump() { - llinfos << "step wait " << mWaitSeconds + LL_INFOS() << "step wait " << mWaitSeconds << " flags " << mFlags - << llendl; + << LL_ENDL; } diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index dcc4ff5f0..099bb9458 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -88,7 +88,7 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat Transitions::iterator transition_it = state_transitions->find(&transition); if (transition_it != state_transitions->end()) { - llerrs << "LLStateTable::addDirectedTransition() : transition already exists" << llendl; + LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL; return FALSE; // transition already exists } @@ -209,7 +209,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename) if (!dot_file) { - llwarns << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << llendl; + LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL; return FALSE; } apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n"); @@ -363,7 +363,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d if (NULL == mCurrentState) { - llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl; + LL_WARNS() << "mCurrentState == NULL; aborting processTransition()" << LL_ENDL; return; } @@ -371,7 +371,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d if (NULL == new_state) { - llwarns << "new_state == NULL; aborting processTransition()" << llendl; + LL_WARNS() << "new_state == NULL; aborting processTransition()" << LL_ENDL; return; } @@ -384,9 +384,9 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d mCurrentState = new_state; mCurrentState->onEntry(user_data); #if FSM_PRINT_STATE_TRANSITIONS - llinfos << "Entering state " << mCurrentState->getName() << + LL_INFOS() << "Entering state " << mCurrentState->getName() << " on transition " << transition.getName() << " from state " << - mLastState->getName() << llendl; + mLastState->getName() << LL_ENDL; #endif } } diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 05b0fdfe8..7396a1ff5 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -86,7 +86,7 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac !mTorsoJoint || !mRightHandJoint) { - llwarns << "Invalid skeleton for targeting motion!" << llendl; + LL_WARNS() << "Invalid skeleton for targeting motion!" << LL_ENDL; return STATUS_FAILURE; } diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index f7cb0f76b..d7d4ebc95 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -79,7 +79,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node) mDefaultWeight = llclamp( default_weight, mMinWeight, mMaxWeight ); if( default_weight != mDefaultWeight ) { - llwarns << "value_default attribute is out of range in node " << mName << " " << default_weight << llendl; + LL_WARNS() << "value_default attribute is out of range in node " << mName << " " << default_weight << LL_ENDL; } } @@ -101,7 +101,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node) } else { - llwarns << "Avatar file: has invalid sex attribute: " << sex << llendl; + LL_WARNS() << "Avatar file: has invalid sex attribute: " << sex << LL_ENDL; return FALSE; } @@ -109,7 +109,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node) static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if( !node->getFastAttributeString( name_string, mName ) ) { - llwarns << "Avatar file: is missing name attribute" << llendl; + LL_WARNS() << "Avatar file: is missing name attribute" << LL_ENDL; return FALSE; } @@ -159,26 +159,42 @@ void LLVisualParamInfo::toStream(std::ostream &out) //----------------------------------------------------------------------------- // LLVisualParam() //----------------------------------------------------------------------------- -LLVisualParam::LLVisualParam() - : - mCurWeight( 0.f ), +LLVisualParam::LLVisualParam() + : mCurWeight( 0.f ), mLastWeight( 0.f ), mNext( NULL ), mTargetWeight( 0.f ), mIsAnimating( FALSE ), + mIsDummy(FALSE), mID( -1 ), mInfo( 0 ), - mIsDummy(FALSE), mParamLocation(LOC_UNKNOWN) { } +//----------------------------------------------------------------------------- +// LLVisualParam() +//----------------------------------------------------------------------------- +LLVisualParam::LLVisualParam(const LLVisualParam& pOther) + : mCurWeight(pOther.mCurWeight), + mLastWeight(pOther.mLastWeight), + mNext(pOther.mNext), + mTargetWeight(pOther.mTargetWeight), + mIsAnimating(pOther.mIsAnimating), + mIsDummy(pOther.mIsDummy), + mID(pOther.mID), + mInfo(pOther.mInfo), + mParamLocation(pOther.mParamLocation) +{ +} + //----------------------------------------------------------------------------- // ~LLVisualParam() //----------------------------------------------------------------------------- LLVisualParam::~LLVisualParam() { delete mNext; + mNext = NULL; } /* @@ -220,7 +236,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node) //----------------------------------------------------------------------------- // setWeight() //----------------------------------------------------------------------------- -void LLVisualParam::setWeight(F32 weight, BOOL upload_bake) +void LLVisualParam::setWeight(F32 weight, bool upload_bake) { if (mIsAnimating) { @@ -245,7 +261,7 @@ void LLVisualParam::setWeight(F32 weight, BOOL upload_bake) //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLVisualParam::setAnimationTarget(F32 target_value, bool upload_bake) { // don't animate dummy parameters if (mIsDummy) @@ -284,10 +300,18 @@ void LLVisualParam::setNextParam( LLVisualParam *next ) mNext = next; } +//----------------------------------------------------------------------------- +// clearNextParam() +//----------------------------------------------------------------------------- +void LLVisualParam::clearNextParam() +{ + mNext = NULL; +} + //----------------------------------------------------------------------------- // animate() //----------------------------------------------------------------------------- -void LLVisualParam::animate( F32 delta, BOOL upload_bake ) +void LLVisualParam::animate( F32 delta, bool upload_bake ) { if (mIsAnimating) { @@ -299,7 +323,7 @@ void LLVisualParam::animate( F32 delta, BOOL upload_bake ) //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLVisualParam::stopAnimating(BOOL upload_bake) +void LLVisualParam::stopAnimating(bool upload_bake) { if (mIsAnimating && isTweakable()) { @@ -346,7 +370,7 @@ void LLVisualParam::setParamLocation(EParamLocation loc) } else { - lldebugs << "param location is already " << mParamLocation << ", not slamming to " << loc << llendl; + LL_DEBUGS() << "param location is already " << mParamLocation << ", not slamming to " << loc << LL_ENDL; } } diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 6cb1fcaa6..123f6a82b 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -47,6 +47,7 @@ enum EVisualParamGroup VISUAL_PARAM_GROUP_TWEAKABLE, VISUAL_PARAM_GROUP_ANIMATABLE, VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT, + VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE, // deprecated params that used to be tweakable. NUM_VISUAL_PARAM_GROUPS }; @@ -99,6 +100,7 @@ protected: // An interface class for a generalized parametric modification of the avatar mesh // Contains data that is specific to each Avatar //----------------------------------------------------------------------------- +LL_ALIGN_PREFIX(16) class LLVisualParam { public: @@ -118,10 +120,10 @@ public: //virtual BOOL parseData( LLXmlTreeNode *node ) = 0; virtual void apply( ESex avatar_sex ) = 0; // Default functions - virtual void setWeight(F32 weight, BOOL upload_bake); - virtual void setAnimationTarget( F32 target_value, BOOL upload_bake ); - virtual void animate(F32 delta, BOOL upload_bake); - virtual void stopAnimating(BOOL upload_bake); + virtual void setWeight(F32 weight, bool upload_bake = false); + virtual void setAnimationTarget(F32 target_value, bool upload_bake = false); + virtual void animate(F32 delta, bool upload_bake = false); + virtual void stopAnimating(bool upload_bake = false); virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); virtual void resetDrivenParams(); @@ -153,6 +155,7 @@ public: LLVisualParam* getNextParam() { return mNext; } void setNextParam( LLVisualParam *next ); + void clearNextParam(); virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; } BOOL getAnimating() const { return mIsAnimating; } @@ -167,6 +170,8 @@ public: virtual std::string getDumpWearableTypeName(void) const = 0; protected: + LLVisualParam(const LLVisualParam& pOther); + F32 mCurWeight; // current weight F32 mLastWeight; // last weight LLVisualParam* mNext; // next param in a shared chain @@ -178,6 +183,6 @@ protected: S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; EParamLocation mParamLocation; // where does this visual param live? -}; +} LL_ALIGN_POSTFIX(16); #endif // LL_LLVisualParam_H diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 23ffd221b..9ad8b0b15 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -24,7 +24,6 @@ set(llcommon_SOURCE_FILES aithreadid.cpp imageids.cpp indra_constants.cpp - ll_template_cast.h llallocator.cpp llallocator_heap_profile.cpp llapp.cpp @@ -116,12 +115,10 @@ set(llcommon_HEADER_FILES aithreadsafe.h bitpack.h ctype_workaround.h - doublelinkedlist.h fix_macros.h imageids.h indra_constants.h linden_common.h - linked_lists.h llaccountingcost.h llalignedarray.h llagentconstants.h @@ -149,7 +146,6 @@ set(llcommon_HEADER_FILES lldarrayptr.h lldate.h lldefs.h - lldeleteutils.h lldependencies.h lldepthstack.h lldictionary.h @@ -204,8 +200,6 @@ set(llcommon_HEADER_FILES llpriqueuemap.h llprocesslauncher.h llprocessor.h - llptrskiplist.h - llptrskipmap.h llptrto.h llqueuedthread.h llrand.h @@ -224,7 +218,6 @@ set(llcommon_HEADER_FILES llskiplist.h llskipmap.h llsortedvector.h - llstack.h llstacktrace.h llstat.h llstatenums.h @@ -252,7 +245,6 @@ set(llcommon_HEADER_FILES reflectivet.h stdenums.h stdtypes.h - string_table.h stringize.h timer.h timing.h diff --git a/indra/llcommon/bitpack.h b/indra/llcommon/bitpack.h index cb9c70c23..74e777f7e 100644 --- a/indra/llcommon/bitpack.h +++ b/indra/llcommon/bitpack.h @@ -85,7 +85,7 @@ public: *(mBuffer + mBufferSize++) = mLoad; if (mBufferSize > mMaxSize) { - llerror("mBufferSize exceeding mMaxSize!", 0); + LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL; } mLoadSize = 0; mLoad = 0x00; @@ -128,7 +128,7 @@ public: *(mBuffer + mBufferSize++) = mLoad; if (mBufferSize > mMaxSize) { - llerror("mBufferSize exceeding mMaxSize!", 0); + LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL; } mLoadSize = 0; mLoad = 0x00; @@ -171,8 +171,8 @@ public: #ifdef _DEBUG if (mBufferSize > mMaxSize) { - llerrs << "mBufferSize exceeding mMaxSize" << llendl; - llerrs << mBufferSize << " > " << mMaxSize << llendl; + LL_ERRS() << "mBufferSize exceeding mMaxSize" << LL_ENDL; + LL_ERRS() << mBufferSize << " > " << mMaxSize << LL_ENDL; } #endif mLoad = *(mBuffer + mBufferSize++); @@ -196,7 +196,7 @@ public: *(mBuffer + mBufferSize++) = mLoad; if (mBufferSize > mMaxSize) { - llerror("mBufferSize exceeding mMaxSize!", 0); + LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL; } mLoadSize = 0; } diff --git a/indra/llcommon/doublelinkedlist.h b/indra/llcommon/doublelinkedlist.h deleted file mode 100644 index f8aa9df80..000000000 --- a/indra/llcommon/doublelinkedlist.h +++ /dev/null @@ -1,1403 +0,0 @@ -/** - * @file doublelinkedlist.h - * @brief Provides a standard doubly linked list for fun and profit. - * - * $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$ - */ - -#ifndef LL_DOUBLELINKEDLIST_H -#define LL_DOUBLELINKEDLIST_H - -#include "llerror.h" -#include "llrand.h" - -// node that actually contains the data -template class LLDoubleLinkedNode -{ -public: - DATA_TYPE *mDatap; - LLDoubleLinkedNode *mNextp; - LLDoubleLinkedNode *mPrevp; - - -public: - // assign the mDatap pointer - LLDoubleLinkedNode(DATA_TYPE *data); - - // destructor does not, by default, destroy associated data - // however, the mDatap must be NULL to ensure that we aren't causing memory leaks - ~LLDoubleLinkedNode(); - - // delete associated data and NULL out pointer - void deleteData(); - - // remove associated data and NULL out pointer - void removeData(); -}; - - -const U32 LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH = 4; - -template class LLDoubleLinkedList -{ -private: - LLDoubleLinkedNode mHead; // head node - LLDoubleLinkedNode mTail; // tail node - LLDoubleLinkedNode *mQueuep; // The node in the batter's box - LLDoubleLinkedNode *mCurrentp; // The node we're talking about - - // The state stack allows nested exploration of the LLDoubleLinkedList - // but should be used with great care - LLDoubleLinkedNode *mQueuepStack[LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH]; - LLDoubleLinkedNode *mCurrentpStack[LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH]; - U32 mStateStackDepth; - U32 mCount; - - // mInsertBefore is a pointer to a user-set function that returns - // TRUE if "first" should be located before "second" - // NOTE: mInsertBefore() should never return TRUE when ("first" == "second") - // or never-ending loops can occur - BOOL (*mInsertBefore)(DATA_TYPE *first, DATA_TYPE *second); - -public: - LLDoubleLinkedList(); - - // destructor destroys list and nodes, but not data in nodes - ~LLDoubleLinkedList(); - - // put data into a node and stick it at the front of the list - // set mCurrentp to mQueuep - void addData(DATA_TYPE *data); - - // put data into a node and stick it at the end of the list - // set mCurrentp to mQueuep - void addDataAtEnd(DATA_TYPE *data); - - S32 getLength() const; - // search the list starting at mHead.mNextp and remove the link with mDatap == data - // set mCurrentp to mQueuep - // return TRUE if found, FALSE if not found - BOOL removeData(const DATA_TYPE *data); - - // search the list starting at mHead.mNextp and delete the link with mDatap == data - // set mCurrentp to mQueuep - // return TRUE if found, FALSE if not found - BOOL deleteData(DATA_TYPE *data); - - // remove all nodes from the list and delete the associated data - void deleteAllData(); - - // remove all nodes from the list but do not delete data - void removeAllNodes(); - - BOOL isEmpty(); - - // check to see if data is in list - // set mCurrentp and mQueuep to the target of search if found, otherwise set mCurrentp to mQueuep - // return TRUE if found, FALSE if not found - BOOL checkData(const DATA_TYPE *data); - - // NOTE: This next two funtions are only included here - // for those too familiar with the LLLinkedList template class. - // They are deprecated. resetList() is unecessary while - // getCurrentData() is identical to getNextData() and has - // a misleading name. - // - // The recommended way to loop through a list is as follows: - // - // datap = list.getFirstData(); - // while (datap) - // { - // /* do stuff */ - // datap = list.getNextData(); - // } - - // place mQueuep on mHead node - void resetList(); - - // return the data currently pointed to, - // set mCurrentp to that node and bump mQueuep down the list - // NOTE: this function is identical to getNextData() - DATA_TYPE *getCurrentData(); - - - // reset the list and return the data currently pointed to, - // set mCurrentp to that node and bump mQueuep down the list - DATA_TYPE *getFirstData(); - - - // reset the list and return the data at position n, set mCurentp - // to that node and bump mQueuep down the list - // Note: n=0 will behave like getFirstData() - DATA_TYPE *getNthData(U32 n); - - // reset the list and return the last data in it, - // set mCurrentp to that node and bump mQueuep up the list - DATA_TYPE *getLastData(); - - // return data in mQueuep, - // set mCurrentp mQueuep and bump mQueuep down the list - DATA_TYPE *getNextData(); - - // return the data in mQueuep, - // set mCurrentp to mQueuep and bump mQueuep up the list - DATA_TYPE *getPreviousData(); - - // remove the Node at mCurrentp - // set mCurrentp to mQueuep - void removeCurrentData(); - - // delete the Node at mCurrentp - // set mCurrentp to mQueuep - void deleteCurrentData(); - - // remove the Node at mCurrentp and insert it into newlist - // set mCurrentp to mQueuep - void moveCurrentData(LLDoubleLinkedList *newlist); - - // insert the node in front of mCurrentp - // set mCurrentp to mQueuep - void insertNode(LLDoubleLinkedNode *node); - - // insert the data in front of mCurrentp - // set mCurrentp to mQueuep - void insertData(DATA_TYPE *data); - - // if mCurrentp has a previous node then : - // * swaps mCurrentp with its previous - // * set mCurrentp to mQueuep - // (convenient for forward bubble-sort) - // otherwise does nothing - void swapCurrentWithPrevious(); - - // if mCurrentp has a next node then : - // * swaps mCurrentp with its next - // * set mCurrentp to mQueuep - // (convenient for backwards bubble-sort) - // otherwise does nothing - void swapCurrentWithNext(); - - // move mCurrentp to the front of the list - // set mCurrentp to mQueuep - void moveCurrentToFront(); - - // move mCurrentp to the end of the list - // set mCurrentp to mQueuep - void moveCurrentToEnd(); - - // set mInsertBefore - void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *first, DATA_TYPE *second)); - - // add data in front of first node for which mInsertBefore(datap, node->mDatap) returns TRUE - // set mCurrentp to mQueuep - BOOL addDataSorted(DATA_TYPE *datap); - - // sort the list using bubble-sort - // Yes, this is a different name than the same function in LLLinkedList. - // When it comes time for a name consolidation hopefully this one will win. - BOOL bubbleSort(); - - // does a single bubble sort pass on the list - BOOL lazyBubbleSort(); - - // returns TRUE if state successfully pushed (state stack not full) - BOOL pushState(); - - // returns TRUE if state successfully popped (state stack not empty) - BOOL popState(); - - // empties the state stack - void clearStateStack(); - - // randomly move the the links in the list for debug or (Discordian) purposes - // sets mCurrentp and mQueuep to top of list - void scramble(); - -private: - // add node to beginning of list - // set mCurrentp to mQueuep - void addNode(LLDoubleLinkedNode *node); - - // add node to end of list - // set mCurrentp to mQueuep - void addNodeAtEnd(LLDoubleLinkedNode *node); -}; - -//#endif - -//////////////////////////////////////////////////////////////////////////////////////////// - -// doublelinkedlist.cpp -// LLDoubleLinkedList template class implementation file. -// Provides a standard doubly linked list for fun and profit. -// -// Copyright 2001, Linden Research, Inc. - -//#include "llerror.h" -//#include "doublelinkedlist.h" - -////////////////////////////////////////////////////////////////////////////////////////// -// LLDoubleLinkedNode -////////////////////////////////////////////////////////////////////////////////////////// - - -// assign the mDatap pointer -template -LLDoubleLinkedNode::LLDoubleLinkedNode(DATA_TYPE *data) : - mDatap(data), mNextp(NULL), mPrevp(NULL) -{ -} - - -// destructor does not, by default, destroy associated data -// however, the mDatap must be NULL to ensure that we aren't causing memory leaks -template -LLDoubleLinkedNode::~LLDoubleLinkedNode() -{ - if (mDatap) - { - llerror("Attempting to call LLDoubleLinkedNode destructor with a non-null mDatap!", 1); - } -} - - -// delete associated data and NULL out pointer -template -void LLDoubleLinkedNode::deleteData() -{ - delete mDatap; - mDatap = NULL; -} - - -template -void LLDoubleLinkedNode::removeData() -{ - mDatap = NULL; -} - - -////////////////////////////////////////////////////////////////////////////////////// -// LLDoubleLinkedList -////////////////////////////////////////////////////////////////////////////////////// - -// <------- up ------- -// -// mCurrentp -// mQueuep | -// | | -// | | -// .------. .------. .------. .------. -// | |---->| |---->| |----->| |-----> NULL -// NULL <-----| |<----| |<----| |<-----| | -// _'------' '------' '------' '------:_ -// .------. /| | | |\ .------. -// NULL <-----|mHead |/ | mQueuep \|mTail |-----> NULL -// | | mCurrentp | | -// '------' '------' -// -------- down ---------> - -template -LLDoubleLinkedList::LLDoubleLinkedList() -: mHead(NULL), mTail(NULL), mQueuep(NULL) -{ - mCurrentp = mHead.mNextp; - mQueuep = mHead.mNextp; - mStateStackDepth = 0; - mCount = 0; - mInsertBefore = NULL; -} - - -// destructor destroys list and nodes, but not data in nodes -template -LLDoubleLinkedList::~LLDoubleLinkedList() -{ - removeAllNodes(); -} - - -// put data into a node and stick it at the front of the list -// doesn't change mCurrentp nor mQueuep -template -void LLDoubleLinkedList::addData(DATA_TYPE *data) -{ - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLDoubleLinkedList::addData()", 0); - } - - // make the new node - LLDoubleLinkedNode *temp = new LLDoubleLinkedNode (data); - - // add the node to the front of the list - temp->mPrevp = NULL; - temp->mNextp = mHead.mNextp; - mHead.mNextp = temp; - - // if there's something in the list, fix its back pointer - if (temp->mNextp) - { - temp->mNextp->mPrevp = temp; - } - // otherwise, fix the tail of the list - else - { - mTail.mPrevp = temp; - } - - mCount++; -} - - -// put data into a node and stick it at the end of the list -template -void LLDoubleLinkedList::addDataAtEnd(DATA_TYPE *data) -{ - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLDoubleLinkedList::addData()", 0); - } - - // make the new node - LLDoubleLinkedNode *nodep = new LLDoubleLinkedNode(data); - - addNodeAtEnd(nodep); - mCount++; -} - - -// search the list starting at mHead.mNextp and remove the link with mDatap == data -// set mCurrentp to mQueuep, or NULL if mQueuep points to node with mDatap == data -// return TRUE if found, FALSE if not found -template -BOOL LLDoubleLinkedList::removeData(const DATA_TYPE *data) -{ - BOOL b_found = FALSE; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLDoubleLinkedList::removeData()", 0); - } - - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - if (mCurrentp->mDatap == data) - { - b_found = TRUE; - - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // remove the node - mCurrentp->removeData(); - delete mCurrentp; - mCount--; - break; - } - mCurrentp = mCurrentp->mNextp; - } - - // reset the list back to where it was - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - - return b_found; -} - - -// search the list starting at mHead.mNextp and delete the link with mDatap == data -// set mCurrentp to mQueuep, or NULL if mQueuep points to node with mDatap == data -// return TRUE if found, FALSE if not found -template -BOOL LLDoubleLinkedList::deleteData(DATA_TYPE *data) -{ - BOOL b_found = FALSE; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLDoubleLinkedList::deleteData()", 0); - } - - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - if (mCurrentp->mDatap == data) - { - b_found = TRUE; - - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // remove the node - mCurrentp->deleteData(); - delete mCurrentp; - mCount--; - break; - } - mCurrentp = mCurrentp->mNextp; - } - - // reset the list back to where it was - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - - return b_found; -} - - -// remove all nodes from the list and delete the associated data -template -void LLDoubleLinkedList::deleteAllData() -{ - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - mQueuep = mCurrentp->mNextp; - mCurrentp->deleteData(); - delete mCurrentp; - mCurrentp = mQueuep; - } - - // reset mHead and mQueuep - mHead.mNextp = NULL; - mTail.mPrevp = NULL; - mCurrentp = mHead.mNextp; - mQueuep = mHead.mNextp; - mStateStackDepth = 0; - mCount = 0; -} - - -// remove all nodes from the list but do not delete associated data -template -void LLDoubleLinkedList::removeAllNodes() -{ - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - mQueuep = mCurrentp->mNextp; - mCurrentp->removeData(); - delete mCurrentp; - mCurrentp = mQueuep; - } - - // reset mHead and mCurrentp - mHead.mNextp = NULL; - mTail.mPrevp = NULL; - mCurrentp = mHead.mNextp; - mQueuep = mHead.mNextp; - mStateStackDepth = 0; - mCount = 0; -} - -template -S32 LLDoubleLinkedList::getLength() const -{ -// U32 length = 0; -// for (LLDoubleLinkedNode* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp) -// { -// length++; -// } - return mCount; -} - -// check to see if data is in list -// set mCurrentp and mQueuep to the target of search if found, otherwise set mCurrentp to mQueuep -// return TRUE if found, FALSE if not found -template -BOOL LLDoubleLinkedList::checkData(const DATA_TYPE *data) -{ - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - if (mCurrentp->mDatap == data) - { - mQueuep = mCurrentp; - return TRUE; - } - mCurrentp = mCurrentp->mNextp; - } - - mCurrentp = mQueuep; - return FALSE; -} - -// NOTE: This next two funtions are only included here -// for those too familiar with the LLLinkedList template class. -// They are deprecated. resetList() is unecessary while -// getCurrentData() is identical to getNextData() and has -// a misleading name. -// -// The recommended way to loop through a list is as follows: -// -// datap = list.getFirstData(); -// while (datap) -// { -// /* do stuff */ -// datap = list.getNextData(); -// } - - // place mCurrentp and mQueuep on first node - template - void LLDoubleLinkedList::resetList() - { - mCurrentp = mHead.mNextp; - mQueuep = mHead.mNextp; - mStateStackDepth = 0; - } - - - // return the data currently pointed to, - // set mCurrentp to that node and bump mQueuep down the list - template - DATA_TYPE* LLDoubleLinkedList::getCurrentData() - { - if (mQueuep) - { - mCurrentp = mQueuep; - mQueuep = mQueuep->mNextp; - return mCurrentp->mDatap; - } - else - { - return NULL; - } - } - - -// reset the list and return the data currently pointed to, -// set mCurrentp to that node and bump mQueuep down the list -template -DATA_TYPE* LLDoubleLinkedList::getFirstData() -{ - mQueuep = mHead.mNextp; - mCurrentp = mQueuep; - if (mQueuep) - { - mQueuep = mQueuep->mNextp; - return mCurrentp->mDatap; - } - else - { - return NULL; - } -} - - -// reset the list and return the data at position n, set mCurentp -// to that node and bump mQueuep down the list -// Note: n=0 will behave like getFirstData() -template -DATA_TYPE* LLDoubleLinkedList::getNthData(U32 n) -{ - mCurrentp = mHead.mNextp; - - if (mCurrentp) - { - for (U32 i=0; imNextp; - if (!mCurrentp) - { - break; - } - } - } - - if (mCurrentp) - { - // bump mQueuep down the list - mQueuep = mCurrentp->mNextp; - return mCurrentp->mDatap; - } - else - { - mQueuep = NULL; - return NULL; - } -} - - -// reset the list and return the last data in it, -// set mCurrentp to that node and bump mQueuep up the list -template -DATA_TYPE* LLDoubleLinkedList::getLastData() -{ - mQueuep = mTail.mPrevp; - mCurrentp = mQueuep; - if (mQueuep) - { - mQueuep = mQueuep->mPrevp; - return mCurrentp->mDatap; - } - else - { - return NULL; - } -} - - -// return the data in mQueuep, -// set mCurrentp to mQueuep and bump mQueuep down the list -template -DATA_TYPE* LLDoubleLinkedList::getNextData() -{ - if (mQueuep) - { - mCurrentp = mQueuep; - mQueuep = mQueuep->mNextp; - return mCurrentp->mDatap; - } - else - { - return NULL; - } -} - - -// return the data in mQueuep, -// set mCurrentp to mQueuep and bump mQueuep up the list -template -DATA_TYPE* LLDoubleLinkedList::getPreviousData() -{ - if (mQueuep) - { - mCurrentp = mQueuep; - mQueuep = mQueuep->mPrevp; - return mCurrentp->mDatap; - } - else - { - return NULL; - } -} - - -// remove the Node at mCurrentp -// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep) -template -void LLDoubleLinkedList::removeCurrentData() -{ - if (mCurrentp) - { - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // otherwise we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // otherwise we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // remove the node - mCurrentp->removeData(); - delete mCurrentp; - mCount--; - - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - } -} - - -// delete the Node at mCurrentp -// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep) -template -void LLDoubleLinkedList::deleteCurrentData() -{ - if (mCurrentp) - { - // remove the node - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // otherwise we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // otherwise we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // remove the LLDoubleLinkedNode - mCurrentp->deleteData(); - delete mCurrentp; - mCount--; - - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - } -} - - -// remove the Node at mCurrentp and insert it into newlist -// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep) -template -void LLDoubleLinkedList::moveCurrentData(LLDoubleLinkedList *newlist) -{ - if (mCurrentp) - { - // remove the node - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // otherwise we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // otherwise we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // move the node to the new list - newlist->addNode(mCurrentp); - - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - } -} - - -// Inserts the node previous to mCurrentp -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::insertNode(LLDoubleLinkedNode *nodep) -{ - // don't allow pointer to NULL to be passed - if (!nodep) - { - llerror("NULL pointer passed to LLDoubleLinkedList::insertNode()", 0); - } - if (!nodep->mDatap) - { - llerror("NULL data pointer passed to LLDoubleLinkedList::insertNode()", 0); - } - - if (mCurrentp) - { - if (mCurrentp->mPrevp) - { - nodep->mPrevp = mCurrentp->mPrevp; - nodep->mNextp = mCurrentp; - mCurrentp->mPrevp->mNextp = nodep; - mCurrentp->mPrevp = nodep; - } - else // at beginning of list - { - nodep->mPrevp = NULL; - nodep->mNextp = mCurrentp; - mHead.mNextp = nodep; - mCurrentp->mPrevp = nodep; - } - mCurrentp = mQueuep; - } - else // add to front of list - { - addNode(nodep); - } -} - - -// insert the data in front of mCurrentp -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::insertData(DATA_TYPE *data) -{ - if (!data) - { - llerror("NULL data pointer passed to LLDoubleLinkedList::insertNode()", 0); - } - LLDoubleLinkedNode *node = new LLDoubleLinkedNode(data); - insertNode(node); - mCount++; -} - - -// if mCurrentp has a previous node then : -// * swaps mCurrentp with its previous -// * set mCurrentp to mQueuep -// otherwise does nothing -template -void LLDoubleLinkedList::swapCurrentWithPrevious() -{ - if (mCurrentp) - { - if (mCurrentp->mPrevp) - { - // Pull mCurrentp out of list - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // mCurrentp was at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // Fix mCurrentp's pointers - mCurrentp->mNextp = mCurrentp->mPrevp; - mCurrentp->mPrevp = mCurrentp->mNextp->mPrevp; - mCurrentp->mNextp->mPrevp = mCurrentp; - - if (mCurrentp->mPrevp) - { - // Fix the backward pointer of mCurrentp's new previous - mCurrentp->mPrevp->mNextp = mCurrentp; - } - else // mCurrentp is now at beginning of list - { - mHead.mNextp = mCurrentp; - } - - // Set the list back to the way it was - mCurrentp = mQueuep; - } - } -} - - -// if mCurrentp has a next node then : -// * swaps mCurrentp with its next -// * set mCurrentp to mQueuep -// otherwise does nothing -template -void LLDoubleLinkedList::swapCurrentWithNext() -{ - if (mCurrentp) - { - if (mCurrentp->mNextp) - { - // Pull mCurrentp out of list - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // mCurrentp was at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // Fix mCurrentp's pointers - mCurrentp->mPrevp = mCurrentp->mNextp; - mCurrentp->mNextp = mCurrentp->mPrevp->mNextp; - mCurrentp->mPrevp->mNextp = mCurrentp; - - if (mCurrentp->mNextp) - { - // Fix the back pointer of mCurrentp's new next - mCurrentp->mNextp->mPrevp = mCurrentp; - } - else // mCurrentp is now at end of list - { - mTail.mPrevp = mCurrentp; - } - - // Set the list back to the way it was - mCurrentp = mQueuep; - } - } -} - -// move mCurrentp to the front of the list -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::moveCurrentToFront() -{ - if (mCurrentp) - { - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // otherwise we are at beginning of list - { - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - return; - } - - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // otherwise we are at end of list - { - mTail.mPrevp = mCurrentp->mPrevp; - } - - // add mCurrentp to beginning of list - mCurrentp->mNextp = mHead.mNextp; - mHead.mNextp->mPrevp = mCurrentp; // mHead.mNextp MUST be valid, - // or the list had only one node - // and we would have returned already - mCurrentp->mPrevp = NULL; - mHead.mNextp = mCurrentp; - - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - } - -} - -// move mCurrentp to the end of the list -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::moveCurrentToEnd() -{ - if (mCurrentp) - { - // if there is a next one, fix it - if (mCurrentp->mNextp) - { - mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp; - } - else // otherwise we are at end of list and we're done - { - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - return; - } - - // if there is a previous one, fix it - if (mCurrentp->mPrevp) - { - mCurrentp->mPrevp->mNextp = mCurrentp->mNextp; - } - else // otherwise we are at beginning of list - { - mHead.mNextp = mCurrentp->mNextp; - } - - // add mCurrentp to end of list - mCurrentp->mPrevp = mTail.mPrevp; - mTail.mPrevp->mNextp = mCurrentp; // mTail.mPrevp MUST be valid, - // or the list had only one node - // and we would have returned already - mCurrentp->mNextp = NULL; - mTail.mPrevp = mCurrentp; - - // check for redundant pointing - if (mCurrentp == mQueuep) - { - mCurrentp = mQueuep = NULL; - } - else - { - mCurrentp = mQueuep; - } - } -} - - -template -void LLDoubleLinkedList::setInsertBefore(BOOL (*insert_before)(DATA_TYPE *first, DATA_TYPE *second) ) -{ - mInsertBefore = insert_before; -} - - -// add data in front of the first node for which mInsertBefore(datap, node->mDatap) returns TRUE -// set mCurrentp to mQueuep -template -BOOL LLDoubleLinkedList::addDataSorted(DATA_TYPE *datap) -{ - // don't allow NULL to be passed to addData() - if (!datap) - { - llerror("NULL pointer passed to LLDoubleLinkedList::addDataSorted()", 0); - } - - // has mInsertBefore not been set? - if (!mInsertBefore) - { - addData(datap); - return FALSE; - } - - // is the list empty? - if (!mHead.mNextp) - { - addData(datap); - return TRUE; - } - - // Note: this step has been added so that the behavior of LLDoubleLinkedList - // is as rigorous as the LLLinkedList class about adding duplicate nodes. - // Duplicate nodes can cause a problem when sorting if mInsertBefore(foo, foo) - // returns TRUE. However, if mInsertBefore(foo, foo) returns FALSE, then there - // shouldn't be any reason to exclude duplicate nodes (as we do here). - if (checkData(datap)) - { - return FALSE; - } - - mCurrentp = mHead.mNextp; - while (mCurrentp) - { - // check to see if datap is already in the list - if (datap == mCurrentp->mDatap) - { - return FALSE; - } - else if (mInsertBefore(datap, mCurrentp->mDatap)) - { - insertData(datap); - return TRUE; - } - mCurrentp = mCurrentp->mNextp; - } - - addDataAtEnd(datap); - return TRUE; -} - - -// bubble-sort until sorted and return TRUE if anything was sorted -// leaves mQueuep pointing at last node that was swapped with its mNextp -// -// NOTE: if you find this function looping for really long times, then you -// probably need to check your implementation of mInsertBefore(a,b) and make -// sure it does not return TRUE when (a == b)! -template -BOOL LLDoubleLinkedList::bubbleSort() -{ - BOOL b_swapped = FALSE; - U32 count = 0; - while (lazyBubbleSort()) - { - b_swapped = TRUE; - if (count++ > 0x7FFFFFFF) - { - llwarning("LLDoubleLinkedList::bubbleSort() : too many passes...", 1); - llwarning(" make sure the mInsertBefore(a, b) does not return TRUE for a == b", 1); - break; - } - } - return b_swapped; -} - - -// do a single bubble-sort pass and return TRUE if anything was sorted -// leaves mQueuep pointing at last node that was swapped with its mNextp -template -BOOL LLDoubleLinkedList::lazyBubbleSort() -{ - // has mInsertBefore been set? - if (!mInsertBefore) - { - return FALSE; - } - - // is list empty? - mCurrentp = mHead.mNextp; - if (!mCurrentp) - { - return FALSE; - } - - BOOL b_swapped = FALSE; - - // the sort will exit after 0x7FFFFFFF nodes or the end of the list, whichever is first - S32 length = 0x7FFFFFFF; - S32 count = 0; - - while (mCurrentp && mCurrentp->mNextp && countmNextp->mDatap, mCurrentp->mDatap)) - { - b_swapped = TRUE; - mQueuep = mCurrentp; - swapCurrentWithNext(); // sets mCurrentp to mQueuep - } - count++; - mCurrentp = mCurrentp->mNextp; - } - - return b_swapped; -} - - -template -BOOL LLDoubleLinkedList::pushState() -{ - if (mStateStackDepth < LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH) - { - *(mQueuepStack + mStateStackDepth) = mQueuep; - *(mCurrentpStack + mStateStackDepth) = mCurrentp; - mStateStackDepth++; - return TRUE; - } - return FALSE; -} - - -template -BOOL LLDoubleLinkedList::popState() -{ - if (mStateStackDepth > 0) - { - mStateStackDepth--; - mQueuep = *(mQueuepStack + mStateStackDepth); - mCurrentp = *(mCurrentpStack + mStateStackDepth); - return TRUE; - } - return FALSE; -} - - -template -void LLDoubleLinkedList::clearStateStack() -{ - mStateStackDepth = 0; -} - -////////////////////////////////////////////////////////////////////////////////////////// -// private members -////////////////////////////////////////////////////////////////////////////////////////// - -// add node to beginning of list -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::addNode(LLDoubleLinkedNode *nodep) -{ - // add the node to the front of the list - nodep->mPrevp = NULL; - nodep->mNextp = mHead.mNextp; - mHead.mNextp = nodep; - - // if there's something in the list, fix its back pointer - if (nodep->mNextp) - { - nodep->mNextp->mPrevp = nodep; - } - else // otherwise fix the tail node - { - mTail.mPrevp = nodep; - } - - mCurrentp = mQueuep; -} - - -// add node to end of list -// set mCurrentp to mQueuep -template -void LLDoubleLinkedList::addNodeAtEnd(LLDoubleLinkedNode *node) -{ - // add the node to the end of the list - node->mNextp = NULL; - node->mPrevp = mTail.mPrevp; - mTail.mPrevp = node; - - // if there's something in the list, fix its back pointer - if (node->mPrevp) - { - node->mPrevp->mNextp = node; - } - else // otherwise fix the head node - { - mHead.mNextp = node; - } - - mCurrentp = mQueuep; -} - - -// randomly move nodes in the list for DEBUG (or Discordian) purposes -// sets mCurrentp and mQueuep to top of list -template -void LLDoubleLinkedList::scramble() -{ - S32 random_number; - DATA_TYPE *datap = getFirstData(); - while(datap) - { - random_number = ll_rand(5); - - if (0 == random_number) - { - removeCurrentData(); - addData(datap); - } - else if (1 == random_number) - { - removeCurrentData(); - addDataAtEnd(datap); - } - else if (2 == random_number) - { - swapCurrentWithPrevious(); - } - else if (3 == random_number) - { - swapCurrentWithNext(); - } - datap = getNextData(); - } - mQueuep = mHead.mNextp; - mCurrentp = mQueuep; -} - -template -BOOL LLDoubleLinkedList::isEmpty() -{ - return (mCount == 0); -} - - -#endif diff --git a/indra/llcommon/linked_lists.h b/indra/llcommon/linked_lists.h deleted file mode 100644 index 3d89a056e..000000000 --- a/indra/llcommon/linked_lists.h +++ /dev/null @@ -1,943 +0,0 @@ -/** - * @file linked_lists.h - * @brief LLLinkedList class header amd implementation 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$ - */ - -#ifndef LL_LINKED_LISTS_H -#define LL_LINKED_LISTS_H - -/** - * Provides a standard doubly linked list for fun and profit - * Utilizes a neat trick off of Flipcode where the back pointer is a - * pointer to a pointer, allowing easier transfer of nodes between lists, &c - * And a template class, of course - */ - -#include "llerror.h" - - -template class LLLinkedList -{ -public: - friend class LLLinkNode; - // External interface - - // basic constructor - LLLinkedList() : mHead(NULL), mCurrentp(NULL), mInsertBefore(NULL) - { - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - mCount = 0; - } - - // basic constructor - LLLinkedList(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested)) : mHead(NULL), mCurrentp(NULL), mInsertBefore(insert_before) - { - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - mCount = 0; - } - - // destructor destroys list and nodes, but not data in nodes - ~LLLinkedList() - { - removeAllNodes(); - } - - // set mInsertBefore - void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested)) - { - mInsertBefore = insert_before; - } - - // - // WARNING!!!!!!! - // addData and addDataSorted are NOT O(1) operations, but O(n) because they check - // for existence of the data in the linked list first. Why, I don't know - djs - // If you don't care about dupes, use addDataNoCheck - // - - // put data into a node and stick it at the front of the list - inline BOOL addData(DATA_TYPE *data); - - // put data into a node and sort into list by mInsertBefore() - // calls normal add if mInsertBefore isn't set - inline BOOL addDataSorted(DATA_TYPE *data); - - inline BOOL addDataNoCheck(DATA_TYPE *data); - - // bubbleSortList - // does an improved bubble sort of the list . . . works best with almost sorted data - // does nothing if mInsertBefore isn't set - // Nota Bene: Swaps are accomplished by swapping data pointers - inline void bubbleSortList(); - - // put data into a node and stick it at the end of the list - inline BOOL addDataAtEnd(DATA_TYPE *data); - - // returns number of items in the list - inline S32 getLength() const; - - inline BOOL isEmpty(); - - // search the list starting at mHead.mNextp and remove the link with mDatap == data - // leave mCurrentp and mCurrentOperatingp on the next entry - // return TRUE if found, FALSE if not found - inline BOOL removeData(DATA_TYPE *data); - - // search the list starting at mHead.mNextp and delete the link with mDatap == data - // leave mCurrentp and mCurrentOperatingp on the next entry - // return TRUE if found, FALSE if not found - inline BOOL deleteData(DATA_TYPE *data); - - // remove all nodes from the list and delete the associated data - inline void deleteAllData(); - - // remove all nodes from the list but do not delete data - inline void removeAllNodes(); - - // check to see if data is in list - // if TRUE then mCurrentp and mCurrentOperatingp point to data - inline BOOL checkData(DATA_TYPE *data); - - // place mCurrentp on first node - inline void resetList(); - - // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - inline DATA_TYPE *getCurrentData(); - - // same as getCurrentData() but a more intuitive name for the operation - inline DATA_TYPE *getNextData(); - - // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - inline DATA_TYPE *getFirstData(); - - // reset the list and return the data at position n, set mCurentOperatingp to that node and bump mCurrentp - // Note: n is zero-based - inline DATA_TYPE *getNthData( U32 n); - - // reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp - inline DATA_TYPE *getLastData(); - - // remove the Node at mCurentOperatingp - // leave mCurrentp and mCurentOperatingp on the next entry - inline void removeCurrentData(); - - // remove the Node at mCurentOperatingp and add it to newlist - // leave mCurrentp and mCurentOperatingp on the next entry - void moveCurrentData(LLLinkedList *newlist, BOOL b_sort); - - BOOL moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort); - - // delete the Node at mCurentOperatingp - // leave mCurrentp anf mCurentOperatingp on the next entry - void deleteCurrentData(); - -private: - // node that actually contains the data - class LLLinkNode - { - public: - // assign the mDatap pointer - LLLinkNode(DATA_TYPE *data) : mDatap(data), mNextp(NULL), mPrevpp(NULL) - { - } - - // destructor does not, by default, destroy associated data - // however, the mDatap must be NULL to ensure that we aren't causing memory leaks - ~LLLinkNode() - { - if (mDatap) - { - llerror("Attempting to call LLLinkNode destructor with a non-null mDatap!", 1); - } - } - - // delete associated data and NULL out pointer - void deleteData() - { - delete mDatap; - mDatap = NULL; - } - - // NULL out pointer - void removeData() - { - mDatap = NULL; - } - - DATA_TYPE *mDatap; - LLLinkNode *mNextp; - LLLinkNode **mPrevpp; - }; - - // add a node at the front of the list - void addData(LLLinkNode *node) - { - // don't allow NULL to be passed to addData - if (!node) - { - llerror("NULL pointer passed to LLLinkedList::addData", 0); - } - - // add the node to the front of the list - node->mPrevpp = &mHead.mNextp; - node->mNextp = mHead.mNextp; - - // if there's something in the list, fix its back pointer - if (node->mNextp) - { - node->mNextp->mPrevpp = &node->mNextp; - } - - mHead.mNextp = node; - } - - LLLinkNode mHead; // fake head node. . . makes pointer operations faster and easier - LLLinkNode *mCurrentp; // mCurrentp is the Node that getCurrentData returns - LLLinkNode *mCurrentOperatingp; // this is the node that the various mumbleCurrentData functions act on - BOOL (*mInsertBefore)(DATA_TYPE *data_new, DATA_TYPE *data_tested); // user function set to allow sorted lists - U32 mCount; -}; - -template -BOOL LLLinkedList::addData(DATA_TYPE *data) -{ - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::addData", 0); - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - if ( checkData(data)) - { - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return FALSE; - } - - // make the new node - LLLinkNode *temp = new LLLinkNode(data); - - // add the node to the front of the list - temp->mPrevpp = &mHead.mNextp; - temp->mNextp = mHead.mNextp; - - // if there's something in the list, fix its back pointer - if (temp->mNextp) - { - temp->mNextp->mPrevpp = &temp->mNextp; - } - - mHead.mNextp = temp; - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - mCount++; - return TRUE; -} - - -template -BOOL LLLinkedList::addDataNoCheck(DATA_TYPE *data) -{ - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::addData", 0); - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - // make the new node - LLLinkNode *temp = new LLLinkNode(data); - - // add the node to the front of the list - temp->mPrevpp = &mHead.mNextp; - temp->mNextp = mHead.mNextp; - - // if there's something in the list, fix its back pointer - if (temp->mNextp) - { - temp->mNextp->mPrevpp = &temp->mNextp; - } - - mHead.mNextp = temp; - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - mCount++; - return TRUE; -} - - -template -BOOL LLLinkedList::addDataSorted(DATA_TYPE *data) -{ - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::addDataSorted", 0); - } - - if (checkData(data)) - { - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return FALSE; - } - - // mInsertBefore not set? - if (!mInsertBefore) - { - addData(data); - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return FALSE; - } - - // empty list? - if (!mHead.mNextp) - { - addData(data); - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return TRUE; - } - - // make the new node - LLLinkNode *temp = new LLLinkNode(data); - - // walk the list until mInsertBefore returns true - mCurrentp = mHead.mNextp; - while (mCurrentp->mNextp) - { - if (mInsertBefore(data, mCurrentp->mDatap)) - { - // insert before the current one - temp->mPrevpp = mCurrentp->mPrevpp; - temp->mNextp = mCurrentp; - *(temp->mPrevpp) = temp; - mCurrentp->mPrevpp = &temp->mNextp; - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - mCount++; - return TRUE; - } - else - { - mCurrentp = mCurrentp->mNextp; - } - } - - // on the last element, add before? - if (mInsertBefore(data, mCurrentp->mDatap)) - { - // insert before the current one - temp->mPrevpp = mCurrentp->mPrevpp; - temp->mNextp = mCurrentp; - *(temp->mPrevpp) = temp; - mCurrentp->mPrevpp = &temp->mNextp; - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - } - else // insert after - { - temp->mPrevpp = &mCurrentp->mNextp; - temp->mNextp = NULL; - mCurrentp->mNextp = temp; - - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - } - mCount++; - return TRUE; -} - -template -void LLLinkedList::bubbleSortList() -{ - // mInsertBefore not set - if (!mInsertBefore) - { - return; - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - BOOL b_swapped = FALSE; - DATA_TYPE *temp; - - // Nota Bene: This will break if more than 0x7FFFFFFF members in list! - S32 length = 0x7FFFFFFF; - S32 count = 0; - do - { - b_swapped = FALSE; - mCurrentp = mHead.mNextp; - count = 0; - while ( (count + 1 < length) - &&(mCurrentp)) - { - if (mCurrentp->mNextp) - { - if (!mInsertBefore(mCurrentp->mDatap, mCurrentp->mNextp->mDatap)) - { - // swap data pointers! - temp = mCurrentp->mDatap; - mCurrentp->mDatap = mCurrentp->mNextp->mDatap; - mCurrentp->mNextp->mDatap = temp; - b_swapped = TRUE; - } - } - else - { - break; - } - count++; - mCurrentp = mCurrentp->mNextp; - } - length = count; - } while (b_swapped); - - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; -} - - -template -BOOL LLLinkedList::addDataAtEnd(DATA_TYPE *data) -{ - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::addData", 0); - } - - if (checkData(data)) - { - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return FALSE; - } - - // make the new node - LLLinkNode *temp = new LLLinkNode(data); - - // add the node to the end of the list - - // if empty, add to the front and be done with it - if (!mHead.mNextp) - { - temp->mPrevpp = &mHead.mNextp; - temp->mNextp = NULL; - mHead.mNextp = temp; - } - else - { - // otherwise, walk to the end of the list - mCurrentp = mHead.mNextp; - while (mCurrentp->mNextp) - { - mCurrentp = mCurrentp->mNextp; - } - temp->mPrevpp = &mCurrentp->mNextp; - temp->mNextp = NULL; - mCurrentp->mNextp = temp; - } - - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - mCount++; - return TRUE; -} - - -// returns number of items in the list -template -S32 LLLinkedList::getLength() const -{ -// S32 length = 0; -// for (LLLinkNode* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp) -// { -// length++; -// } - return mCount; -} - - -template -BOOL LLLinkedList::isEmpty() -{ - return (mCount == 0); -} - - -// search the list starting at mHead.mNextp and remove the link with mDatap == data -// leave mCurrentp and mCurrentOperatingp on the next entry -// return TRUE if found, FALSE if not found -template -BOOL LLLinkedList::removeData(DATA_TYPE *data) -{ - BOOL b_found = FALSE; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::removeData", 0); - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - - while (mCurrentOperatingp) - { - if (mCurrentOperatingp->mDatap == data) - { - b_found = TRUE; - - // remove the node - - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // remove the LLLinkNode - - // if we were on the one we want to delete, bump the cached copies - if (mCurrentOperatingp == tcurrop) - { - tcurrop = tcurr = mCurrentOperatingp->mNextp; - } - else if (mCurrentOperatingp == tcurr) - { - tcurrop = tcurr = mCurrentOperatingp->mNextp; - } - - mCurrentp = mCurrentOperatingp->mNextp; - - mCurrentOperatingp->removeData(); - delete mCurrentOperatingp; - mCurrentOperatingp = mCurrentp; - mCount--; - break; - } - mCurrentOperatingp = mCurrentOperatingp->mNextp; - } - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return b_found; -} - -// search the list starting at mHead.mNextp and delete the link with mDatap == data -// leave mCurrentp and mCurrentOperatingp on the next entry -// return TRUE if found, FALSE if not found -template -BOOL LLLinkedList::deleteData(DATA_TYPE *data) -{ - BOOL b_found = FALSE; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::removeData", 0); - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - - while (mCurrentOperatingp) - { - if (mCurrentOperatingp->mDatap == data) - { - b_found = TRUE; - - // remove the node - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // delete the LLLinkNode - // if we were on the one we want to delete, bump the cached copies - if (mCurrentOperatingp == tcurrop) - { - tcurrop = tcurr = mCurrentOperatingp->mNextp; - } - - // and delete the associated data - llassert(mCurrentOperatingp); - mCurrentp = mCurrentOperatingp->mNextp; - mCurrentOperatingp->deleteData(); - delete mCurrentOperatingp; - mCurrentOperatingp = mCurrentp; - mCount--; - break; - } - mCurrentOperatingp = mCurrentOperatingp->mNextp; - } - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return b_found; -} - - // remove all nodes from the list and delete the associated data -template -void LLLinkedList::deleteAllData() -{ - LLLinkNode *temp; - // reset mCurrentp - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - temp = mCurrentp->mNextp; - mCurrentp->deleteData(); - delete mCurrentp; - mCurrentp = temp; - } - - // reset mHead and mCurrentp - mHead.mNextp = NULL; - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - mCount = 0; -} - -// remove all nodes from the list but do not delete data -template -void LLLinkedList::removeAllNodes() -{ - LLLinkNode *temp; - // reset mCurrentp - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - temp = mCurrentp->mNextp; - mCurrentp->removeData(); - delete mCurrentp; - mCurrentp = temp; - } - - // reset mHead and mCurrentp - mHead.mNextp = NULL; - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - mCount = 0; -} - -// check to see if data is in list -// if TRUE then mCurrentp and mCurrentOperatingp point to data -template -BOOL LLLinkedList::checkData(DATA_TYPE *data) -{ - // reset mCurrentp - mCurrentp = mHead.mNextp; - - while (mCurrentp) - { - if (mCurrentp->mDatap == data) - { - mCurrentOperatingp = mCurrentp; - return TRUE; - } - mCurrentp = mCurrentp->mNextp; - } - mCurrentOperatingp = mCurrentp; - return FALSE; -} - -// place mCurrentp on first node -template -void LLLinkedList::resetList() -{ - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; -} - -// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -DATA_TYPE *LLLinkedList::getCurrentData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mNextp; - return mCurrentOperatingp->mDatap; - } - else - { - return NULL; - } -} - -// same as getCurrentData() but a more intuitive name for the operation -template -DATA_TYPE *LLLinkedList::getNextData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mNextp; - return mCurrentOperatingp->mDatap; - } - else - { - return NULL; - } -} - -// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -DATA_TYPE *LLLinkedList::getFirstData() -{ - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mNextp; - return mCurrentOperatingp->mDatap; - } - else - { - return NULL; - } -} - -// Note: n is zero-based -template -DATA_TYPE *LLLinkedList::getNthData( U32 n ) -{ - mCurrentOperatingp = mHead.mNextp; - - // if empty, return NULL - if (!mCurrentOperatingp) - { - return NULL; - } - - for( U32 i = 0; i < n; i++ ) - { - mCurrentOperatingp = mCurrentOperatingp->mNextp; - if( !mCurrentOperatingp ) - { - return NULL; - } - } - - mCurrentp = mCurrentOperatingp->mNextp; - return mCurrentOperatingp->mDatap; -} - - -// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp -template -DATA_TYPE *LLLinkedList::getLastData() -{ - mCurrentOperatingp = mHead.mNextp; - - // if empty, return NULL - if (!mCurrentOperatingp) - return NULL; - - // walk until we're pointing at the last entry - while (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp = mCurrentOperatingp->mNextp; - } - mCurrentp = mCurrentOperatingp->mNextp; - return mCurrentOperatingp->mDatap; -} - -// remove the Node at mCurentOperatingp -// leave mCurrentp and mCurentOperatingp on the next entry -// return TRUE if found, FALSE if not found -template -void LLLinkedList::removeCurrentData() -{ - if (mCurrentOperatingp) - { - // remove the node - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // remove the LLLinkNode - mCurrentp = mCurrentOperatingp->mNextp; - - mCurrentOperatingp->removeData(); - delete mCurrentOperatingp; - mCount--; - mCurrentOperatingp = mCurrentp; - } -} - -// remove the Node at mCurentOperatingp and add it to newlist -// leave mCurrentp and mCurentOperatingp on the next entry -// return TRUE if found, FALSE if not found -template -void LLLinkedList::moveCurrentData(LLLinkedList *newlist, BOOL b_sort) -{ - if (mCurrentOperatingp) - { - // remove the node - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // remove the LLLinkNode - mCurrentp = mCurrentOperatingp->mNextp; - // move the node to the new list - newlist->addData(mCurrentOperatingp); - if (b_sort) - bubbleSortList(); - mCurrentOperatingp = mCurrentp; - } -} - -template -BOOL LLLinkedList::moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort) -{ - BOOL b_found = FALSE; - // don't allow NULL to be passed to addData - if (!data) - { - llerror("NULL pointer passed to LLLinkedList::removeData", 0); - } - - LLLinkNode *tcurr = mCurrentp; - LLLinkNode *tcurrop = mCurrentOperatingp; - - mCurrentp = mHead.mNextp; - mCurrentOperatingp = mHead.mNextp; - - while (mCurrentOperatingp) - { - if (mCurrentOperatingp->mDatap == data) - { - b_found = TRUE; - - // remove the node - - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // if we were on the one we want to delete, bump the cached copies - if ( (mCurrentOperatingp == tcurrop) - ||(mCurrentOperatingp == tcurr)) - { - tcurrop = tcurr = mCurrentOperatingp->mNextp; - } - - // remove the LLLinkNode - mCurrentp = mCurrentOperatingp->mNextp; - // move the node to the new list - newlist->addData(mCurrentOperatingp); - if (b_sort) - newlist->bubbleSortList(); - mCurrentOperatingp = mCurrentp; - break; - } - mCurrentOperatingp = mCurrentOperatingp->mNextp; - } - // restore - mCurrentp = tcurr; - mCurrentOperatingp = tcurrop; - return b_found; -} - -// delete the Node at mCurentOperatingp -// leave mCurrentp anf mCurentOperatingp on the next entry -// return TRUE if found, FALSE if not found -template -void LLLinkedList::deleteCurrentData() -{ - if (mCurrentOperatingp) - { - // remove the node - // if there is a next one, fix it - if (mCurrentOperatingp->mNextp) - { - mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp; - } - *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp; - - // remove the LLLinkNode - mCurrentp = mCurrentOperatingp->mNextp; - - mCurrentOperatingp->deleteData(); - if (mCurrentOperatingp->mDatap) - llerror("This is impossible!", 0); - delete mCurrentOperatingp; - mCurrentOperatingp = mCurrentp; - mCount--; - } -} - -#endif diff --git a/indra/llcommon/ll_template_cast.h b/indra/llcommon/ll_template_cast.h deleted file mode 100644 index c8f9a2f7e..000000000 --- a/indra/llcommon/ll_template_cast.h +++ /dev/null @@ -1,177 +0,0 @@ -/** - * @file ll_template_cast.h - * @author Nat Goodspeed - * @date 2009-11-21 - * @brief Define ll_template_cast function - * - * $LicenseInfo:firstyear=2009&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#if ! defined(LL_LL_TEMPLATE_CAST_H) -#define LL_LL_TEMPLATE_CAST_H - -/** - * Implementation for ll_template_cast() (q.v.). - * - * Default implementation: trying to cast two completely unrelated types - * returns 0. Typically you'd specify T and U as pointer types, but in fact T - * can be any type that can be initialized with 0. - */ -template -struct ll_template_cast_impl -{ - T operator()(U) - { - return 0; - } -}; - -/** - * ll_template_cast(some_value) is for use in a template function when - * some_value might be of arbitrary type, but you want to recognize type T - * specially. - * - * It's designed for use with pointer types. Example: - * @code - * struct SpecialClass - * { - * void someMethod(const std::string&) const; - * }; - * - * template - * void somefunc(const REALCLASS& instance) - * { - * const SpecialClass* ptr = ll_template_cast(&instance); - * if (ptr) - * { - * ptr->someMethod("Call method only available on SpecialClass"); - * } - * } - * @endcode - * - * Why is this better than dynamic_cast<>? Because unless OtherClass is - * polymorphic, the following won't even compile (gcc 4.0.1): - * @code - * OtherClass other; - * SpecialClass* ptr = dynamic_cast(&other); - * @endcode - * to say nothing of this: - * @code - * void function(int); - * SpecialClass* ptr = dynamic_cast(&function); - * @endcode - * ll_template_cast handles these kinds of cases by returning 0. - */ -template -T ll_template_cast(U value) -{ - return ll_template_cast_impl()(value); -} - -/** - * Implementation for ll_template_cast() (q.v.). - * - * Implementation for identical types: return same value. - */ -template -struct ll_template_cast_impl -{ - T operator()(T value) - { - return value; - } -}; - -/** - * LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of - * type @c source, ll_template_cast(s) will return @c s -- - * presuming that @c source can be converted to @c dest by the normal rules of - * C++. - * - * By default, ll_template_cast(s) will return 0 unless @c s's - * type is literally identical to @c dest. (This is because of the - * straightforward application of template specialization rules.) That can - * lead to surprising results, e.g.: - * - * @code - * Foo myFoo; - * const Foo* fooptr = ll_template_cast(&myFoo); - * @endcode - * - * Here @c fooptr will be 0 because &myFoo is of type Foo* - * -- @em not const Foo*. (Declaring const Foo myFoo; would - * force the compiler to do the right thing.) - * - * More disappointingly: - * @code - * struct Base {}; - * struct Subclass: public Base {}; - * Subclass object; - * Base* ptr = ll_template_cast(&object); - * @endcode - * - * Here @c ptr will be 0 because &object is of type - * Subclass* rather than Base*. We @em want this cast to - * succeed, but without our help ll_template_cast can't recognize it. - * - * The following would suffice: - * @code - * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); - * ... - * Base* ptr = ll_template_cast(&object); - * @endcode - * - * However, as noted earlier, this is easily fooled: - * @code - * const Base* ptr = ll_template_cast(&object); - * @endcode - * would still produce 0 because we haven't yet seen: - * @code - * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); - * @endcode - * - * @TODO - * This macro should use Boost type_traits facilities for stripping and - * re-adding @c const and @c volatile qualifiers so that invoking - * LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all - * permitted permutations. It's really not fair to the coder to require - * separate: - * @code - * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); - * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); - * LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*); - * @endcode - * - * (Naturally we omit LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*) - * because that's not permitted by normal C++ assignment anyway.) - */ -#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \ -template <> \ -struct ll_template_cast_impl \ -{ \ - DEST operator()(SOURCE wrapper) \ - { \ - return wrapper; \ - } \ -} - -#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */ diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index b574ef668..b2eafde1a 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -59,7 +59,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) { // *TODO - determine if there should be some better error state than // mLines being empty. -brad - llwarns << "invalid heap profile data passed into parser." << llendl; + LL_WARNS() << "invalid heap profile data passed into parser." << LL_ENDL; return; } diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 4b6059f86..bc3e7196d 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -235,8 +235,8 @@ bool LLApp::parseCommandOptions(int argc, char** argv) { if(argv[ii][0] != '-') { - llinfos << "Did not find option identifier while parsing token: " - << argv[ii] << llendl; + LL_INFOS() << "Did not find option identifier while parsing token: " + << argv[ii] << LL_ENDL; return false; } int offset = 1; @@ -415,7 +415,7 @@ void LLApp::startErrorThread() // if(!mThreadErrorp) { - llinfos << "Starting error thread" << llendl; + LL_INFOS() << "Starting error thread" << LL_ENDL; mThreadErrorp = new LLErrorThread(); mThreadErrorp->setUserData((void *) this); mThreadErrorp->start(); @@ -432,7 +432,7 @@ void LLApp::stopErrorThread() } if (mThreadErrorp && !mThreadErrorp->isStopped()) { - llwarns << "Failed to stop Error Thread." << llendl; + LL_WARNS() << "Failed to stop Error Thread." << LL_ENDL; } } @@ -450,7 +450,7 @@ void LLApp::runErrorHandler() LLApp::sErrorHandler(); } - //llinfos << "App status now STOPPED" << llendl; + //LL_INFOS() << "App status now STOPPED" << LL_ENDL; LLApp::setStopped(); } @@ -512,7 +512,7 @@ void LLApp::setQuitting() if (!isExiting()) { // If we're already exiting, we don't want to reset our state back to quitting. - llinfos << "Setting app state to QUITTING" << llendl; + LL_INFOS() << "Setting app state to QUITTING" << LL_ENDL; setStatus(APP_STATUS_QUITTING); } } @@ -620,7 +620,7 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except if (LLApp::isError()) { - llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; + LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL; retval = EXCEPTION_EXECUTE_HANDLER; return retval; } @@ -666,7 +666,7 @@ BOOL ConsoleCtrlHandler(DWORD fdwCtrlType) // We're already trying to die, just ignore this signal if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl; + LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL; } return TRUE; } @@ -698,8 +698,8 @@ pid_t LLApp::fork() if( pid < 0 ) { int system_error = errno; - llwarns << "Unable to fork! Operating system error code: " - << system_error << llendl; + LL_WARNS() << "Unable to fork! Operating system error code: " + << system_error << LL_ENDL; } else if (pid == 0) { @@ -712,7 +712,7 @@ pid_t LLApp::fork() } else { - llinfos << "Forked child process " << pid << llendl; + LL_INFOS() << "Forked child process " << pid << LL_ENDL; } return pid; } @@ -803,7 +803,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << llendl; + LL_INFOS() << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << LL_ENDL; } @@ -812,7 +812,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) case SIGCHLD: if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Got SIGCHLD from " << info->si_pid << llendl; + LL_INFOS() << "Signal handler - Got SIGCHLD from " << info->si_pid << LL_ENDL; } // Check result code for all child procs for which we've @@ -833,7 +833,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) // Abort just results in termination of the app, no funky error handling. if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Got SIGABRT, terminating" << llendl; + LL_WARNS() << "Signal handler - Got SIGABRT, terminating" << LL_ENDL; } clear_signals(); raise(signum); @@ -843,7 +843,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) case SIGTERM: if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << llendl; + LL_WARNS() << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << LL_ENDL; } // Graceful exit // Just set our state to quitting, not error @@ -852,7 +852,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) // We're already trying to die, just ignore this signal if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl; + LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL; } return; } @@ -874,7 +874,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) // Smackdown treated just like any other app termination, for now if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Handling smackdown signal!" << llendl; + LL_WARNS() << "Signal handler - Handling smackdown signal!" << LL_ENDL; } else { @@ -888,7 +888,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Handling fatal signal!" << llendl; + LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL; } if (LLApp::isError()) { @@ -898,7 +898,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Got another fatal signal while in the error handler, die now!" << llendl; + LL_WARNS() << "Signal handler - Got another fatal signal while in the error handler, die now!" << LL_ENDL; } raise(signum); return; @@ -906,13 +906,13 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) if (LLApp::sLogInSignal) { - llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl; + LL_WARNS() << "Signal handler - Flagging error status and waiting for shutdown" << LL_ENDL; } if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem { clear_signals(); - llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl; + LL_WARNS() << "Fatal signal received, not handling the crash here, passing back to operating system" << LL_ENDL; raise(signum); return; } @@ -927,7 +927,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) if (LLApp::sLogInSignal) { - llwarns << "Signal handler - App is stopped, reraising signal" << llendl; + LL_WARNS() << "Signal handler - App is stopped, reraising signal" << LL_ENDL; } clear_signals(); raise(signum); @@ -935,7 +935,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) } else { if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Unhandled signal " << signum << ", ignoring!" << llendl; + LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL; } } } @@ -969,7 +969,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_ strncpy(path, minidump_desc.path(), remaining); - llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -1015,7 +1015,7 @@ bool unix_post_minidump_callback(const char *dump_dir, strncpy(path, ".dmp", remaining); } - llinfos << "generated minidump: " << path << llendl; + LL_INFOS() << "generated minidump: " << path << LL_ENDL; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -1058,16 +1058,16 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, strncpy(path, ".dmp", remaining); } - llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); // *TODO: Translate the signals/exceptions into cross-platform stuff // Windows implementation - llinfos << "Entering Windows Exception Handler..." << llendl; + LL_INFOS() << "Entering Windows Exception Handler..." << LL_ENDL; if (LLApp::isError()) { - llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; + LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL; } // Flag status to error, so thread_error starts its work diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 28e8db756..de7f3e9dc 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -154,7 +154,7 @@ S32 LLAPRFile::read(void *buf, S32 nbytes) { if(!mFile) { - llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ; + LL_WARNS() << "apr mFile is removed by somebody else. Can not read." << LL_ENDL ; return 0; } @@ -176,7 +176,7 @@ S32 LLAPRFile::write(const void *buf, S32 nbytes) { if(!mFile) { - llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ; + LL_WARNS() << "apr mFile is removed by somebody else. Can not write." << LL_ENDL ; return 0; } diff --git a/indra/llcommon/llbase32.cpp b/indra/llcommon/llbase32.cpp index 5e6ced9ce..59d150152 100644 --- a/indra/llcommon/llbase32.cpp +++ b/indra/llcommon/llbase32.cpp @@ -237,8 +237,8 @@ std::string LLBase32::encode(const U8* input, size_t input_size) size_t encoded = base32_encode(&output[0], output_size, input, input_size); - llinfos << "encoded " << encoded << " into buffer of size " - << output_size << llendl; + LL_INFOS() << "encoded " << encoded << " into buffer of size " + << output_size << LL_ENDL; } return output; } diff --git a/indra/llcommon/llcrc.cpp b/indra/llcommon/llcrc.cpp index 7f183dc9a..515e07a4a 100644 --- a/indra/llcommon/llcrc.cpp +++ b/indra/llcommon/llcrc.cpp @@ -168,7 +168,7 @@ void LLCRC::update(const std::string& filename) { if (filename.empty()) { - llerrs << "No filename specified" << llendl; + LL_ERRS() << "No filename specified" << LL_ENDL; return; } @@ -191,7 +191,7 @@ void LLCRC::update(const std::string& filename) if (nread < (size_t) size) { - llwarns << "Short read on " << filename << llendl; + LL_WARNS() << "Short read on " << filename << LL_ENDL; } update(data, nread); diff --git a/indra/llcommon/llcrc.h b/indra/llcommon/llcrc.h index 74369062c..94d5b6a72 100644 --- a/indra/llcommon/llcrc.h +++ b/indra/llcommon/llcrc.h @@ -47,7 +47,7 @@ // crc.update(fgetc(fp)); // } // fclose(fp); -// llinfos << "File crc: " << crc.getCRC() << llendl; +// LL_INFOS() << "File crc: " << crc.getCRC() << LL_ENDL; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LL_COMMON_API LLCRC diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index b36bd0b65..b24e70fad 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -72,8 +72,8 @@ LLDate::LLDate(const std::string& iso8601_date) { if(!fromString(iso8601_date)) { - llwarns << "date " << iso8601_date << " failed to parse; " - << "ZEROING IT OUT" << llendl; + LL_WARNS() << "date " << iso8601_date << " failed to parse; " + << "ZEROING IT OUT" << LL_ENDL; mSecondsSinceEpoch = DATE_EPOCH; } } diff --git a/indra/llcommon/lldeleteutils.h b/indra/llcommon/lldeleteutils.h deleted file mode 100644 index 8a8d3fd72..000000000 --- a/indra/llcommon/lldeleteutils.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lldeleteutils.h - * @brief Utility functions to simplify some common pointer-munging idioms. - * - * $LicenseInfo:firstyear=2009&license=viewergpl$ - * - * Copyright (c) 2009-2010, 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$ - * - */ -#ifndef LL_DELETE_UTILS_H -#define LL_DELETE_UTILS_H - -// Simple utility functions to eventually replace the common 2-line -// idiom scattered throughout the viewer codebase. Note that where -// possible we would rather be using smart pointers of some sort. - -template -inline void deleteAndClear(T*& ptr) -{ - delete ptr; - ptr = NULL; -} - -template -inline void deleteAndClearArray(T*& array_ptr) -{ - delete[] array_ptr; - array_ptr = NULL; -} - -#endif diff --git a/indra/llcommon/lldepthstack.h b/indra/llcommon/lldepthstack.h index accc11f57..dec73e5d7 100644 --- a/indra/llcommon/lldepthstack.h +++ b/indra/llcommon/lldepthstack.h @@ -33,18 +33,19 @@ #ifndef LL_LLDEPTHSTACK_H #define LL_LLDEPTHSTACK_H -#include "linked_lists.h" +#include "llstl.h" template class LLDepthStack { private: - LLLinkedList mStack; + std::deque mStack; U32 mCurrentDepth; U32 mMaxDepth; public: - LLDepthStack() : mCurrentDepth(0), mMaxDepth(0) {} - ~LLDepthStack() {} + LLDepthStack() + : mCurrentDepth(0), mMaxDepth(0) + {} void setDepth(U32 depth) { @@ -60,24 +61,27 @@ public: { if (mCurrentDepth < mMaxDepth) { - mStack.addData(data); + mStack.push_back(data); mCurrentDepth++; } else { // the last item falls off stack and is deleted - mStack.getLastData(); - mStack.deleteCurrentData(); - mStack.addData(data); + if (!mStack.empty()) + { + mStack.pop_front(); + } + mStack.push_back(data); } } DATA_TYPE *pop() { - DATA_TYPE *tempp = mStack.getFirstData(); - if (tempp) + DATA_TYPE *tempp = NULL; + if (!mStack.empty()) { - mStack.removeCurrentData(); + tempp = mStack.back(); + mStack.pop_back(); mCurrentDepth--; } return tempp; @@ -85,20 +89,13 @@ public: DATA_TYPE *check() { - DATA_TYPE *tempp = mStack.getFirstData(); - return tempp; + return mStack.empty() ? NULL : mStack.back(); } - - void deleteAllData() - { - mCurrentDepth = 0; - mStack.deleteAllData(); - } - + void removeAllNodes() { mCurrentDepth = 0; - mStack.removeAllNodes(); + mStack.clear(); } }; diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 7530b4fa7..f7356d514 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -36,6 +36,7 @@ #include #include +#include "llpreprocessor.h" struct LL_COMMON_API LLDictionaryEntry { @@ -94,7 +95,7 @@ protected: { if (lookup(index)) { - llerrs << "Dictionary entry already added (attempted to add duplicate entry)" << llendl; + LL_ERRS() << "Dictionary entry already added (attempted to add duplicate entry)" << LL_ENDL; } (*this)[index] = entry; } diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 10921d421..fa8ec2be5 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -40,7 +40,6 @@ # include #endif // !LL_WINDOWS #include -#include #include "llapp.h" #include "llapr.h" @@ -54,7 +53,26 @@ #include "aithreadsafe.h" namespace { -#if !LL_WINDOWS +#if LL_WINDOWS + void debugger_print(const std::string& s) + { + // Be careful when calling OutputDebugString as it throws DBG_PRINTEXCEPTION_C + // which works just fine under the windows debugger, but can cause users who + // have enabled SEHOP exception chain validation to crash due to interactions + // between the Win 32-bit exception handling and boost coroutine fiber stacks. BUG-2707 + // + if (IsDebuggerPresent()) + { + // Need UTF16 for Unicode OutputDebugString + // + if (s.size()) + { + OutputDebugString(utf8str_to_utf16str(s).c_str()); + OutputDebugString(TEXT("\n")); + } + } + } +#else class RecordToSyslog : public LLError::Recorder { public: @@ -96,11 +114,12 @@ namespace { public: RecordToFile(const std::string& filename) { - mFile.open(filename, llofstream::out | llofstream::app); + mFile.open(filename.c_str(), std::ios_base::out | std::ios_base::app); if (!mFile) { - llinfos << "Error setting log file to " << filename << llendl; + LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; } + mWantsTime = true; } ~RecordToFile() @@ -108,16 +127,12 @@ namespace { mFile.close(); } - bool okay() { return !!mFile; } - - virtual bool wantsTime() { return true; } + bool okay() { return mFile.good(); } virtual void recordMessage(LLError::ELevel level, const std::string& message) { mFile << message << std::endl; - // mFile.flush(); - // *FIX: should we do this? } private: @@ -128,9 +143,10 @@ namespace { class RecordToStderr : public LLError::Recorder { public: - RecordToStderr(bool timestamp) : mTimestamp(timestamp), mUseANSI(ANSI_PROBE) { } - - virtual bool wantsTime() { return mTimestamp; } + RecordToStderr(bool timestamp) : mUseANSI(ANSI_PROBE) + { + mWantsTime = timestamp; + } virtual void recordMessage(LLError::ELevel level, const std::string& message) @@ -172,14 +188,19 @@ namespace { } private: - bool mTimestamp; - enum ANSIState {ANSI_PROBE, ANSI_YES, ANSI_NO}; - ANSIState mUseANSI; + enum ANSIState + { + ANSI_PROBE, + ANSI_YES, + ANSI_NO + } mUseANSI; + void colorANSI(const std::string color) { // ANSI color code escape sequence fprintf(stderr, "\033[%sm", color.c_str() ); }; + bool checkANSI(void) { #if LL_LINUX || LL_DARWIN @@ -212,13 +233,13 @@ namespace { class RecordToWinDebug: public LLError::Recorder { public: + RecordToWinDebug() + {} + virtual void recordMessage(LLError::ELevel level, const std::string& message) { - llutf16string utf16str = - wstring_to_utf16str(utf8str_to_wstring(message)); - utf16str += '\n'; - OutputDebugString(utf16str.c_str()); + debugger_print(message); } }; #endif @@ -230,7 +251,7 @@ namespace std::string className(const std::type_info& type) { #ifdef __GNUC__ - // GCC: type_info::name() returns a mangled class name, must demangle + // GCC: type_info::name() returns a mangled class name,st demangle static size_t abi_name_len = 100; static char* abi_name_buf = (char*)malloc(abi_name_len); @@ -326,7 +347,7 @@ namespace LLSD configuration; { - llifstream file(filename()); + llifstream file(filename().c_str()); if (file.is_open()) { LLSDSerialize::fromXML(configuration, file); @@ -334,47 +355,52 @@ namespace if (configuration.isUndefined()) { - llwarns << filename() << " missing, ill-formed," + LL_WARNS() << filename() << " missing, ill-formed," " or simply undefined; not changing configuration" - << llendl; + << LL_ENDL; return false; } } LLError::configure(configuration); - llinfos << "logging reconfigured from " << filename() << llendl; + LL_INFOS() << "logging reconfigured from " << filename() << LL_ENDL; return true; } typedef std::map LevelMap; - typedef std::vector Recorders; + typedef std::vector Recorders; typedef std::vector CallSiteVector; class Globals { public: + std::ostringstream messageStream; bool messageStreamInUse; void addCallSite(LLError::CallSite&); void invalidateCallSites(); - + static AIThreadSafeSimple& get(); // return the one instance of the globals private: CallSiteVector callSites; - + friend class AIThreadSafeSimpleDC; // Calls constructor. friend class AIThreadSafeSimple; // Calls destructor. - - Globals() - : messageStreamInUse(false) - { } + Globals(); }; + Globals::Globals() + : messageStream(), + messageStreamInUse(false), + callSites() + { + } + void Globals::addCallSite(LLError::CallSite& site) { callSites.push_back(&site); @@ -391,12 +417,12 @@ namespace callSites.clear(); } - + AIThreadSafeSimple& Globals::get() { /* This pattern, of returning a reference to a static function variable, is to ensure that this global is constructed before - it is used, no matter what the global initialization sequence + it is used, no matter what the global initializeation sequence is. See C++ FAQ Lite, sections 10.12 through 10.14 */ @@ -407,112 +433,189 @@ namespace namespace LLError { + class SettingsConfig : public LLRefCount + { + friend class Settings; + + public: + virtual ~SettingsConfig(); + + bool mPrintLocation; + + LLError::ELevel mDefaultLevel; + + LevelMap mFunctionLevelMap; + LevelMap mClassLevelMap; + LevelMap mFileLevelMap; + LevelMap mTagLevelMap; + std::map mUniqueLogMessages; + + LLError::FatalFunction mCrashFunction; + LLError::TimeFunction mTimeFunction; + + Recorders mRecorders; + RecorderPtr mFileRecorder; + RecorderPtr mFixedBufferRecorder; + std::string mFileRecorderFileName; + + int mShouldLogCallCounter; + + private: + SettingsConfig(); + }; + + typedef LLPointer SettingsConfigPtr; + class Settings { public: - bool printLocation; - - LLError::ELevel defaultLevel; - - LevelMap functionLevelMap; - LevelMap classLevelMap; - LevelMap fileLevelMap; - LevelMap tagLevelMap; - std::map uniqueLogMessages; - - LLError::FatalFunction crashFunction; - LLError::TimeFunction timeFunction; - - Recorders recorders; - Recorder* fileRecorder; - Recorder* fixedBufferRecorder; - std::string fileRecorderFileName; - - int shouldLogCallCounter; - static AIThreadSafeSimple& get(); - - static void reset(); - static AIThreadSafeSimple* saveAndReset(); - static void restore(AIThreadSafeSimple*); + + SettingsConfigPtr getSettingsConfig(); + + void reset(); + SettingsStoragePtr saveAndReset(); + void restore(SettingsStoragePtr pSettingsStorage); private: friend class AIThreadSafeBits; // Calls destructor. friend class AIThreadSafeSimpleDC; // Calls constructor. - - Settings() - : printLocation(false), - defaultLevel(LLError::LEVEL_DEBUG), - crashFunction(NULL), - timeFunction(NULL), - fileRecorder(NULL), - fixedBufferRecorder(NULL), - shouldLogCallCounter(0) - { } + Settings(); - ~Settings() - { - for_each(recorders.begin(), recorders.end(), - DeletePointer()); - } - - static AIThreadSafeSimple* sSettings; + SettingsConfigPtr mSettingsConfig; }; + + static AIThreadSafeSimple* sSettings; + + SettingsConfig::SettingsConfig() + : LLRefCount(), + mPrintLocation(false), + mDefaultLevel(LLError::LEVEL_DEBUG), + mFunctionLevelMap(), + mClassLevelMap(), + mFileLevelMap(), + mTagLevelMap(), + mUniqueLogMessages(), + mCrashFunction(NULL), + mTimeFunction(NULL), + mRecorders(), + mFileRecorder(), + mFixedBufferRecorder(), + mFileRecorderFileName(), + mShouldLogCallCounter(0) + { + } - // Pointer to current AIThreadSafeSimple object if any (NULL otherwise). - AIThreadSafeSimple* Settings::sSettings; + SettingsConfig::~SettingsConfig() + { + mRecorders.clear(); + } + + Settings::Settings() + : mSettingsConfig(new SettingsConfig()) + { + } AIThreadSafeSimple& Settings::get() { - if (!sSettings) - { - reset(); - } - return *sSettings; + static AIThreadSafeSimpleDCRootPool* ts_globals_ptr = new AIThreadSafeSimpleDCRootPool; + return *ts_globals_ptr; + } + + SettingsConfigPtr Settings::getSettingsConfig() + { + return mSettingsConfig; } void Settings::reset() { AIAccess(Globals::get())->invalidateCallSites(); - delete sSettings; - sSettings = new AIThreadSafeSimpleDC; + mSettingsConfig = new SettingsConfig(); } - AIThreadSafeSimple* Settings::saveAndReset() + SettingsStoragePtr Settings::saveAndReset() { - AIAccess(Globals::get())->invalidateCallSites(); - AIThreadSafeSimple* originalSettings = sSettings; - sSettings = new AIThreadSafeSimpleDC; - return originalSettings; + SettingsStoragePtr oldSettingsConfig(mSettingsConfig.get()); + reset(); + return oldSettingsConfig; } - void Settings::restore(AIThreadSafeSimple* originalSettings) + void Settings::restore(SettingsStoragePtr pSettingsStorage) { AIAccess(Globals::get())->invalidateCallSites(); - delete sSettings; - sSettings = originalSettings; + SettingsConfigPtr newSettingsConfig(dynamic_cast(pSettingsStorage.get())); + mSettingsConfig = newSettingsConfig; } } namespace LLError { CallSite::CallSite(ELevel level, - const char* file, - int line, - const std::type_info& class_info, - const char* function, - const char* broadTag, - const char* narrowTag, - bool printOnce) - : mLevel(level), mFile(file), mLine(line), - mClassInfo(class_info), mFunction(function), - mCached(false), mShouldLog(false), - mBroadTag(broadTag), mNarrowTag(narrowTag), mPrintOnce(printOnce) - { } + const char* file, + int line, + const std::type_info& class_info, + const char* function, + bool printOnce, + const char** tags, + size_t tag_count) + : mLevel(level), + mFile(file), + mLine(line), + mClassInfo(class_info), + mFunction(function), + mCached(false), + mShouldLog(false), + mPrintOnce(printOnce), + mTags(new const char*[tag_count]), + mTagCount(tag_count) + { + for (int i = 0; i < tag_count; i++) + { + mTags[i] = tags[i]; + } + switch (mLevel) + { + case LEVEL_DEBUG: mLevelString = "DEBUG:"; break; + case LEVEL_INFO: mLevelString = "INFO:"; break; + case LEVEL_WARN: mLevelString = "WARNING:"; break; + case LEVEL_ERROR: mLevelString = "ERROR:"; break; + default: mLevelString = "XXX:"; break; + }; + + mLocationString = llformat("%s(%d) :", abbreviateFile(mFile).c_str(), mLine); + if (mFunction) + { +#if LL_WINDOWS + // DevStudio: __FUNCTION__ already includes the full class name +#else +#if LL_LINUX + // gross, but typeid comparison seems to always fail here with gcc4.1 + if (0 != strcmp(mClassInfo.name(), typeid(NoClassInfo).name())) +#else + if (mClassInfo != typeid(NoClassInfo)) +#endif // LL_LINUX + { + mFunctionString = className(mClassInfo) + "::"; + } +#endif + mFunctionString += std::string(mFunction) + ":"; + for (size_t i = 0; i < mTagCount; i++) + { + mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " "); + } + } + } + + CallSite::~CallSite() + { + delete []mTags; + } void CallSite::invalidate() - { mCached = false; } + { + mCached = false; + } } namespace @@ -543,21 +646,24 @@ namespace } - void commonInit(const std::string& dir) + void commonInit(const std::string& dir, bool log_to_stderr = true) { - LLError::Settings::reset(); + AIAccess(LLError::Settings::get())->reset(); LLError::setDefaultLevel(LLError::LEVEL_INFO); LLError::setFatalFunction(LLError::crashAndLoop); LLError::setTimeFunction(LLError::utcTime); - if (shouldLogToStderr()) + // log_to_stderr is only false in the unit and integration tests to keep builds quieter + if (log_to_stderr && shouldLogToStderr()) { - LLError::addRecorder(new RecordToStderr(stderrLogWantsTime())); + LLError::RecorderPtr recordToStdErr(new RecordToStderr(stderrLogWantsTime())); + LLError::addRecorder(recordToStdErr); } #if LL_WINDOWS - LLError::addRecorder(new RecordToWinDebug); + LLError::RecorderPtr recordToWinDebug(new RecordToWinDebug()); + LLError::addRecorder(recordToWinDebug); #endif LogControlFile& e = LogControlFile::fromDirectory(dir); @@ -585,18 +691,19 @@ namespace LLError } commonInit(dir); #if !LL_WINDOWS - addRecorder(new RecordToSyslog(identity)); + LLError::RecorderPtr recordToSyslog(new RecordToSyslog(identity)); + addRecorder(recordToSyslog); #endif } - void initForApplication(const std::string& dir) + void initForApplication(const std::string& dir, bool log_to_stderr) { - commonInit(dir); + commonInit(dir, log_to_stderr); } void setPrintLocation(AIAccess const& settings_w, bool print) { - settings_w->printLocation = print; + settings_w->getSettingsConfig()->mPrintLocation = print; } void setPrintLocation(bool print) @@ -606,23 +713,23 @@ namespace LLError void setFatalFunction(const FatalFunction& f) { - AIAccess(Settings::get())->crashFunction = f; + AIAccess(Settings::get())->getSettingsConfig()->mCrashFunction = f; } FatalFunction getFatalFunction() { - return AIAccess(Settings::get())->crashFunction; + return AIAccess(Settings::get())->getSettingsConfig()->mCrashFunction; } void setTimeFunction(TimeFunction f) { - AIAccess(Settings::get())->timeFunction = f; + AIAccess(Settings::get())->getSettingsConfig()->mTimeFunction = f; } void setDefaultLevel(AIAccess const& settings_w, ELevel level) { AIAccess(Globals::get())->invalidateCallSites(); - settings_w->defaultLevel = level; + settings_w->getSettingsConfig()->mDefaultLevel = level; } void setDefaultLevel(ELevel level) @@ -633,29 +740,27 @@ namespace LLError void setFunctionLevel(const std::string& function_name, ELevel level) { AIAccess(Globals::get())->invalidateCallSites(); - AIAccess(Settings::get())->functionLevelMap[function_name] = level; + AIAccess(Settings::get())->getSettingsConfig()->mFunctionLevelMap[function_name] = level; } void setClassLevel(const std::string& class_name, ELevel level) { AIAccess(Globals::get())->invalidateCallSites(); - AIAccess(Settings::get())->classLevelMap[class_name] = level; + AIAccess(Settings::get())->getSettingsConfig()->mClassLevelMap[class_name] = level; } void setFileLevel(const std::string& file_name, ELevel level) { AIAccess(Globals::get())->invalidateCallSites(); - AIAccess(Settings::get())->fileLevelMap[file_name] = level; + AIAccess(Settings::get())->getSettingsConfig()->mFileLevelMap[file_name] = level; } void setTagLevel(const std::string& tag_name, ELevel level) { AIAccess(Globals::get())->invalidateCallSites(); - AIAccess(Settings::get())->tagLevelMap[tag_name] = level; + AIAccess(Settings::get())->getSettingsConfig()->mTagLevelMap[tag_name] = level; } -} -namespace { LLError::ELevel decodeLevel(std::string name) { static LevelMap level_names; @@ -674,13 +779,15 @@ namespace { LevelMap::const_iterator i = level_names.find(name); if (i == level_names.end()) { - llwarns << "unrecognized logging level: '" << name << "'" << llendl; + LL_WARNS() << "unrecognized logging level: '" << name << "'" << LL_ENDL; return LLError::LEVEL_INFO; } return i->second; } - +} + +namespace { void setLevels(LevelMap& map, const LLSD& list, LLError::ELevel level) { LLSD::array_const_iterator i, end; @@ -697,11 +804,13 @@ namespace LLError { AIAccess settings_w(Settings::get()); AIAccess(Globals::get())->invalidateCallSites(); - settings_w->functionLevelMap.clear(); - settings_w->classLevelMap.clear(); - settings_w->fileLevelMap.clear(); - settings_w->tagLevelMap.clear(); - settings_w->uniqueLogMessages.clear(); + SettingsConfigPtr s = settings_w->getSettingsConfig(); + + s->mFunctionLevelMap.clear(); + s->mClassLevelMap.clear(); + s->mFileLevelMap.clear(); + s->mTagLevelMap.clear(); + s->mUniqueLogMessages.clear(); setPrintLocation(settings_w, config["print-location"]); setDefaultLevel(settings_w, decodeLevel(config["default-level"])); @@ -714,10 +823,10 @@ namespace LLError ELevel level = decodeLevel(entry["level"]); - setLevels(settings_w->functionLevelMap, entry["functions"], level); - setLevels(settings_w->classLevelMap, entry["classes"], level); - setLevels(settings_w->fileLevelMap, entry["files"], level); - setLevels(settings_w->tagLevelMap, entry["tags"], level); + setLevels(s->mFunctionLevelMap, entry["functions"], level); + setLevels(s->mClassLevelMap, entry["classes"], level); + setLevels(s->mFileLevelMap, entry["files"], level); + setLevels(s->mTagLevelMap, entry["tags"], level); } } } @@ -725,41 +834,75 @@ namespace LLError namespace LLError { + Recorder::Recorder() + : mWantsTime(false), + mWantsTags(false), + mWantsLevel(true), + mWantsLocation(false), + mWantsFunctionName(true) + { + } + Recorder::~Recorder() - { } + { + } + + bool Recorder::wantsTime() + { + return mWantsTime; + } // virtual - bool Recorder::wantsTime() - { return false; } - - - - void addRecorder(AIAccess const& settings_w, Recorder* recorder) + bool Recorder::wantsTags() { - if (recorder == NULL) + return mWantsTags; + } + + // virtual + bool Recorder::wantsLevel() + { + return mWantsLevel; + } + + // virtual + bool Recorder::wantsLocation() + { + return mWantsLocation; + } + + // virtual + bool Recorder::wantsFunctionName() + { + return mWantsFunctionName; + } + + void addRecorder(AIAccess const& settings_w, RecorderPtr recorder) + { + if (!recorder) { return; } - settings_w->recorders.push_back(recorder); + SettingsConfigPtr s = settings_w->getSettingsConfig(); + s->mRecorders.push_back(recorder); } - - void addRecorder(Recorder* recorder) + + void addRecorder(RecorderPtr recorder) { addRecorder(AIAccess(Settings::get()), recorder); } - void removeRecorder(AIAccess const& settings_w, Recorder* recorder) + void removeRecorder(AIAccess const& settings_w, RecorderPtr recorder) { - if (recorder == NULL) + if (!recorder) { return; } - settings_w->recorders.erase( - std::remove(settings_w->recorders.begin(), settings_w->recorders.end(), recorder), - settings_w->recorders.end()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); + s->mRecorders.erase(std::remove(s->mRecorders.begin(), s->mRecorders.end(), recorder), + s->mRecorders.end()); } - void removeRecorder(Recorder* recorder) + void removeRecorder(RecorderPtr recorder) { removeRecorder(AIAccess(Settings::get()), recorder); } @@ -770,110 +913,100 @@ namespace LLError void logToFile(const std::string& file_name) { AIAccess settings_w(Settings::get()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); - removeRecorder(settings_w, settings_w->fileRecorder); - delete settings_w->fileRecorder; - settings_w->fileRecorder = NULL; - settings_w->fileRecorderFileName.clear(); + removeRecorder(s->mFileRecorder); + s->mFileRecorder.reset(); + s->mFileRecorderFileName.clear(); if (file_name.empty()) { return; } - RecordToFile* f = new RecordToFile(file_name); - if (!f->okay()) + RecorderPtr recordToFile(new RecordToFile(file_name)); + if (boost::dynamic_pointer_cast(recordToFile)->okay()) { - delete f; - return; + s->mFileRecorderFileName = file_name; + s->mFileRecorder = recordToFile; + addRecorder(recordToFile); } - - settings_w->fileRecorderFileName = file_name; - settings_w->fileRecorder = f; - addRecorder(settings_w, f); } void logToFixedBuffer(LLLineBuffer* fixedBuffer) { AIAccess settings_w(Settings::get()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); - removeRecorder(settings_w, settings_w->fixedBufferRecorder); - delete settings_w->fixedBufferRecorder; - settings_w->fixedBufferRecorder = NULL; + removeRecorder(s->mFixedBufferRecorder); + s->mFixedBufferRecorder.reset(); if (!fixedBuffer) { return; } - settings_w->fixedBufferRecorder = new RecordToFixedBuffer(fixedBuffer); - addRecorder(settings_w, settings_w->fixedBufferRecorder); + RecorderPtr recordToFixedBuffer(new RecordToFixedBuffer(fixedBuffer)); + s->mFixedBufferRecorder = recordToFixedBuffer; + addRecorder(recordToFixedBuffer); } std::string logFileName() { - return AIAccess(Settings::get())->fileRecorderFileName; + AIAccess settings_w(Settings::get()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); + return s->mFileRecorderFileName; } } namespace { - void writeToRecorders(AIAccess const& settings_w, LLError::ELevel level, const std::string& message) + void writeToRecorders(AIAccess& settings_w, const LLError::CallSite& site, const std::string& message, bool show_location = true, bool show_time = true, bool show_tags = true, bool show_level = true, bool show_function = true) { - std::string messageWithTime; - - for (Recorders::const_iterator i = settings_w->recorders.begin(); - i != settings_w->recorders.end(); + LLError::ELevel level = site.mLevel; + LLError::SettingsConfigPtr s = settings_w->getSettingsConfig(); + + for (Recorders::const_iterator i = s->mRecorders.begin(); + i != s->mRecorders.end(); ++i) { - LLError::Recorder* r = *i; + LLError::RecorderPtr r = *i; - if (r->wantsTime() && settings_w->timeFunction != NULL) + std::ostringstream message_stream; + + if (show_location && (r->wantsLocation() || level == LLError::LEVEL_ERROR || s->mPrintLocation)) { - if (messageWithTime.empty()) + message_stream << site.mLocationString << " "; + } + + if (show_time && r->wantsTime() && s->mTimeFunction != NULL) + { + message_stream << s->mTimeFunction() << " "; + } + + if (show_level && r->wantsLevel()) { - messageWithTime = settings_w->timeFunction() + " " + message; + message_stream << site.mLevelString << " "; } - r->recordMessage(level, messageWithTime); - } - else + if (show_tags && r->wantsTags()) { - r->recordMessage(level, message); + message_stream << site.mTagString << " "; } + + if (show_function && r->wantsFunctionName()) + { + message_stream << site.mFunctionString << " "; + } + + message_stream << message; + + r->recordMessage(level, message_stream.str()); } } } -/* -Recorder formats: - -$type = "ERROR" | "WARNING" | "ALERT" | "INFO" | "DEBUG" -$loc = "$file($line)" -$msg = "$loc : " if FATAL or printing loc - "" otherwise -$msg += "$type: " -$msg += contents of stringstream - -$time = "%Y-%m-%dT%H:%M:%SZ" if UTC - or "%Y-%m-%dT%H:%M:%S %Z" if local - -syslog: "$msg" -file: "$time $msg\n" -stderr: "$time $msg\n" except on windows, "$msg\n" -fixedbuf: "$msg" -winddebug: "$msg\n" - -Note: if FATAL, an additional line gets logged first, with $msg set to - "$loc : error" - -You get: - llfoo.cpp(42) : error - llfoo.cpp(42) : ERROR: something - -*/ - LLGlobalMutex gLogMutex; LLGlobalMutex gCallStacksLogMutex; @@ -881,14 +1014,41 @@ namespace { bool checkLevelMap(const LevelMap& map, const std::string& key, LLError::ELevel& level) { + bool stop_checking; LevelMap::const_iterator i = map.find(key); if (i == map.end()) { - return false; + return stop_checking = false; } level = i->second; - return true; + return stop_checking = true; + } + + bool checkLevelMap( const LevelMap& map, + const char *const * keys, + size_t count, + LLError::ELevel& level) + { + bool found_level = false; + + LLError::ELevel tag_level = LLError::LEVEL_NONE; + + for (size_t i = 0; i < count; i++) + { + LevelMap::const_iterator it = map.find(keys[i]); + if (it != map.end()) + { + found_level = true; + tag_level = llmin(tag_level, it->second); + } + } + + if (found_level) + { + level = tag_level; + } + return found_level; } class LogLock @@ -910,6 +1070,7 @@ namespace { mOK = true; return; } + const int MAX_RETRIES = 5; for (int attempts = 0; attempts < MAX_RETRIES; ++attempts) { @@ -951,31 +1112,38 @@ namespace LLError } AIAccess settings_w(Settings::get()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); - settings_w->shouldLogCallCounter += 1; + s->mShouldLogCallCounter++; - std::string class_name = className(site.mClassInfo); + const std::string& class_name = className(site.mClassInfo); std::string function_name; if (site.mFunction) { - function_name = functionName(site.mFunction); - if (site.mClassInfo != typeid(NoClassInfo)) - { - function_name = class_name + "::" + function_name; - } + function_name = functionName(site.mFunction); +#if LL_LINUX + // gross, but typeid comparison seems to always fail here with gcc4.1 + if (0 != strcmp(site.mClassInfo.name(), typeid(NoClassInfo).name())) +#else + if (site.mClassInfo != typeid(NoClassInfo)) +#endif // LL_LINUX + { + function_name = class_name + "::" + function_name; + } } - ELevel compareLevel = settings_w->defaultLevel; + ELevel compareLevel = s->mDefaultLevel; // The most specific match found will be used as the log level, // since the computation short circuits. // So, in increasing order of importance: - // Default < Broad Tag < File < Class < Function < Narrow Tag - ((site.mNarrowTag != NULL) ? checkLevelMap(settings_w->tagLevelMap, site.mNarrowTag, compareLevel) : false) - || (site.mFunction && checkLevelMap(settings_w->functionLevelMap, function_name, compareLevel)) - || checkLevelMap(settings_w->classLevelMap, class_name, compareLevel) - || checkLevelMap(settings_w->fileLevelMap, abbreviateFile(site.mFile), compareLevel) - || ((site.mBroadTag != NULL) ? checkLevelMap(settings_w->tagLevelMap, site.mBroadTag, compareLevel) : false); + // Default < Tags < File < Class < Function + checkLevelMap(s->mFunctionLevelMap, function_name, compareLevel) + || checkLevelMap(s->mClassLevelMap, class_name, compareLevel) + || checkLevelMap(s->mFileLevelMap, abbreviateFile(site.mFile), compareLevel) + || (site.mTagCount > 0 + ? checkLevelMap(s->mTagLevelMap, site.mTags, site.mTagCount, compareLevel) + : false); site.mCached = true; AIAccess(Globals::get())->addCallSite(site); @@ -988,16 +1156,16 @@ namespace LLError LogLock lock; if (lock.ok()) { - AIAccess globals(Globals::get()); + AIAccess g(Globals::get()); - if (!globals->messageStreamInUse) + if (!g->messageStreamInUse) { - globals->messageStreamInUse = true; - return &globals->messageStream; // Returns pointer to member of unlocked object, apparently "protected" by having set globals->messageStreamInUse. + g->messageStreamInUse = true; + return &g->messageStream; } } - return new std::ostringstream; // Holy memory leak. + return new std::ostringstream; } void Log::flush(std::ostringstream* out, char* message) @@ -1018,12 +1186,12 @@ namespace LLError message[127] = '\0' ; } - AIAccess globals(Globals::get()); - if (out == &globals->messageStream) + AIAccess g(Globals::get()); + if (out == &g->messageStream) { - globals->messageStream.clear(); - globals->messageStream.str(""); - globals->messageStreamInUse = false; + g->messageStream.clear(); + g->messageStream.str(""); + g->messageStreamInUse = false; } else { @@ -1041,14 +1209,13 @@ namespace LLError } std::string message = out->str(); - { - AIAccess globals(Globals::get()); - if (out == &globals->messageStream) + AIAccess g(Globals::get()); + if (out == &g->messageStream) { - globals->messageStream.clear(); - globals->messageStream.str(""); - globals->messageStreamInUse = false; + g->messageStream.clear(); + g->messageStream.str(""); + g->messageStreamInUse = false; } else { @@ -1057,75 +1224,40 @@ namespace LLError } AIAccess settings_w(Settings::get()); - + SettingsConfigPtr s = settings_w->getSettingsConfig(); + if (site.mLevel == LEVEL_ERROR) { - std::ostringstream fatalMessage; - fatalMessage << abbreviateFile(site.mFile) - << "(" << site.mLine << ") : error"; - - writeToRecorders(settings_w, site.mLevel, fatalMessage.str()); + writeToRecorders(settings_w, site, "error", true, true, true, false, false); } - - std::ostringstream prefix; - - switch (site.mLevel) - { - case LEVEL_DEBUG: prefix << "DEBUG"; break; - case LEVEL_INFO: prefix << "INFO"; break; - case LEVEL_WARN: prefix << "WARNING"; break; - case LEVEL_ERROR: prefix << "ERROR"; break; - default: prefix << "XXX"; break; - }; + std::ostringstream message_stream; bool need_function = site.mFunction; - if (need_function && site.mBroadTag && *site.mBroadTag != '\0') + if (need_function && !site.mTagString.empty()) { - prefix << "(\"" << site.mBroadTag << "\")"; #if LL_DEBUG // Suppress printing mFunction if mBroadTag is set, starts with // "Plugin " and ends with "child": a debug message from a plugin. - size_t taglen = strlen(site.mBroadTag); - if (taglen >= 12 && strncmp(site.mBroadTag, "Plugin ", 7) == 0 && - strcmp(site.mBroadTag + taglen - 5, "child") == 0) + size_t taglen = site.mTagString.length(); + if (taglen >= 12 && strncmp(site.mTagString.c_str(), "Plugin ", 7) == 0 && + strcmp(site.mTagString.c_str() + taglen - 5, "child") == 0) { need_function = false; } #endif } - prefix << ": "; - - if (need_function) - { - if (settings_w->printLocation) - { - prefix << abbreviateFile(site.mFile) - << "(" << site.mLine << ") : "; - } - -#if LL_WINDOWS - // DevStudio: __FUNCTION__ already includes the full class name -#else - if (site.mClassInfo != typeid(NoClassInfo)) - { - prefix << className(site.mClassInfo) << "::"; - } -#endif - prefix << site.mFunction << ": "; - } - if (site.mPrintOnce) { - std::map::iterator messageIter = settings_w->uniqueLogMessages.find(message); - if (messageIter != settings_w->uniqueLogMessages.end()) + std::map::iterator messageIter = s->mUniqueLogMessages.find(message); + if (messageIter != s->mUniqueLogMessages.end()) { messageIter->second++; unsigned int num_messages = messageIter->second; if (num_messages == 10 || num_messages == 50 || (num_messages % 100) == 0) { - prefix << "ONCE (" << num_messages << "th time seen): "; + message_stream << "ONCE (" << num_messages << "th time seen): "; } else { @@ -1134,61 +1266,32 @@ namespace LLError } else { - prefix << "ONCE: "; - settings_w->uniqueLogMessages[message] = 1; - } - } - - if (site.mPrintOnce) - { - std::map::iterator messageIter = settings_w->uniqueLogMessages.find(message); - if (messageIter != settings_w->uniqueLogMessages.end()) - { - messageIter->second++; - unsigned int num_messages = messageIter->second; - if (num_messages == 10 || num_messages == 50 || (num_messages % 100) == 0) - { - prefix << "ONCE (" << num_messages << "th time seen): "; - } - else - { - return; - } - } - else - { - prefix << "ONCE: "; - settings_w->uniqueLogMessages[message] = 1; + message_stream << "ONCE: "; + s->mUniqueLogMessages[message] = 1; } } - prefix << message; - message = prefix.str(); + message_stream << message; - writeToRecorders(settings_w, site.mLevel, message); + writeToRecorders(settings_w, site, message_stream.str(), true, true, true, true, need_function); - if (site.mLevel == LEVEL_ERROR && settings_w->crashFunction) + if (site.mLevel == LEVEL_ERROR && s->mCrashFunction) { - settings_w->crashFunction(message); + s->mCrashFunction(message_stream.str()); } } } - - - namespace LLError { - class ThreadSafeSettings { }; - - ThreadSafeSettings* saveAndResetSettings() + SettingsStoragePtr saveAndResetSettings() { - return reinterpret_cast(Settings::saveAndReset()); + return AIAccess(Settings::get())->saveAndReset(); } - void restoreSettings(ThreadSafeSettings* s) + void restoreSettings(SettingsStoragePtr pSettingsStorage) { - Settings::restore(reinterpret_cast*>(s)); + return AIAccess(Settings::get())->restore(pSettingsStorage); } std::string removePrefix(std::string& s, const std::string& p) @@ -1234,7 +1337,9 @@ namespace LLError int shouldLogCallCount() { - return AIAccess(Settings::get())->shouldLogCallCounter; + AIAccess settings_w(Settings::get()); + SettingsConfigPtr s = settings_w->getSettingsConfig(); + return s->mShouldLogCallCounter; } #if LL_WINDOWS @@ -1280,20 +1385,35 @@ namespace LLError namespace LLError { - char** LLCallStacks::sBuffer = NULL ; - S32 LLCallStacks::sIndex = 0 ; + char** LLCallStacks::sBuffer = NULL; + S32 LLCallStacks::sIndex = 0; + +#define SINGLE_THREADED 1 class CallStacksLogLock { public: CallStacksLogLock(); ~CallStacksLogLock(); + +#if SINGLE_THREADED + bool ok() const { return true; } +#else bool ok() const { return mOK; } private: bool mLocked; bool mOK; +#endif }; +#if SINGLE_THREADED + CallStacksLogLock::CallStacksLogLock() + { + } + CallStacksLogLock::~CallStacksLogLock() + { + } +#else CallStacksLogLock::CallStacksLogLock() : mLocked(false), mOK(false) { @@ -1302,7 +1422,7 @@ namespace LLError mOK = true; return; } - + const int MAX_RETRIES = 5; for (int attempts = 0; attempts < MAX_RETRIES; ++attempts) { @@ -1328,17 +1448,12 @@ namespace LLError gCallStacksLogMutex.unlock(); } } +#endif //static - void LLCallStacks::push(const char* function, const int line) + void LLCallStacks::allocateStackBuffer() { - CallStacksLogLock lock; - if (!lock.ok()) - { - return; - } - - if(!sBuffer) + if(sBuffer == NULL) { sBuffer = new char*[512] ; sBuffer[0] = new char[512 * 128] ; @@ -1348,6 +1463,31 @@ namespace LLError } sIndex = 0 ; } + } + + void LLCallStacks::freeStackBuffer() + { + if(sBuffer != NULL) + { + delete [] sBuffer[0] ; + delete [] sBuffer ; + sBuffer = NULL ; + } + } + + //static + void LLCallStacks::push(const char* function, const int line) + { + CallStacksLogLock lock; + if (!lock.ok()) + { + return; + } + + if(sBuffer == NULL) + { + allocateStackBuffer(); + } if(sIndex > 511) { @@ -1379,15 +1519,9 @@ namespace LLError return; } - if(!sBuffer) + if(sBuffer == NULL) { - sBuffer = new char*[512] ; - sBuffer[0] = new char[512 * 128] ; - for(S32 i = 1 ; i < 512 ; i++) - { - sBuffer[i] = sBuffer[i-1] + 128 ; - } - sIndex = 0 ; + allocateStackBuffer(); } if(sIndex > 511) @@ -1409,20 +1543,18 @@ namespace LLError if(sIndex > 0) { - llinfos << " ************* PRINT OUT LL CALL STACKS ************* " << llendl ; + LL_INFOS() << " ************* PRINT OUT LL CALL STACKS ************* " << LL_ENDL; while(sIndex > 0) { sIndex-- ; - llinfos << sBuffer[sIndex] << llendl ; + LL_INFOS() << sBuffer[sIndex] << LL_ENDL; } - llinfos << " *************** END OF LL CALL STACKS *************** " << llendl ; + LL_INFOS() << " *************** END OF LL CALL STACKS *************** " << LL_ENDL; } - if(sBuffer) + if(sBuffer != NULL) { - delete[] sBuffer[0] ; - delete[] sBuffer ; - sBuffer = NULL ; + freeStackBuffer(); } } @@ -1431,5 +1563,11 @@ namespace LLError { sIndex = 0 ; } + + //static + void LLCallStacks::cleanup() + { + freeStackBuffer(); + } } diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index f367d5e65..331e08ddc 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -31,9 +31,77 @@ #include #include -#include "llerrorlegacy.h" #include "stdtypes.h" +#include "llpreprocessor.h" +#include + +const int LL_ERR_NOERR = 0; + +// Define one of these for different error levels in release... +// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output. +#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output +#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output. + +#ifdef _DEBUG +#define SHOW_DEBUG +#define SHOW_WARN +#define SHOW_INFO +#define SHOW_ASSERT +#else // _DEBUG + +#ifdef LL_RELEASE_WITH_DEBUG_INFO +#define SHOW_ASSERT +#endif // LL_RELEASE_WITH_DEBUG_INFO + +#ifdef RELEASE_SHOW_DEBUG +#define SHOW_DEBUG +#endif + +#ifdef RELEASE_SHOW_WARN +#define SHOW_WARN +#endif + +#ifdef RELEASE_SHOW_INFO +#define SHOW_INFO +#endif + +#ifdef RELEASE_SHOW_ASSERT +#define SHOW_ASSERT +#endif + +#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*/ + +#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(func) llassert_always_msg(func, #func) + +#ifdef SHOW_ASSERT +#define llassert(func) llassert_always_msg(func, #func) +#define llverify(func) llassert_always_msg(func, #func) +#define ASSERT_ONLY(...) __VA_ARGS__ +#define ASSERT_ONLY_COMMA(...) , __VA_ARGS__ +#else +#define llassert(func) +#define llverify(func) do {if (func) {}} while(0) +#define ASSERT_ONLY(...) +#define ASSERT_ONLY_COMMA(...) +#endif + +#ifdef LL_WINDOWS +#define LL_STATIC_ASSERT(func, msg) static_assert(func, msg) +#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(false, msg) +#else +#define LL_STATIC_ASSERT(func, msg) BOOST_STATIC_ASSERT(func) +#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && false); +#endif /** Error Logging Facility @@ -122,46 +190,62 @@ namespace LLError They are not intended for general use. */ - class CallSite; + struct CallSite; class LL_COMMON_API Log { public: static bool shouldLog(CallSite&); static std::ostringstream* out(); - static void flush(std::ostringstream* out, char* message) ; + static void flush(std::ostringstream* out, char* message); static void flush(std::ostringstream*, const CallSite&); }; - class LL_COMMON_API CallSite + struct LL_COMMON_API CallSite { // Represents a specific place in the code where a message is logged // This is public because it is used by the macros below. It is not // intended for public use. - public: - CallSite(ELevel, const char* file, int line, - const std::type_info& class_info, const char* function, const char* broadTag, const char* narrowTag, bool printOnce); - + CallSite(ELevel level, + const char* file, + int line, + const std::type_info& class_info, + const char* function, + bool print_once, + const char** tags, + size_t tag_count); + + ~CallSite(); + +#ifdef LL_LIBRARY_INCLUDE + bool shouldLog(); +#else // LL_LIBRARY_INCLUDE bool shouldLog() - { return mCached ? mShouldLog : Log::shouldLog(*this); } + { + return mCached + ? mShouldLog + : Log::shouldLog(*this); + } // this member function needs to be in-line for efficiency +#endif // LL_LIBRARY_INCLUDE void invalidate(); - private: // these describe the call site and never change const ELevel mLevel; const char* const mFile; - const int mLine; - const std::type_info& mClassInfo; + const int mLine; + const std::type_info& mClassInfo; const char* const mFunction; - const char* const mBroadTag; - const char* const mNarrowTag; - const bool mPrintOnce; - - // these implement a cache of the call to shouldLog() - bool mCached; - bool mShouldLog; + const char** mTags; + size_t mTagCount; + const bool mPrintOnce; + const char* mLevelString; + std::string mLocationString, + mFunctionString, + mTagString; + bool mCached, + mShouldLog; friend class Log; }; @@ -187,6 +271,9 @@ namespace LLError private: static char** sBuffer ; static S32 sIndex ; + + static void allocateStackBuffer(); + static void freeStackBuffer(); public: static void push(const char* function, const int line) ; @@ -194,21 +281,25 @@ namespace LLError static void print() ; static void clear() ; static void end(std::ostringstream* _out) ; + static void cleanup(); }; } //this is cheaper than llcallstacks if no need to output other variables to call stacks. -#define llpushcallstacks LLError::LLCallStacks::push(__FUNCTION__, __LINE__) -#define llcallstacks \ - {\ +#define LL_PUSH_CALLSTACKS() LLError::LLCallStacks::push(__FUNCTION__, __LINE__) + +#define llcallstacks \ + { \ std::ostringstream* _out = LLError::LLCallStacks::insert(__FUNCTION__, __LINE__) ; \ (*_out) -#define llcallstacksendl \ - LLError::End(); \ + +#define llcallstacksendl \ + LLError::End(); \ LLError::LLCallStacks::end(_out) ; \ } -#define llclearcallstacks LLError::LLCallStacks::clear() -#define llprintcallstacks LLError::LLCallStacks::print() + +#define LL_CLEAR_CALLSTACKS() LLError::LLCallStacks::clear() +#define LL_PRINT_CALLSTACKS() LLError::LLCallStacks::print() /* Class type information for logging @@ -222,83 +313,78 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; // Outside a class declaration, or in class without LOG_CLASS(), this // typedef causes the messages to not be associated with any class. +///////////////////////////////// +// Error Logging Macros +// See top of file for common usage. +///////////////////////////////// +// this macro uses a one-shot do statement to avoid parsing errors when writing control flow statements +// without braces: +// if (condition) LL_INFOS() << "True" << LL_ENDL; else LL_INFOS()() << "False" << LL_ENDL - - -/* - Error Logging Macros - See top of file for common usage. -*/ - -#define lllog(level, broadTag, narrowTag, once, nofunction) \ - do { \ - static LLError::CallSite _site( \ - level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), nofunction ? NULL : __FUNCTION__, broadTag, narrowTag, once);\ - if (LL_UNLIKELY(_site.shouldLog())) \ - { \ - std::ostringstream* _out = LLError::Log::out(); \ +#define lllog(level, once, nofunction, ...) \ + do { \ + const char* tags[] = {"", ##__VA_ARGS__}; \ + ::size_t tag_count = LL_ARRAY_SIZE(tags) - 1; \ + static LLError::CallSite _site( \ + level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), nofunction ? NULL : __FUNCTION__, once, &tags[1], tag_count);\ + if (LL_UNLIKELY(_site.shouldLog())) \ + { \ + std::ostringstream* _out = LLError::Log::out(); \ (*_out) -// DEPRECATED: Don't call directly, use LL_ENDL instead, which actually looks like a macro -#define llendl \ - LLError::End(); \ +//Use this construct if you need to do computation in the middle of a +//message: +// +// LL_INFOS("AgentGesture") << "the agent " << agend_id; +// switch (f) +// { +// case FOP_SHRUGS: LL_CONT << "shrugs"; break; +// case FOP_TAPS: LL_CONT << "points at " << who; break; +// case FOP_SAYS: LL_CONT << "says " << message; break; +// } +// LL_CONT << " for " << t << " seconds" << LL_ENDL; +// +//Such computation is done iff the message will be logged. +#define LL_CONT (*_out) + +#define LL_NEWLINE '\n' + +#define LL_ENDL \ + LLError::End(); \ LLError::Log::flush(_out, _site); \ - } \ + } \ } while(0) -// DEPRECATED: Use the new macros that allow tags and *look* like macros. -#define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false, false) -#define llinfos lllog(LLError::LEVEL_INFO, NULL, NULL, false, false) -#define llwarns lllog(LLError::LEVEL_WARN, NULL, NULL, false, false) -#define llerrs lllog(LLError::LEVEL_ERROR, NULL, NULL, false, false) -#define llcont (*_out) - -// No function name -#define lldebugs_nf lllog(LLError::LEVEL_DEBUG, NULL, NULL, false, true) -#define llinfos_nf lllog(LLError::LEVEL_INFO, NULL, NULL, false, true) -#define llwarns_nf lllog(LLError::LEVEL_WARN, NULL, NULL, false, true) -#define llerrs_nf lllog(LLError::LEVEL_ERROR, NULL, NULL, false, true) - // NEW Macros for debugging, allow the passing of a string tag -// One Tag -#define LL_DEBUGS(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, false, false) -#define LL_INFOS(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, false, false) -#define LL_WARNS(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, false, false) -#define LL_ERRS(broadTag) lllog(LLError::LEVEL_ERROR, broadTag, NULL, false, false) -// Two Tags -#define LL_DEBUGS2(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, false, false) -#define LL_INFOS2(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, false, false) -#define LL_WARNS2(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, false, false) -#define LL_ERRS2(broadTag, narrowTag) lllog(LLError::LEVEL_ERROR, broadTag, narrowTag, false, false) +// Pass comma separated list of tags (currently only supports up to 0, 1, or 2) +#define LL_DEBUGS(...) lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__) +#define LL_INFOS(...) lllog(LLError::LEVEL_INFO, false, false, ##__VA_ARGS__) +#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, false, false, ##__VA_ARGS__) +#define LL_ERRS(...) lllog(LLError::LEVEL_ERROR, false, false, ##__VA_ARGS__) +// alternative to llassert_always that prints explanatory message +#define LL_ERRS_IF(exp, ...) if (exp) LL_ERRS(##__VA_ARGS__) << "(" #exp ")" // Only print the log message once (good for warnings or infos that would otherwise // spam the log file over and over, such as tighter loops). -#define LL_DEBUGS_ONCE(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, true, false) -#define LL_INFOS_ONCE(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, true, false) -#define LL_WARNS_ONCE(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, true, false) -#define LL_DEBUGS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, true, false) -#define LL_INFOS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, true, false) -#define LL_WARNS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, true, false) +#define LL_DEBUGS_ONCE(...) lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__) +#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, false, ##__VA_ARGS__) +#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__) -#define LL_ENDL llendl -#define LL_CONT (*_out) +// No function name +#define LL_DEBUGS_NF(...) lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__) +#define LL_INFOS_NF(...) lllog(LLError::LEVEL_INFO, false, true, ##__VA_ARGS__) +#define LL_WARNS_NF(...) lllog(LLError::LEVEL_WARN, false, true, ##__VA_ARGS__) +#define LL_ERRS_NF(...) lllog(LLError::LEVEL_ERROR, false, true, ##__VA_ARGS__) + +// DEPRECATED: Use the new macros that allow tags and *look* like macros. +#define lldebugs LL_COMPILE_TIME_MESSAGE("Warning: lldebugs deprecated, use LL_DEBUGS() instead") LL_DEBUGS() +#define llinfos LL_COMPILE_TIME_MESSAGE("Warning: llinfos deprecated, use LL_INFOS() instead") LL_INFOS() +#define llwarns LL_COMPILE_TIME_MESSAGE("Warning: llwarns deprecated, use LL_WARNS() instead") LL_WARNS() +#define llerrs LL_COMPILE_TIME_MESSAGE("Warning: llerrs deprecated, use LL_ERRS() instead") LL_ERRS() +#define llcont LL_COMPILE_TIME_MESSAGE("Warning: llcont deprecated, use LL_CONT instead") LL_CONT +#define llendl LL_COMPILE_TIME_MESSAGE("Warning: llendl deprecated, use LL_ENDL instead") LL_ENDL - /* - Use this construct if you need to do computation in the middle of a - message: - - LL_INFOS("AgentGesture") << "the agent " << agend_id; - switch (f) - { - case FOP_SHRUGS: LL_CONT << "shrugs"; break; - case FOP_TAPS: LL_CONT << "points at " << who; break; - case FOP_SAYS: LL_CONT << "says " << message; break; - } - LL_CONT << " for " << t << " seconds" << LL_ENDL; - - Such computation is done iff the message will be logged. - */ #endif // LL_LLERROR_H diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 58a7c9f21..56ac52e5d 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -29,7 +29,10 @@ #define LL_LLERRORCONTROL_H #include "llerror.h" +#include "llpointer.h" +#include "llrefcount.h" #include "boost/function.hpp" +#include "boost/shared_ptr.hpp" #include class LLSD; @@ -62,7 +65,7 @@ namespace LLError // logs to stderr, syslog, and windows debug log // the identity string is used for in the syslog - LL_COMMON_API void initForApplication(const std::string& dir); + LL_COMMON_API void initForApplication(const std::string& dir, bool log_to_stderr = true); // resets all logging settings to defaults needed by applicaitons // logs to stderr and windows debug log // sets up log configuration from the file logcontrol.xml in dir @@ -72,14 +75,16 @@ namespace LLError Settings that control what is logged. Setting a level means log messages at that level or above. */ - + LL_COMMON_API void setPrintLocation(bool); LL_COMMON_API void setDefaultLevel(LLError::ELevel); + LL_COMMON_API ELevel getDefaultLevel(); LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel); LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel); LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel); LL_COMMON_API void setTagLevel(const std::string& file_name, LLError::ELevel); - + + LL_COMMON_API LLError::ELevel decodeLevel(std::string name); LL_COMMON_API void configure(const LLSD&); // the LLSD can configure all of the settings // usually read automatically from the live errorlog.xml file @@ -134,26 +139,34 @@ namespace LLError { // An object that handles the actual output or error messages. public: + Recorder(); virtual ~Recorder(); virtual void recordMessage(LLError::ELevel, const std::string& message) = 0; // use the level for better display, not for filtering - virtual bool wantsTime(); // default returns false - // override and return true if the recorder wants the time string - // included in the text of the message + bool wantsTime(); + bool wantsTags(); + bool wantsLevel(); + bool wantsLocation(); + bool wantsFunctionName(); + + protected: + bool mWantsTime, + mWantsTags, + mWantsLevel, + mWantsLocation, + mWantsFunctionName; }; + typedef boost::shared_ptr RecorderPtr; + /** - * @NOTE: addRecorder() conveys ownership to the underlying Settings - * object -- when destroyed, it will @em delete the passed Recorder*! + * @NOTE: addRecorder() and removeRecorder() uses the boost::shared_ptr to allow for shared ownership + * while still ensuring that the allocated memory is eventually freed */ - LL_COMMON_API void addRecorder(Recorder*); - /** - * @NOTE: removeRecorder() reclaims ownership of the Recorder*: its - * lifespan becomes the caller's problem. - */ - LL_COMMON_API void removeRecorder(Recorder*); + LL_COMMON_API void addRecorder(RecorderPtr); + LL_COMMON_API void removeRecorder(RecorderPtr); // each error message is passed to each recorder via recordMessage() LL_COMMON_API void logToFile(const std::string& filename); @@ -170,13 +183,12 @@ namespace LLError Utilities for use by the unit tests of LLError itself. */ - class ThreadSafeSettings; - LL_COMMON_API ThreadSafeSettings* saveAndResetSettings(); - LL_COMMON_API void restoreSettings(ThreadSafeSettings *); - + typedef LLPointer SettingsStoragePtr; + LL_COMMON_API SettingsStoragePtr saveAndResetSettings(); + LL_COMMON_API void restoreSettings(SettingsStoragePtr pSettingsStorage); + LL_COMMON_API std::string abbreviateFile(const std::string& filePath); LL_COMMON_API int shouldLogCallCount(); - }; #endif // LL_LLERRORCONTROL_H diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h index 146aa9206..730733109 100644 --- a/indra/llcommon/llerrorlegacy.h +++ b/indra/llcommon/llerrorlegacy.h @@ -97,9 +97,9 @@ const int LL_ERR_PRICE_MISMATCH = -23018; #define llendflush llendl -#define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl; +#define llerror(msg, num) LL_ERRS() << "Error # " << num << ": " << msg << LL_ENDL; -#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl; +#define llwarning(msg, num) LL_WARNS() << "Warning # " << num << ": " << msg << LL_ENDL; #define liru_slashpos std::string(__FILE__).find_last_of("/\\") #define liru_slashpos2 std::string(__FILE__).substr(0,liru_slashpos).find_last_of("/\\") @@ -108,7 +108,7 @@ const int LL_ERR_PRICE_MISMATCH = -23018; : 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*/ -#define llassert_always(func) do { if (LL_UNLIKELY(!(func))) llerrs << "\nASSERT(" #func ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << llendl; } while(0) +#define llassert_always(func) do { if (LL_UNLIKELY(!(func))) LL_ERRS() << "\nASSERT(" #func ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << LL_ENDL; } while(0) #ifdef SHOW_ASSERT #define llassert(func) llassert_always(func) diff --git a/indra/llcommon/llerrorthread.cpp b/indra/llcommon/llerrorthread.cpp index e03faf0d1..c996f9da0 100644 --- a/indra/llcommon/llerrorthread.cpp +++ b/indra/llcommon/llerrorthread.cpp @@ -65,7 +65,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite exited = true; if (do_logging) { - llinfos << "get_child_status - Child exited cleanly with return of " << process_status << llendl; + LL_INFOS() << "get_child_status - Child exited cleanly with return of " << process_status << LL_ENDL; } return; } @@ -75,15 +75,15 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite exited = true; if (do_logging) { - llinfos << "get_child_status - Child died because of uncaught signal " << process_status << llendl; + LL_INFOS() << "get_child_status - Child died because of uncaught signal " << process_status << LL_ENDL; #ifdef WCOREDUMP if (WCOREDUMP(waitpid_status)) { - llinfos << "get_child_status - Child dumped core" << llendl; + LL_INFOS() << "get_child_status - Child dumped core" << LL_ENDL; } else { - llinfos << "get_child_status - Child didn't dump core" << llendl; + LL_INFOS() << "get_child_status - Child didn't dump core" << LL_ENDL; } #endif } @@ -93,7 +93,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite { // This is weird. I just dump the waitpid status into the status code, // not that there's any way of telling what it is... - llinfos << "get_child_status - Got SIGCHILD but child didn't exit" << llendl; + LL_INFOS() << "get_child_status - Got SIGCHILD but child didn't exit" << LL_ENDL; process_status = waitpid_status; } @@ -106,7 +106,7 @@ void LLErrorThread::run() // This thread sits and waits for the sole purpose // of waiting for the signal/exception handlers to flag the // application state as APP_STATUS_ERROR. - llinfos << "thread_error - Waiting for an error" << llendl; + LL_INFOS() << "thread_error - Waiting for an error" << LL_ENDL; S32 counter = 0; #if !LL_WINDOWS @@ -124,7 +124,7 @@ void LLErrorThread::run() last_sig_child_count = current_sig_child_count; if (LLApp::sLogInSignal) { - llinfos << "thread_error handling SIGCHLD #" << current_sig_child_count << llendl; + LL_INFOS() << "thread_error handling SIGCHLD #" << current_sig_child_count << LL_ENDL; } for (LLApp::child_map::iterator iter = LLApp::sChildMap.begin(); iter != LLApp::sChildMap.end();) { @@ -141,7 +141,7 @@ void LLErrorThread::run() { if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Running child callback" << llendl; + LL_INFOS() << "Signal handler - Running child callback" << LL_ENDL; } child_info.mCallback(child_pid, exited, status); } @@ -172,7 +172,7 @@ void LLErrorThread::run() { if (LLApp::sLogInSignal) { - llinfos << "Signal handler - Running default child callback" << llendl; + LL_INFOS() << "Signal handler - Running default child callback" << LL_ENDL; } LLApp::sDefaultChildCallback(child_pid, true, status); } diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 4f8fb1d3f..cefc7a883 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -61,7 +61,7 @@ #include "llsd.h" #include "llsingleton.h" #include "lldependencies.h" -#include "ll_template_cast.h" +#include "llstl.h" /*==========================================================================*| // override this to allow binding free functions with more parameters diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 81726be89..e776c559b 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -569,8 +569,8 @@ void LLFastTimer::NamedTimer::buildHierarchy() { // since ancestors have already been visited, reparenting won't affect tree traversal //step up tree, bringing our descendants with us - //llinfos << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << - // " to child of " << timerp->getParent()->getParent()->getName() << llendl; + //LL_INFOS() << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << + // " to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL; timerp->setParent(timerp->getParent()->getParent()); timerp->getFrameState().mMoveUpTree = false; @@ -662,12 +662,12 @@ void LLFastTimer::NamedTimer::resetFrame() static S32 call_count = 0; if (call_count % 100 == 0) { - llinfos << "countsPerSecond (32 bit): " << countsPerSecond() << llendl; - llinfos << "get_clock_count (64 bit): " << get_clock_count() << llendl; - llinfos << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << llendl; - llinfos << "getCPUClockCount32() " << getCPUClockCount32() << llendl; - llinfos << "getCPUClockCount64() " << getCPUClockCount64() << llendl; - llinfos << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << llendl; + LL_INFOS() << "countsPerSecond (32 bit): " << countsPerSecond() << LL_ENDL; + LL_INFOS() << "get_clock_count (64 bit): " << get_clock_count() << LL_ENDL; + LL_INFOS() << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << LL_ENDL; + LL_INFOS() << "getCPUClockCount32() " << getCPUClockCount32() << LL_ENDL; + LL_INFOS() << "getCPUClockCount64() " << getCPUClockCount64() << LL_ENDL; + LL_INFOS() << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << LL_ENDL; } call_count++; @@ -851,7 +851,7 @@ void LLFastTimer::nextFrame() U64 frame_time = getCPUClockCount64(); if ((frame_time - sLastFrameTime) >> 8 > 0xffffffff) { - llinfos << "Slow frame, fast timers inaccurate" << llendl; + LL_INFOS() << "Slow frame, fast timers inaccurate" << LL_ENDL; } if (!sPauseHistory) @@ -896,7 +896,7 @@ void LLFastTimer::dumpCurTimes() << std::setprecision(3) << total_time_ms << " ms, " << timerp->getHistoricalCalls(0) << " calls"; - llinfos << out_str.str() << llendl; + LL_INFOS() << out_str.str() << LL_ENDL; } } diff --git a/indra/llcommon/llformat.h b/indra/llcommon/llformat.h index 1cf3bfcca..e2c9cbf7b 100644 --- a/indra/llcommon/llformat.h +++ b/indra/llcommon/llformat.h @@ -35,7 +35,7 @@ #define LL_LLFORMAT_H // Use as follows: -// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl; +// LL_INFOS() << llformat("Test:%d (%.2f %.2f)", idx, x, y) << LL_ENDL; // // *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun) // should perhaps be replaced with boost::format. diff --git a/indra/llcommon/llheartbeat.cpp b/indra/llcommon/llheartbeat.cpp index 0ae1d73cb..f5b9aacd5 100644 --- a/indra/llcommon/llheartbeat.cpp +++ b/indra/llcommon/llheartbeat.cpp @@ -98,7 +98,7 @@ LLHeartbeat::rawSendWithTimeout(F32 timeout_sec) mTimeoutTimer.setTimerExpirySec(timeout_sec); do { result = rawSend(); - //llinfos << " HEARTSENDc=" << result << llendl; + //LL_INFOS() << " HEARTSENDc=" << result << LL_ENDL; } while (result==1 && !mTimeoutTimer.hasExpired()); return result; @@ -118,7 +118,7 @@ LLHeartbeat::send(F32 timeout_sec) // zero-timeout; we don't care too much whether our // heartbeat was digested. result = rawSend(); - //llinfos << " HEARTSENDb=" << result << llendl; + //LL_INFOS() << " HEARTSENDb=" << result << LL_ENDL; } } @@ -146,14 +146,14 @@ LLHeartbeat::send(F32 timeout_sec) // It's been ages since we successfully had a heartbeat // digested by the watchdog. Sit here and spin a while // in the hope that we can force it through. - llwarns << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl; + LL_WARNS() << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL; result = rawSendWithTimeout(mAggressiveHeartbeatMaxBlockingSecs); if (result == 0) { total_success = true; } else { // we couldn't even force it through. That's bad, // but we'll try again in a while. - llwarns << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl; + LL_WARNS() << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL; } // in any case, reset the panic timer. diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index dbd4eba7a..aa2f4eb28 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -100,13 +100,13 @@ namespace LLInitParam void Parser::parserWarning(const std::string& message) { if (mParseSilently) return; - llwarns << message << llendl; + LL_WARNS() << message << LL_ENDL; } void Parser::parserError(const std::string& message) { if (mParseSilently) return; - llerrs << message << llendl; + LL_ERRS() << message << LL_ENDL; } @@ -131,7 +131,7 @@ namespace LLInitParam std::string name(char_name); if ((size_t)param->mParamHandle > mMaxParamOffset) { - llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl; + LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << LL_ENDL; } if (name.empty()) @@ -214,7 +214,7 @@ namespace LLInitParam { if (emit_errors) { - llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl; + LL_WARNS() << "Invalid param \"" << getParamName(block_data, param) << "\"" << LL_ENDL; } return false; } @@ -417,7 +417,7 @@ namespace LLInitParam // Block if ((size_t)handle > block_data.mMaxParamOffset) { - llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl; + LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << LL_ENDL; } ParamDescriptorPtr param_descriptor = findParamDescriptor(param); diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 729f066fb..485c65e68 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -31,7 +31,7 @@ #include #include -#include "string_table.h" +#include "llstringtable.h" #include "llerror.h" // llassert_always #include #include diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp index 75bdfee8b..ceea02267 100644 --- a/indra/llcommon/llliveappconfig.cpp +++ b/indra/llcommon/llliveappconfig.cpp @@ -53,8 +53,8 @@ LLLiveAppConfig::~LLLiveAppConfig() // virtual bool LLLiveAppConfig::loadFile() { - llinfos << "LLLiveAppConfig::loadFile(): reading from " - << filename() << llendl; + LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from " + << filename() << LL_ENDL; llifstream file(filename()); LLSD config; if (file.is_open()) @@ -62,15 +62,15 @@ bool LLLiveAppConfig::loadFile() LLSDSerialize::fromXML(config, file); if(!config.isMap()) { - llwarns << "Live app config not an map in " << filename() - << " Ignoring the data." << llendl; + LL_WARNS() << "Live app config not an map in " << filename() + << " Ignoring the data." << LL_ENDL; return false; } file.close(); } else { - llinfos << "Live file " << filename() << " does not exit." << llendl; + LL_INFOS() << "Live file " << filename() << " does not exit." << LL_ENDL; } // *NOTE: we do not handle the else case here because we would not // have attempted to load the file unless LLLiveFile had diff --git a/indra/llcommon/lllocalidhashmap.h b/indra/llcommon/lllocalidhashmap.h index a58ae2e7e..0d22dd1aa 100644 --- a/indra/llcommon/lllocalidhashmap.h +++ b/indra/llcommon/lllocalidhashmap.h @@ -250,11 +250,11 @@ void LLLocalIDHashMap::dumpIter() { if (mIters[i]) { - llinfos << i << " " << mIters[i]->mCurHashNodep << " " << mIters[i]->mCurHashNodeKey << llendl; + LL_INFOS() << i << " " << mIters[i]->mCurHashNodep << " " << mIters[i]->mCurHashNodeKey << LL_ENDL; } else { - llinfos << i << "null" << llendl; + LL_INFOS() << i << "null" << LL_ENDL; } } } @@ -701,7 +701,7 @@ void LLLocalIDHashMap::removeIter(LLLocalIDHashMapIter @@ -717,7 +717,7 @@ void LLLocalIDHashMap::addIter(LLLocalIDHashMapIterupdateStatistics() ; } - llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ; - llinfos << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << llendl ; - llinfos << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << llendl ; - llinfos << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << llendl ; + LL_INFOS() << "Current allocated physical memory(KB): " << sAllocatedMemInKB << LL_ENDL ; + LL_INFOS() << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << LL_ENDL ; + LL_INFOS() << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << LL_ENDL ; + LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ; - llinfos << "--- private pool information -- " << llendl ; - llinfos << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << llendl ; - llinfos << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << llendl ; + LL_INFOS() << "--- private pool information -- " << LL_ENDL ; + LL_INFOS() << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << LL_ENDL ; + LL_INFOS() << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << LL_ENDL ; } //return 0: everything is normal; @@ -257,7 +257,7 @@ U64 LLMemory::getCurrentRSS() if (!GetProcessMemoryInfo(self, &counters, sizeof(counters))) { - llwarns << "GetProcessMemoryInfo failed" << llendl; + LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL; return 0; } @@ -295,7 +295,7 @@ U32 LLMemory::getWorkingSetSize() // if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1) // { -// llwarns << "Couldn't get page size" << llendl; +// LL_WARNS() << "Couldn't get page size" << LL_ENDL; // return 0; // } else { // return page_size; @@ -314,11 +314,11 @@ U64 LLMemory::getCurrentRSS() // If we ever wanted it, the process virtual size is also available as: // virtualSize = basicInfo.virtual_size; -// llinfos << "resident size is " << residentSize << llendl; +// LL_INFOS() << "resident size is " << residentSize << LL_ENDL; } else { - llwarns << "task_info failed" << llendl; + LL_WARNS() << "task_info failed" << LL_ENDL; } return residentSize; @@ -339,7 +339,7 @@ U64 LLMemory::getCurrentRSS() if (fp == NULL) { - llwarns << "couldn't open " << statPath << llendl; + LL_WARNS() << "couldn't open " << statPath << LL_ENDL; goto bail; } @@ -352,7 +352,7 @@ U64 LLMemory::getCurrentRSS() &rss); if (ret != 1) { - llwarns << "couldn't parse contents of " << statPath << llendl; + LL_WARNS() << "couldn't parse contents of " << statPath << LL_ENDL; rss = 0; } } @@ -382,12 +382,12 @@ U64 LLMemory::getCurrentRSS() sprintf(path, "/proc/%d/psinfo", (int)getpid()); int proc_fd = -1; if((proc_fd = open(path, O_RDONLY)) == -1){ - llwarns << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << llendl; + LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL; return 0; } psinfo_t proc_psinfo; if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){ - llwarns << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << llendl; + LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL; close(proc_fd); return 0; } @@ -955,7 +955,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() total_size += blk_list[i]->getBufferSize() ; if((U32)blk_list[i]->getBuffer() < (U32)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize()) { - llerrs << "buffer corrupted." << llendl ; + LL_ERRS() << "buffer corrupted." << LL_ENDL ; } } @@ -976,32 +976,32 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump() } else { - llerrs << "gap happens" << llendl ; + LL_ERRS() << "gap happens" << LL_ENDL ; } } #endif #if 0 - llinfos << "---------------------------" << llendl ; - llinfos << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << llendl ; + LL_INFOS() << "---------------------------" << LL_ENDL ; + LL_INFOS() << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << LL_ENDL ; - llinfos << "available blocks ... " << llendl ; + LL_INFOS() << "available blocks ... " << LL_ENDL ; for(S32 i = 0 ; i < mBlockLevels ; i++) { LLMemoryBlock* blk = mAvailBlockList[i] ; while(blk) { - llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ; + LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; blk = blk->mNext ; } } - llinfos << "free blocks ... " << llendl ; + LL_INFOS() << "free blocks ... " << LL_ENDL ; for(S32 i = 0 ; i < mPartitionLevels ; i++) { LLMemoryBlock* blk = mFreeSpaceList[i] ; while(blk) { - llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ; + LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ; blk = blk->mNext ; } } @@ -1397,7 +1397,7 @@ char* LLPrivateMemoryPool::allocate(U32 size) if(to_log) { - llwarns << "The memory pool overflows, now using heap directly!" << llendl ; + LL_WARNS() << "The memory pool overflows, now using heap directly!" << LL_ENDL ; to_log = false ; } @@ -1490,7 +1490,7 @@ void LLPrivateMemoryPool::destroyPool() if(mNumOfChunks > 0) { - llwarns << "There is some memory not freed when destroy the memory pool!" << llendl ; + LL_WARNS() << "There is some memory not freed when destroy the memory pool!" << LL_ENDL ; } mNumOfChunks = 0 ; @@ -1508,11 +1508,11 @@ bool LLPrivateMemoryPool::checkSize(U32 asked_size) { if(mReservedPoolSize + asked_size > mMaxPoolSize) { - llinfos << "Max pool size: " << mMaxPoolSize << llendl ; - llinfos << "Total reserved size: " << mReservedPoolSize + asked_size << llendl ; - llinfos << "Total_allocated Size: " << getTotalAllocatedSize() << llendl ; + LL_INFOS() << "Max pool size: " << mMaxPoolSize << LL_ENDL ; + LL_INFOS() << "Total reserved size: " << mReservedPoolSize + asked_size << LL_ENDL ; + LL_INFOS() << "Total_allocated Size: " << getTotalAllocatedSize() << LL_ENDL ; - //llerrs << "The pool is overflowing..." << llendl ; + //LL_ERRS() << "The pool is overflowing..." << LL_ENDL ; return false ; } @@ -1725,7 +1725,7 @@ void LLPrivateMemoryPool::removeFromHashTable(LLMemoryChunk* chunk) void LLPrivateMemoryPool::rehash() { - llinfos << "new hash factor: " << mHashFactor << llendl ; + LL_INFOS() << "new hash factor: " << mHashFactor << LL_ENDL ; mChunkHashList.clear() ; mChunkHashList.resize(mHashFactor) ; @@ -1805,7 +1805,7 @@ void LLPrivateMemoryPool::LLChunkHashElement::remove(LLPrivateMemoryPool::LLMemo } else { - llerrs << "This slot does not contain this chunk!" << llendl ; + LL_ERRS() << "This slot does not contain this chunk!" << LL_ENDL ; } } @@ -1837,12 +1837,12 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager() #if __DEBUG_PRIVATE_MEM__ if(!sMemAllocationTracker.empty()) { - llwarns << "there is potential memory leaking here. The list of not freed memory blocks are from: " <first << " : " << iter->second << llendl ; + LL_INFOS() << k++ << ", " << (U32)iter->first << " : " << iter->second << LL_ENDL ; } sMemAllocationTracker.clear() ; } @@ -2038,7 +2038,7 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr } else { - llerrs << "private pool is used before initialized.!" << llendl ; + LL_ERRS() << "private pool is used before initialized.!" << LL_ENDL ; } } } @@ -2112,7 +2112,7 @@ void LLPrivateMemoryPoolTester::test(U32 min_size, U32 max_size, U32 stride, U32 //allocate space for p ; if(!(p = ::new char**[times]) || !(*p = ::new char*[times * levels])) { - llerrs << "memory initialization for p failed" << llendl ; + LL_ERRS() << "memory initialization for p failed" << LL_ENDL ; } //init @@ -2184,8 +2184,8 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times) { LLTimer timer ; - llinfos << " -**********************- " << llendl ; - llinfos << "test size: " << size << " test times: " << times << llendl ; + LL_INFOS() << " -**********************- " << LL_ENDL ; + LL_INFOS() << "test size: " << size << " test times: " << times << LL_ENDL ; timer.reset() ; char** p = new char*[times] ; @@ -2197,7 +2197,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times) p[i] = ALLOCATE_MEM(sPool, size) ; if(!p[i]) { - llerrs << "allocation failed" << llendl ; + LL_ERRS() << "allocation failed" << LL_ENDL ; } } //de-allocation @@ -2206,7 +2206,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times) FREE_MEM(sPool, p[i]) ; p[i] = NULL ; } - llinfos << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << llendl ; + LL_INFOS() << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << LL_ENDL ; timer.reset() ; @@ -2217,7 +2217,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times) p[i] = ::new char[size] ; if(!p[i]) { - llerrs << "allocation failed" << llendl ; + LL_ERRS() << "allocation failed" << LL_ENDL ; } } //de-allocation @@ -2226,7 +2226,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times) ::delete[] p[i] ; p[i] = NULL ; } - llinfos << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << llendl ; + LL_INFOS() << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << LL_ENDL ; delete[] p; } diff --git a/indra/llcommon/llmemorystream.cpp b/indra/llcommon/llmemorystream.cpp index 5c01c955a..9ba926db7 100644 --- a/indra/llcommon/llmemorystream.cpp +++ b/indra/llcommon/llmemorystream.cpp @@ -51,7 +51,7 @@ void LLMemoryStreamBuf::reset(const U8* start, S32 length) int LLMemoryStreamBuf::underflow() { - //lldebugs << "LLMemoryStreamBuf::underflow()" << llendl; + //LL_DEBUGS() << "LLMemoryStreamBuf::underflow()" << LL_ENDL; if(gptr() < egptr()) { return *gptr(); diff --git a/indra/llcommon/llmetrics.cpp b/indra/llcommon/llmetrics.cpp index 30e5d435a..3d0982efc 100644 --- a/indra/llcommon/llmetrics.cpp +++ b/indra/llcommon/llmetrics.cpp @@ -71,7 +71,7 @@ void LLMetricsImpl::recordEventDetails(const std::string& location, metrics["location"] = location; metrics["stats"] = stats; - llinfos << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << llendl; + LL_INFOS() << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << LL_ENDL; } // Store this: @@ -134,7 +134,7 @@ void LLMetricsImpl::printTotals(LLSD metadata) out_sd["stats"] = stats; - llinfos << "LLMETRICS: AGGREGATE: " << LLSDOStreamer(out_sd) << llendl; + LL_INFOS() << "LLMETRICS: AGGREGATE: " << LLSDOStreamer(out_sd) << LL_ENDL; } LLMetrics::LLMetrics() diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index 335a191be..6d3640526 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -35,7 +35,7 @@ #include -#include "string_table.h" +#include "llstringtable.h" template class LLNameTable diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index affa04060..d3f2b3d13 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -157,7 +157,7 @@ protected: tempp->unref(); if (mPointer != NULL) { - llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; + LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); } } diff --git a/indra/llcommon/llpriqueuemap.h b/indra/llcommon/llpriqueuemap.h index a861ac1be..c4b5f2c32 100644 --- a/indra/llcommon/llpriqueuemap.h +++ b/indra/llcommon/llpriqueuemap.h @@ -90,7 +90,7 @@ public: pqm_iter iter = mMap.find(LLPQMKey(priority, data)); if (iter != mMap.end()) { - llerrs << "Pushing already existing data onto queue!" << llendl; + LL_ERRS() << "Pushing already existing data onto queue!" << LL_ENDL; } #endif mMap.insert(pqm_pair(LLPQMKey(priority, data), data)); @@ -118,14 +118,14 @@ public: iter = mMap.find(cur_key); if (iter == mMap.end()) { - llwarns << "Data not on priority queue!" << llendl; + LL_WARNS() << "Data not on priority queue!" << LL_ENDL; // OK, try iterating through all of the data and seeing if we just screwed up the priority // somehow. for (iter = mMap.begin(); iter != mMap.end(); iter++) { if ((*(iter)).second == data) { - llerrs << "Data on priority queue but priority not matched!" << llendl; + LL_ERRS() << "Data on priority queue but priority not matched!" << LL_ENDL; } } return; diff --git a/indra/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp index 8e146e035..9940d37d6 100644 --- a/indra/llcommon/llprocesslauncher.cpp +++ b/indra/llcommon/llprocesslauncher.cpp @@ -135,7 +135,7 @@ int LLProcessLauncher::launch(void) char message[256]; wcstombs(message, error_str, 256); message[255] = 0; - llwarns << "CreateProcessA failed: " << message << llendl; + LL_WARNS() << "CreateProcessA failed: " << message << LL_ENDL; LocalFree(error_str); } @@ -285,7 +285,7 @@ static std::string read_pipe(apr_file_t* in, bool timeout_ok = false) { return "TIMEOUT"; } - llwarns << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << llendl; + LL_WARNS() << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << LL_ENDL; assert(APR_STATUS_IS_EOF(status)); return "END OF FILE"; } @@ -293,13 +293,13 @@ static std::string read_pipe(apr_file_t* in, bool timeout_ok = false) status = apr_file_read_full(in, buf, bytes_to_read, &bytes_read); if (status != APR_SUCCESS) { - llwarns << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << llendl; + LL_WARNS() << "apr_file_read_full: " << apr_strerror(status, buf, sizeof(buf)) << LL_ENDL; assert(status == APR_SUCCESS); // Fail } assert(bytes_read == bytes_to_read); std::string received(buf, bytes_read); - llinfos << "Received: \"" << received << "\" (bytes read: " << bytes_read << ")" << llendl; + LL_INFOS() << "Received: \"" << received << "\" (bytes read: " << bytes_read << ")" << LL_ENDL; return received; } @@ -423,7 +423,7 @@ int LLProcessLauncher::launch(void) if (message != "TIMEOUT" && message != "END OF FILE") { // Most likely execv failed. - llwarns << message << llendl; + LL_WARNS() << message << LL_ENDL; assert(false); // Fail in debug mode. } } diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index d5ec7b075..5c731c691 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -706,7 +706,7 @@ private: __cpuid(0x1, eax, ebx, ecx, edx); if(feature_infos[0] != (S32)edx) { - llerrs << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << llendl; + LL_ERRS() << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << LL_ENDL; } #endif // LL_RELEASE_FOR_DOWNLOAD diff --git a/indra/llcommon/llptrskiplist.h b/indra/llcommon/llptrskiplist.h deleted file mode 100644 index 68781657d..000000000 --- a/indra/llcommon/llptrskiplist.h +++ /dev/null @@ -1,730 +0,0 @@ -/** - * @file llptrskiplist.h - * @brief Skip list implementation. - * - * $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$ - */ - -#ifndef LL_LLPTRSKIPLIST_H -#define LL_LLPTRSKIPLIST_H - -#include "llerror.h" -#include "llrand.h" -//#include "vmath.h" -#include "llrand.h" - -///////////////////////////////////////////// -// -// LLPtrSkipList implementation - skip list for pointers to objects -// - -template -class LLPtrSkipList -{ -public: - friend class LLPtrSkipNode; - - // basic constructor - LLPtrSkipList(); - // basic constructor including sorter - LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second), - BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second)); - ~LLPtrSkipList(); - - inline void setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second)); - inline void setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second)); - - inline BOOL addData(DATA_TYPE *data); - - inline BOOL checkData(const DATA_TYPE *data); - - inline S32 getLength(); // returns number of items in the list - NOT constant time! - - inline BOOL removeData(const DATA_TYPE *data); - - // note that b_sort is ignored - inline BOOL moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort); - - inline BOOL moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort); - - // resort -- use when the value we're sorting by changes - /* IW 12/6/02 - This doesn't work! - Instead, remove the data BEFORE you change it - Then re-insert it after you change it - BOOL resortData(DATA_TYPE *data) - */ - - // remove all nodes from the list but do not delete data - inline void removeAllNodes(); - - inline BOOL deleteData(const DATA_TYPE *data); - - // remove all nodes from the list and delete data - inline void deleteAllData(); - - // place mCurrentp on first node - inline void resetList(); - - // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - inline DATA_TYPE *getCurrentData(); - - // same as getCurrentData() but a more intuitive name for the operation - inline DATA_TYPE *getNextData(); - - // remove the Node at mCurentOperatingp - // leave mCurrentp and mCurentOperatingp on the next entry - inline void removeCurrentData(); - - // delete the Node at mCurentOperatingp - // leave mCurrentp and mCurentOperatingp on the next entry - inline void deleteCurrentData(); - - // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - inline DATA_TYPE *getFirstData(); - - // TRUE if nodes are not in sorted order - inline BOOL corrupt(); - -protected: - class LLPtrSkipNode - { - public: - LLPtrSkipNode() - : mData(NULL) - { - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mForward[i] = NULL; - } - } - - LLPtrSkipNode(DATA_TYPE *data) - : mData(data) - { - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mForward[i] = NULL; - } - } - - ~LLPtrSkipNode() - { - if (mData) - { - llerror("Attempting to call LLPtrSkipNode destructor with a non-null mDatap!", 1); - } - } - - // delete associated data and NULLs out pointer - void deleteData() - { - delete mData; - mData = NULL; - } - - // NULLs out pointer - void removeData() - { - mData = NULL; - } - - DATA_TYPE *mData; - LLPtrSkipNode *mForward[BINARY_DEPTH]; - }; - - static BOOL defaultEquals(const DATA_TYPE *first, const DATA_TYPE *second) - { - return first == second; - } - - - LLPtrSkipNode mHead; - LLPtrSkipNode *mUpdate[BINARY_DEPTH]; - LLPtrSkipNode *mCurrentp; - LLPtrSkipNode *mCurrentOperatingp; - S32 mLevel; - BOOL (*mInsertFirst)(const DATA_TYPE *first, const DATA_TYPE *second); - BOOL (*mEquals)(const DATA_TYPE *first, const DATA_TYPE *second); -}; - - -// basic constructor -template -LLPtrSkipList::LLPtrSkipList() - : mInsertFirst(NULL), mEquals(defaultEquals) -{ - if (BINARY_DEPTH < 2) - { - llerrs << "Trying to create skip list with too little depth, " - "must be 2 or greater" << llendl; - } - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mUpdate[i] = NULL; - } - mLevel = 1; - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -// basic constructor including sorter -template -LLPtrSkipList::LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second), - BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second)) - :mInsertFirst(insert_first), mEquals(equals) -{ - if (BINARY_DEPTH < 2) - { - llerrs << "Trying to create skip list with too little depth, " - "must be 2 or greater" << llendl; - } - mLevel = 1; - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -template -inline LLPtrSkipList::~LLPtrSkipList() -{ - removeAllNodes(); -} - -template -inline void LLPtrSkipList::setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second)) -{ - mInsertFirst = insert_first; -} - -template -inline void LLPtrSkipList::setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second)) -{ - mEquals = equals; -} - -template -inline BOOL LLPtrSkipList::addData(DATA_TYPE *data) -{ - S32 level; - LLPtrSkipNode *current = &mHead; - LLPtrSkipNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mData, data))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mData < data)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - // now add the new node - S32 newlevel; - for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++) - { - if (ll_frand() < 0.5f) - break; - } - - LLPtrSkipNode *snode = new LLPtrSkipNode(data); - - if (newlevel > mLevel) - { - mHead.mForward[mLevel] = NULL; - mUpdate[mLevel] = &mHead; - mLevel = newlevel; - } - - for (level = 0; level < newlevel; level++) - { - snode->mForward[level] = mUpdate[level]->mForward[level]; - mUpdate[level]->mForward[level] = snode; - } - return TRUE; -} - -template -inline BOOL LLPtrSkipList::checkData(const DATA_TYPE *data) -{ - S32 level; - LLPtrSkipNode *current = &mHead; - LLPtrSkipNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mData, data))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mData < data)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (current) - { - return mEquals(current->mData, data); - } - else - { - return FALSE; - } -} - -// returns number of items in the list -template -inline S32 LLPtrSkipList::getLength() -{ - U32 length = 0; - for (LLPtrSkipNode* temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0]) - { - length++; - } - return length; -} - -template -inline BOOL LLPtrSkipList::removeData(const DATA_TYPE *data) -{ - S32 level; - LLPtrSkipNode *current = &mHead; - LLPtrSkipNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mData, data))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mData < data)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (!current) - { - // empty list or beyond the end! - return FALSE; - } - - // is this the one we want? - if (!mEquals(current->mData, data)) - { - // nope! - return FALSE; - } - else - { - // yes it is! change pointers as required - for (level = 0; level < mLevel; level++) - { - if (mUpdate[level]->mForward[level] != current) - { - // cool, we've fixed all the pointers! - break; - } - mUpdate[level]->mForward[level] = current->mForward[level]; - } - - // clean up cuurent - current->removeData(); - delete current; - - // clean up mHead - while ( (mLevel > 1) - &&(!mHead.mForward[mLevel - 1])) - { - mLevel--; - } - } - return TRUE; -} - -// note that b_sort is ignored -template -inline BOOL LLPtrSkipList::moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort) -{ - BOOL removed = removeData(data); - BOOL added = newlist->addData(data); - return removed && added; -} - -template -inline BOOL LLPtrSkipList::moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort) -{ - if (mCurrentOperatingp) - { - mCurrentp = mCurrentOperatingp->mForward[0]; - BOOL removed = removeData(mCurrentOperatingp); - BOOL added = newlist->addData(mCurrentOperatingp); - mCurrentOperatingp = mCurrentp; - return removed && added; - } - return FALSE; -} - -// resort -- use when the value we're sorting by changes -/* IW 12/6/02 - This doesn't work! - Instead, remove the data BEFORE you change it - Then re-insert it after you change it -BOOL resortData(DATA_TYPE *data) -{ - removeData(data); - addData(data); -} -*/ - -// remove all nodes from the list but do not delete data -template -inline void LLPtrSkipList::removeAllNodes() -{ - LLPtrSkipNode *temp; - // reset mCurrentp - mCurrentp = *(mHead.mForward); - - while (mCurrentp) - { - temp = mCurrentp->mForward[0]; - mCurrentp->removeData(); - delete mCurrentp; - mCurrentp = temp; - } - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -template -inline BOOL LLPtrSkipList::deleteData(const DATA_TYPE *data) -{ - S32 level; - LLPtrSkipNode *current = &mHead; - LLPtrSkipNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mData, data))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mData < data)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (!current) - { - // empty list or beyond the end! - return FALSE; - } - - // is this the one we want? - if (!mEquals(current->mData, data)) - { - // nope! - return FALSE; - } - else - { - // do we need to fix current or currentop? - if (current == mCurrentp) - { - mCurrentp = current->mForward[0]; - } - - if (current == mCurrentOperatingp) - { - mCurrentOperatingp = current->mForward[0]; - } - - // yes it is! change pointers as required - for (level = 0; level < mLevel; level++) - { - if (mUpdate[level]->mForward[level] != current) - { - // cool, we've fixed all the pointers! - break; - } - mUpdate[level]->mForward[level] = current->mForward[level]; - } - - // clean up cuurent - current->deleteData(); - delete current; - - // clean up mHead - while ( (mLevel > 1) - &&(!mHead.mForward[mLevel - 1])) - { - mLevel--; - } - } - return TRUE; -} - -// remove all nodes from the list and delete data -template -inline void LLPtrSkipList::deleteAllData() -{ - LLPtrSkipNode *temp; - // reset mCurrentp - mCurrentp = *(mHead.mForward); - - while (mCurrentp) - { - temp = mCurrentp->mForward[0]; - mCurrentp->deleteData(); - delete mCurrentp; - mCurrentp = temp; - } - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -// place mCurrentp on first node -template -inline void LLPtrSkipList::resetList() -{ - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -inline DATA_TYPE *LLPtrSkipList::getCurrentData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = *mCurrentp->mForward; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes compile warning - return 0; // equivalent, but no warning - } -} - -// same as getCurrentData() but a more intuitive name for the operation -template -inline DATA_TYPE *LLPtrSkipList::getNextData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = *mCurrentp->mForward; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes compile warning - return 0; // equivalent, but no warning - } -} - -// remove the Node at mCurentOperatingp -// leave mCurrentp and mCurentOperatingp on the next entry -template -inline void LLPtrSkipList::removeCurrentData() -{ - if (mCurrentOperatingp) - { - removeData(mCurrentOperatingp->mData); - } -} - -// delete the Node at mCurentOperatingp -// leave mCurrentp and mCurentOperatingp on the next entry -template -inline void LLPtrSkipList::deleteCurrentData() -{ - if (mCurrentOperatingp) - { - deleteData(mCurrentOperatingp->mData); - } -} - -// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -inline DATA_TYPE *LLPtrSkipList::getFirstData() -{ - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes compile warning - return 0; // equivalent, but no warning - } -} - -template -inline BOOL LLPtrSkipList::corrupt() -{ - LLPtrSkipNode *previous = mHead.mForward[0]; - - // Empty lists are not corrupt. - if (!previous) return FALSE; - - LLPtrSkipNode *current = previous->mForward[0]; - while(current) - { - if (!mInsertFirst(previous->mData, current->mData)) - { - // prev shouldn't be in front of cur! - return TRUE; - } - current = current->mForward[0]; - } - return FALSE; -} - -#endif diff --git a/indra/llcommon/llptrskipmap.h b/indra/llcommon/llptrskipmap.h deleted file mode 100644 index 20d001990..000000000 --- a/indra/llcommon/llptrskipmap.h +++ /dev/null @@ -1,1245 +0,0 @@ -/** - * @file llptrskipmap.h - * @brief Just like a LLSkipMap, but since it's pointers, you can call - * deleteAllData - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-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$ - */ -#ifndef LL_LLPTRSKIPMAP_H -#define LL_LLPTRSKIPMAP_H - -#include "llerror.h" -#include "llrand.h" - -template -class LLPtrSkipMapNode -{ -public: - LLPtrSkipMapNode() - { - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mForward[i] = NULL; - } - - U8 *zero = (U8 *)&mIndex; - - for (i = 0; i < (S32)sizeof(INDEX_T); i++) - { - *(zero + i) = 0; - } - - zero = (U8 *)&mData; - - for (i = 0; i < (S32)sizeof(DATA_T); i++) - { - *(zero + i) = 0; - } - } - - LLPtrSkipMapNode(const INDEX_T &index) - : mIndex(index) - { - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mForward[i] = NULL; - } - - U8 *zero = (U8 *)&mData; - - for (i = 0; i < (S32)sizeof(DATA_T); i++) - { - *(zero + i) = 0; - } - } - - LLPtrSkipMapNode(const INDEX_T &index, DATA_T datap) - : mIndex(index) - { - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mForward[i] = NULL; - } - - mData = datap; - } - - ~LLPtrSkipMapNode() - { - } - - // delete associated data and NULLs out pointer - void deleteData() - { - delete mData; - mData = 0; - } - - // NULLs out pointer - void removeData() - { - mData = 0; - } - - INDEX_T mIndex; - DATA_T mData; - LLPtrSkipMapNode *mForward[BINARY_DEPTH]; - -private: - // Disallow copying of LLPtrSkipMapNodes by not implementing these methods. - LLPtrSkipMapNode(const LLPtrSkipMapNode &); - LLPtrSkipMapNode &operator=(const LLPtrSkipMapNode &rhs); -}; - -//--------------------------------------------------------------------------- - -template -class LLPtrSkipMap -{ -public: - typedef BOOL (*compare)(const DATA_T& first, const DATA_T& second); - typedef compare insert_func; - typedef compare equals_func; - - void init(); - - // basic constructor - LLPtrSkipMap(); - - // basic constructor including sorter - LLPtrSkipMap(insert_func insert_first, equals_func equals); - - ~LLPtrSkipMap(); - - void setInsertFirst(insert_func insert_first); - void setEquals(equals_func equals); - - DATA_T &addData(const INDEX_T &index, DATA_T datap); - DATA_T &addData(const INDEX_T &index); - DATA_T &getData(const INDEX_T &index); - DATA_T &operator[](const INDEX_T &index); - - // If index present, returns data. - // If index not present, adds and returns NULL. - DATA_T &getData(const INDEX_T &index, BOOL &b_new_entry); - - // returns data entry before and after index - BOOL getInterval(const INDEX_T &index, INDEX_T &index_before, INDEX_T &index_after, - DATA_T &data_before, DATA_T &data_after ); - - // Returns TRUE if data present in map. - BOOL checkData(const INDEX_T &index); - - // Returns TRUE if key is present in map. This is useful if you - // are potentially storing NULL pointers in the map - BOOL checkKey(const INDEX_T &index); - - // If there, returns the data. - // If not, returns NULL. - // Never adds entries to the map. - DATA_T getIfThere(const INDEX_T &index); - - INDEX_T reverseLookup(const DATA_T datap); - - // returns number of items in the list - S32 getLength(); // WARNING! getLength is O(n), not O(1)! - - BOOL removeData(const INDEX_T &index); - BOOL deleteData(const INDEX_T &index); - - // remove all nodes from the list but do not delete data - void removeAllData(); - void deleteAllData(); - - // place mCurrentp on first node - void resetList(); - - // return the data currently pointed to - DATA_T getCurrentDataWithoutIncrement(); - - // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - DATA_T getCurrentData(); - - // same as getCurrentData() but a more intuitive name for the operation - DATA_T getNextData(); - - INDEX_T getNextKey(); - - // return the key currently pointed to - INDEX_T getCurrentKeyWithoutIncrement(); - - // remove the Node at mCurentOperatingp - // leave mCurrentp and mCurentOperatingp on the next entry - void removeCurrentData(); - - void deleteCurrentData(); - - // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp - DATA_T getFirstData(); - - INDEX_T getFirstKey(); - - static BOOL defaultEquals(const INDEX_T &first, const INDEX_T &second) - { - return first == second; - } - -private: - // don't generate implicit copy constructor or copy assignment - LLPtrSkipMap(const LLPtrSkipMap &); - LLPtrSkipMap &operator=(const LLPtrSkipMap &); - -private: - LLPtrSkipMapNode mHead; - LLPtrSkipMapNode *mUpdate[BINARY_DEPTH]; - LLPtrSkipMapNode *mCurrentp; - LLPtrSkipMapNode *mCurrentOperatingp; - S32 mLevel; - BOOL (*mInsertFirst)(const INDEX_T &first, const INDEX_T &second); - BOOL (*mEquals)(const INDEX_T &first, const INDEX_T &second); - S32 mNumberOfSteps; -}; - -////////////////////////////////////////////////// -// -// LLPtrSkipMap implementation -// -// - -template -inline LLPtrSkipMap::LLPtrSkipMap() - : mInsertFirst(NULL), - mEquals(defaultEquals), - mNumberOfSteps(0) -{ - if (BINARY_DEPTH < 2) - { - llerrs << "Trying to create skip list with too little depth, " - "must be 2 or greater" << llendl; - } - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mUpdate[i] = NULL; - } - mLevel = 1; - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -template -inline LLPtrSkipMap::LLPtrSkipMap(insert_func insert_first, - equals_func equals) -: mInsertFirst(insert_first), - mEquals(equals), - mNumberOfSteps(0) -{ - if (BINARY_DEPTH < 2) - { - llerrs << "Trying to create skip list with too little depth, " - "must be 2 or greater" << llendl; - } - mLevel = 1; - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -template -inline LLPtrSkipMap::~LLPtrSkipMap() -{ - removeAllData(); -} - -template -inline void LLPtrSkipMap::setInsertFirst(insert_func insert_first) -{ - mInsertFirst = insert_first; -} - -template -inline void LLPtrSkipMap::setEquals(equals_func equals) -{ - mEquals = equals; -} - -template -inline DATA_T &LLPtrSkipMap::addData(const INDEX_T &index, DATA_T datap) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - // replace the existing data if a node is already there - if ( (current) - &&(mEquals(current->mIndex, index))) - { - current->mData = datap; - return current->mData; - } - - // now add the new node - S32 newlevel; - for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++) - { - if (ll_frand() < 0.5f) - { - break; - } - } - - LLPtrSkipMapNode *snode - = new LLPtrSkipMapNode(index, datap); - - if (newlevel > mLevel) - { - mHead.mForward[mLevel] = NULL; - mUpdate[mLevel] = &mHead; - mLevel = newlevel; - } - - for (level = 0; level < newlevel; level++) - { - snode->mForward[level] = mUpdate[level]->mForward[level]; - mUpdate[level]->mForward[level] = snode; - } - return snode->mData; -} - -template -inline DATA_T &LLPtrSkipMap::addData(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - // now add the new node - S32 newlevel; - for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++) - { - if (ll_frand() < 0.5f) - break; - } - - LLPtrSkipMapNode *snode - = new LLPtrSkipMapNode(index); - - if (newlevel > mLevel) - { - mHead.mForward[mLevel] = NULL; - mUpdate[mLevel] = &mHead; - mLevel = newlevel; - } - - for (level = 0; level < newlevel; level++) - { - snode->mForward[level] = mUpdate[level]->mForward[level]; - mUpdate[level]->mForward[level] = snode; - } - return snode->mData; -} - -template -inline DATA_T &LLPtrSkipMap::getData(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - mNumberOfSteps = 0; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - mNumberOfSteps++; - - if ( (current) - &&(mEquals(current->mIndex, index))) - { - - return current->mData; - } - - // now add the new node - S32 newlevel; - for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++) - { - if (ll_frand() < 0.5f) - break; - } - - LLPtrSkipMapNode *snode - = new LLPtrSkipMapNode(index); - - if (newlevel > mLevel) - { - mHead.mForward[mLevel] = NULL; - mUpdate[mLevel] = &mHead; - mLevel = newlevel; - } - - for (level = 0; level < newlevel; level++) - { - snode->mForward[level] = mUpdate[level]->mForward[level]; - mUpdate[level]->mForward[level] = snode; - } - - return snode->mData; -} - -template -inline BOOL LLPtrSkipMap::getInterval(const INDEX_T &index, - INDEX_T &index_before, - INDEX_T &index_after, - DATA_T &data_before, - DATA_T &data_after) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - mNumberOfSteps = 0; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - - BOOL both_found = TRUE; - - if (current != &mHead) - { - index_before = current->mIndex; - data_before = current->mData; - } - else - { - data_before = 0; - index_before = 0; - both_found = FALSE; - } - - // we're now just in front of where we want to be . . . take one step forward - mNumberOfSteps++; - current = *current->mForward; - - if (current) - { - data_after = current->mData; - index_after = current->mIndex; - } - else - { - data_after = 0; - index_after = 0; - both_found = FALSE; - } - - return both_found; -} - - -template -inline DATA_T &LLPtrSkipMap::operator[](const INDEX_T &index) -{ - - return getData(index); -} - -// If index present, returns data. -// If index not present, adds and returns NULL. -template -inline DATA_T &LLPtrSkipMap::getData(const INDEX_T &index, BOOL &b_new_entry) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - mNumberOfSteps = 0; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - mNumberOfSteps++; - current = *current->mForward; - - if ( (current) - &&(mEquals(current->mIndex, index))) - { - - return current->mData; - } - b_new_entry = TRUE; - addData(index); - - return current->mData; -} - -// Returns TRUE if data present in map. -template -inline BOOL LLPtrSkipMap::checkData(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (current) - { - // Gets rid of some compiler ambiguity for the LLPointer<> templated class. - if (current->mData) - { - return mEquals(current->mIndex, index); - } - } - - return FALSE; -} - -// Returns TRUE if key is present in map. This is useful if you -// are potentially storing NULL pointers in the map -template -inline BOOL LLPtrSkipMap::checkKey(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (current) - { - return mEquals(current->mIndex, index); - } - - return FALSE; -} - -// If there, returns the data. -// If not, returns NULL. -// Never adds entries to the map. -template -inline DATA_T LLPtrSkipMap::getIfThere(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - mNumberOfSteps = 0; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - mNumberOfSteps++; - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - mNumberOfSteps++; - current = *current->mForward; - - if (current) - { - if (mEquals(current->mIndex, index)) - { - return current->mData; - } - } - - // Avoid Linux compiler warning on returning NULL. - return (DATA_T)0; -} - -template -inline INDEX_T LLPtrSkipMap::reverseLookup(const DATA_T datap) -{ - LLPtrSkipMapNode *current = &mHead; - - while (current) - { - if (datap == current->mData) - { - - return current->mIndex; - } - current = *current->mForward; - } - - // not found! return NULL - return INDEX_T(); -} - -// returns number of items in the list -template -inline S32 LLPtrSkipMap::getLength() -{ - U32 length = 0; - LLPtrSkipMapNode* temp; - for (temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0]) - { - length++; - } - - return length; -} - -template -inline BOOL LLPtrSkipMap::removeData(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (!current) - { - // empty list or beyond the end! - - return FALSE; - } - - // is this the one we want? - if (!mEquals(current->mIndex, index)) - { - // nope! - - return FALSE; - } - else - { - // do we need to fix current or currentop? - if (current == mCurrentp) - { - mCurrentp = *current->mForward; - } - - if (current == mCurrentOperatingp) - { - mCurrentOperatingp = *current->mForward; - } - // yes it is! change pointers as required - for (level = 0; level < mLevel; level++) - { - if (*((*(mUpdate + level))->mForward + level) != current) - { - // cool, we've fixed all the pointers! - break; - } - *((*(mUpdate + level))->mForward + level) = *(current->mForward + level); - } - - // clean up cuurent - current->removeData(); - delete current; - - // clean up mHead - while ( (mLevel > 1) - &&(!*(mHead.mForward + mLevel - 1))) - { - mLevel--; - } - } - - return TRUE; -} - -template -inline BOOL LLPtrSkipMap::deleteData(const INDEX_T &index) -{ - S32 level; - LLPtrSkipMapNode *current = &mHead; - LLPtrSkipMapNode *temp; - - // find the pointer one in front of the one we want - if (mInsertFirst) - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(mInsertFirst(temp->mIndex, index))) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - else - { - for (level = mLevel - 1; level >= 0; level--) - { - temp = *(current->mForward + level); - while ( (temp) - &&(temp->mIndex < index)) - { - current = temp; - temp = *(current->mForward + level); - } - *(mUpdate + level) = current; - } - } - - // we're now just in front of where we want to be . . . take one step forward - current = *current->mForward; - - if (!current) - { - // empty list or beyond the end! - - return FALSE; - } - - // is this the one we want? - if (!mEquals(current->mIndex, index)) - { - // nope! - - return FALSE; - } - else - { - // do we need to fix current or currentop? - if (current == mCurrentp) - { - mCurrentp = *current->mForward; - } - - if (current == mCurrentOperatingp) - { - mCurrentOperatingp = *current->mForward; - } - // yes it is! change pointers as required - for (level = 0; level < mLevel; level++) - { - if (*((*(mUpdate + level))->mForward + level) != current) - { - // cool, we've fixed all the pointers! - break; - } - *((*(mUpdate + level))->mForward + level) = *(current->mForward + level); - } - - // clean up cuurent - current->deleteData(); - delete current; - - // clean up mHead - while ( (mLevel > 1) - &&(!*(mHead.mForward + mLevel - 1))) - { - mLevel--; - } - } - - return TRUE; -} - -// remove all nodes from the list but do not delete data -template -void LLPtrSkipMap::removeAllData() -{ - LLPtrSkipMapNode *temp; - // reset mCurrentp - mCurrentp = *(mHead.mForward); - - while (mCurrentp) - { - temp = mCurrentp->mForward[0]; - mCurrentp->removeData(); - delete mCurrentp; - mCurrentp = temp; - } - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -template -inline void LLPtrSkipMap::deleteAllData() -{ - LLPtrSkipMapNode *temp; - // reset mCurrentp - mCurrentp = *(mHead.mForward); - - while (mCurrentp) - { - temp = mCurrentp->mForward[0]; - mCurrentp->deleteData(); - delete mCurrentp; - mCurrentp = temp; - } - - S32 i; - for (i = 0; i < BINARY_DEPTH; i++) - { - mHead.mForward[i] = NULL; - mUpdate[i] = NULL; - } - - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - -// place mCurrentp on first node -template -inline void LLPtrSkipMap::resetList() -{ - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); -} - - -// return the data currently pointed to -template -inline DATA_T LLPtrSkipMap::getCurrentDataWithoutIncrement() -{ - if (mCurrentOperatingp) - { - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes warning - return (DATA_T)0; // equivalent, but no warning - } -} - -// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -inline DATA_T LLPtrSkipMap::getCurrentData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes warning - return (DATA_T)0; // equivalent, but no warning - } -} - -// same as getCurrentData() but a more intuitive name for the operation -template -inline DATA_T LLPtrSkipMap::getNextData() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes compile warning - return (DATA_T)0; // equivalent, but removes warning - } -} - -template -inline INDEX_T LLPtrSkipMap::getNextKey() -{ - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mIndex; - } - else - { - return mHead.mIndex; - } -} - -// return the key currently pointed to -template -inline INDEX_T LLPtrSkipMap::getCurrentKeyWithoutIncrement() -{ - if (mCurrentOperatingp) - { - return mCurrentOperatingp->mIndex; - } - else - { - //return NULL; // causes compile warning - return (INDEX_T)0; // equivalent, but removes warning - } -} - - -// remove the Node at mCurentOperatingp -// leave mCurrentp and mCurentOperatingp on the next entry -template -inline void LLPtrSkipMap::removeCurrentData() -{ - if (mCurrentOperatingp) - { - removeData(mCurrentOperatingp->mIndex); - } -} - -template -inline void LLPtrSkipMap::deleteCurrentData() -{ - if (mCurrentOperatingp) - { - deleteData(mCurrentOperatingp->mIndex); - } -} - -// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp -template -inline DATA_T LLPtrSkipMap::getFirstData() -{ - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mData; - } - else - { - //return NULL; // causes compile warning - return (DATA_T)0; // equivalent, but removes warning - } -} - -template -inline INDEX_T LLPtrSkipMap::getFirstKey() -{ - mCurrentp = *(mHead.mForward); - mCurrentOperatingp = *(mHead.mForward); - if (mCurrentp) - { - mCurrentOperatingp = mCurrentp; - mCurrentp = mCurrentp->mForward[0]; - return mCurrentOperatingp->mIndex; - } - else - { - return mHead.mIndex; - } -} - -#endif diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index e9c0a2493..5ba7b8bd8 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -80,7 +80,7 @@ void LLQueuedThread::shutdown() } if (timeout == 0) { - llwarns << "~LLQueuedThread (" << mName << ") timed out!" << llendl; + LL_WARNS() << "~LLQueuedThread (" << mName << ") timed out!" << LL_ENDL; } } else @@ -101,7 +101,7 @@ void LLQueuedThread::shutdown() } if (active_count) { - llwarns << "~LLQueuedThread() called with active requests: " << active_count << llendl; + LL_WARNS() << "~LLQueuedThread() called with active requests: " << active_count << LL_ENDL; } } @@ -198,11 +198,11 @@ void LLQueuedThread::printQueueStats() if (!mRequestQueue.empty()) { QueuedRequest *req = *mRequestQueue.begin(); - llinfos << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << llendl; + LL_INFOS() << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL; } else { - llinfos << "Queued Thread Idle" << llendl; + LL_INFOS() << "Queued Thread Idle" << LL_ENDL; } unlockData(); } @@ -233,7 +233,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req) mRequestQueue.insert(req); mRequestHash.insert(req); #if _DEBUG -// llinfos << llformat("LLQueuedThread::Added req [%08d]",handle) << llendl; +// LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL; #endif unlockData(); @@ -364,7 +364,7 @@ bool LLQueuedThread::completeRequest(handle_t handle) llassert_always(req->getStatus() != STATUS_QUEUED); llassert_always(req->getStatus() != STATUS_INPROGRESS); #if _DEBUG -// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl; +// LL_INFOS() << llformat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL; #endif if (!(req->getFlags() & FLAG_LOCKED)) { @@ -393,7 +393,7 @@ bool LLQueuedThread::check() { if (entry->getHashKey() > mNextHandle) { - llerrs << "Hash Error" << llendl; + LL_ERRS() << "Hash Error" << LL_ENDL; return false; } entry = entry->getNextEntry(); @@ -564,7 +564,7 @@ void LLQueuedThread::run() } //LLThread::yield(); // thread should yield after each request } - llinfos << "LLQueuedThread " << mName << " EXITING." << llendl; + LL_INFOS() << "LLQueuedThread " << mName << " EXITING." << LL_ENDL; } // virtual diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp index 0956e1628..297c5bb7c 100644 --- a/indra/llcommon/llrefcount.cpp +++ b/indra/llcommon/llrefcount.cpp @@ -60,7 +60,7 @@ LLRefCount::~LLRefCount() { if (mRef != 0) { - llerrs << "deleting non-zero reference" << llendl; + LL_ERRS() << "deleting non-zero reference" << LL_ENDL; } } @@ -70,8 +70,8 @@ void LLRefCount::ref() const if(mMutex.isLocked()) { mCrashAtUnlock = TRUE ; - llerrs << "the mutex is locked by the thread: " << mLockedThreadID - << " Current thread: " << AIThreadID() << llendl ; + LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID + << " Current thread: " << AIThreadID() << LL_ENDL ; } mMutex.lock() ; @@ -91,8 +91,8 @@ S32 LLRefCount::unref() const if(mMutex.isLocked()) { mCrashAtUnlock = TRUE ; - llerrs << "the mutex is locked by the thread: " << mLockedThreadID - << " Current thread: " << AIThreadID() << llendl ; + LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID + << " Current thread: " << AIThreadID() << LL_ENDL ; } mMutex.lock() ; diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index bb0d60247..130e38d71 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -64,7 +64,7 @@ public: { if (mMap.insert(std::make_pair(key, value)).second == false) { - llwarns << "Tried to register " << key << " but it was already registered!" << llendl; + LL_WARNS() << "Tried to register " << key << " but it was already registered!" << LL_ENDL; return false; } return true; @@ -309,7 +309,7 @@ public: { if (singleton_t::instance().exists(key)) { - llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl; + LL_ERRS() << "Duplicate registry entry under key \"" << key << "\"" << LL_ENDL; } singleton_t::instance().mStaticScope->add(key, value); } diff --git a/indra/llcommon/llsafehandle.h b/indra/llcommon/llsafehandle.h index 8d52d9bb1..4226bf04f 100644 --- a/indra/llcommon/llsafehandle.h +++ b/indra/llcommon/llsafehandle.h @@ -134,7 +134,7 @@ protected: tempp->unref(); if (mPointer != NULL) { - llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; + LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; unref(); } } diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 38dff60e6..a61c4ba97 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -82,7 +82,7 @@ void LLSDSerialize::serialize(const LLSD& sd, std::ostream& str, ELLSD_Serialize break; default: - llwarns << "serialize request for unknown ELLSD_Serialize" << llendl; + LL_WARNS() << "serialize request for unknown ELLSD_Serialize" << LL_ENDL; } if (f.notNull()) @@ -170,7 +170,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes) } else { - llwarns << "deserialize request for unknown ELLSD_Serialize" << llendl; + LL_WARNS() << "deserialize request for unknown ELLSD_Serialize" << LL_ENDL; } if (p.notNull()) @@ -180,7 +180,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes) } fail: - llwarns << "deserialize LLSD parse failure" << llendl; + LL_WARNS() << "deserialize LLSD parse failure" << LL_ENDL; return false; } @@ -446,7 +446,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading map." << llendl; + LL_INFOS() << "STREAM FAILURE reading map." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -465,7 +465,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading array." << llendl; + LL_INFOS() << "STREAM FAILURE reading array." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -501,7 +501,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading boolean." << llendl; + LL_INFOS() << "STREAM FAILURE reading boolean." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -527,7 +527,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading boolean." << llendl; + LL_INFOS() << "STREAM FAILURE reading boolean." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -540,7 +540,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const data = integer; if(istr.fail()) { - llinfos << "STREAM FAILURE reading integer." << llendl; + LL_INFOS() << "STREAM FAILURE reading integer." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -554,7 +554,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const data = real; if(istr.fail()) { - llinfos << "STREAM FAILURE reading real." << llendl; + LL_INFOS() << "STREAM FAILURE reading real." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -568,7 +568,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const data = id; if(istr.fail()) { - llinfos << "STREAM FAILURE reading uuid." << llendl; + LL_INFOS() << "STREAM FAILURE reading uuid." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -583,7 +583,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading string." << llendl; + LL_INFOS() << "STREAM FAILURE reading string." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -605,7 +605,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading link." << llendl; + LL_INFOS() << "STREAM FAILURE reading link." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -628,7 +628,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading date." << llendl; + LL_INFOS() << "STREAM FAILURE reading date." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -641,14 +641,14 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading data." << llendl; + LL_INFOS() << "STREAM FAILURE reading data." << LL_ENDL; parse_count = PARSE_FAILURE; } break; default: parse_count = PARSE_FAILURE; - llinfos << "Unrecognized character while parsing: int(" << (int)c + LL_INFOS() << "Unrecognized character while parsing: int(" << (int)c << ")" << LL_ENDL; break; } @@ -910,7 +910,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary map." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary map." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -929,7 +929,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary array." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary array." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -954,7 +954,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const data = (S32)ntohl(value_nbo); if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary integer." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary integer." << LL_ENDL; } break; } @@ -966,7 +966,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const data = ll_ntohd(real_nbo); if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary real." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary real." << LL_ENDL; } break; } @@ -978,7 +978,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const data = id; if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary uuid." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary uuid." << LL_ENDL; } break; } @@ -999,7 +999,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary (notation-style) string." + LL_INFOS() << "STREAM FAILURE reading binary (notation-style) string." << LL_ENDL; parse_count = PARSE_FAILURE; } @@ -1019,7 +1019,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary string." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary string." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -1038,7 +1038,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary link." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary link." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -1051,7 +1051,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const data = LLDate(real); if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary date." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary date." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -1080,7 +1080,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const } if(istr.fail()) { - llinfos << "STREAM FAILURE reading binary." << llendl; + LL_INFOS() << "STREAM FAILURE reading binary." << LL_ENDL; parse_count = PARSE_FAILURE; } break; @@ -1088,7 +1088,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const default: parse_count = PARSE_FAILURE; - llinfos << "Unrecognized character while parsing: int(" << (int)c + LL_INFOS() << "Unrecognized character while parsing: int(" << (int)c << ")" << LL_ENDL; break; } @@ -2059,7 +2059,7 @@ std::string zip_llsd(LLSD& data) S32 ret = deflateInit(&strm, Z_BEST_COMPRESSION); if (ret != Z_OK) { - llwarns << "Failed to compress LLSD block." << llendl; + LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL; return std::string(); } @@ -2086,7 +2086,7 @@ std::string zip_llsd(LLSD& data) if (strm.avail_out >= CHUNK) { free(output); - llwarns << "Failed to compress LLSD block." << llendl; + LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL; return std::string(); } @@ -2098,7 +2098,7 @@ std::string zip_llsd(LLSD& data) else { free(output); - llwarns << "Failed to compress LLSD block." << llendl; + LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL; return std::string(); } } @@ -2115,7 +2115,7 @@ std::string zip_llsd(LLSD& data) LLSD test_sd; if (!unzip_llsd(test_sd, test, result.size())) { - llerrs << "Invalid compression result!" << llendl; + LL_ERRS() << "Invalid compression result!" << LL_ENDL; } #endif @@ -2200,7 +2200,7 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size) if (!LLSDSerialize::fromBinary(data, istr, cur_size)) { - llwarns << "Failed to unzip LLSD block" << llendl; + LL_WARNS() << "Failed to unzip LLSD block" << LL_ENDL; free(result); return false; } diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 6c828d42f..0ffb0e9e1 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -395,7 +395,7 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data) } if (mEmitErrors) { - llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl; + LL_INFOS() << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << LL_ENDL; } data = LLSD(); return LLSDParser::PARSE_FAILURE; @@ -476,7 +476,7 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data) { if (mEmitErrors) { - llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl; + LL_INFOS() << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << LL_ENDL; } return LLSDParser::PARSE_FAILURE; } @@ -538,7 +538,7 @@ void LLSDXMLParser::Impl::parsePart(const char* buf, int len) XML_Status status = XML_Parse(mParser, buf, len, false); if (status == XML_STATUS_ERROR) { - llinfos << "Unexpected XML parsing error at start" << llendl; + LL_INFOS() << "Unexpected XML parsing error at start" << LL_ENDL; } } } diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index a73c9d06f..ff31487ec 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -184,15 +184,15 @@ public: switch (sData.mInitState) { case CONSTRUCTING: - llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << LL_ENDL; + LL_ERRS() << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << LL_ENDL; return NULL; case INITIALIZING: - llwarns << "Using singleton " << typeid(DERIVED_TYPE).name() << " during its own initialization, before its initialization completed!" << LL_ENDL; + LL_WARNS() << "Using singleton " << typeid(DERIVED_TYPE).name() << " during its own initialization, before its initialization completed!" << LL_ENDL; return sData.mInstance; case INITIALIZED: return sData.mInstance; case DELETED: - llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << LL_ENDL; + LL_WARNS() << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << LL_ENDL; case UNINITIALIZED: // This must be the first time we get here. SingletonLifetimeManager::construct(); diff --git a/indra/llcommon/llstack.h b/indra/llcommon/llstack.h index 66175c748..e6642ba21 100644 --- a/indra/llcommon/llstack.h +++ b/indra/llcommon/llstack.h @@ -33,8 +33,6 @@ #ifndef LL_LLSTACK_H #define LL_LLSTACK_H -#include "linked_lists.h" - template class LLStack { private: diff --git a/indra/llcommon/llstat.cpp b/indra/llcommon/llstat.cpp index bbb2b30d7..d47ab9195 100644 --- a/indra/llcommon/llstat.cpp +++ b/indra/llcommon/llstat.cpp @@ -64,7 +64,7 @@ LLStat::LLStat(std::string name, S32 num_bins, BOOL use_frame_timer) { stat_map_t::iterator iter = getStatList().find(mName); if (iter != getStatList().end()) - llwarns << "LLStat with duplicate name: " << mName << llendl; + LL_WARNS() << "LLStat with duplicate name: " << mName << LL_ENDL; getStatList().insert(std::make_pair(mName, this)); } } diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index bd129e8a3..941958d15 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -175,6 +176,49 @@ struct CopyNewPointer } }; +template +void delete_and_clear(std::list& list) +{ + std::for_each(list.begin(), list.end(), DeletePointer()); + list.clear(); +} + +template +void delete_and_clear(std::vector& vector) +{ + std::for_each(vector.begin(), vector.end(), DeletePointer()); + vector.clear(); +} + +template +void delete_and_clear(std::set& set) +{ + std::for_each(set.begin(), set.end(), DeletePointer()); + set.clear(); +} + +template +void delete_and_clear(std::map& map) +{ + std::for_each(map.begin(), map.end(), DeletePairedPointer()); + map.clear(); +} + +template +void delete_and_clear(T*& ptr) +{ + delete ptr; + ptr = NULL; +} + + +template +void delete_and_clear_array(T*& ptr) +{ + delete[] ptr; + ptr = NULL; +} + // helper function which returns true if key is in inmap. template //Singu note: This has been generalized to support a broader range of map-esque containers @@ -537,4 +581,151 @@ namespace std }; } // std + +/** + * Implementation for ll_template_cast() (q.v.). + * + * Default implementation: trying to cast two completely unrelated types + * returns 0. Typically you'd specify T and U as pointer types, but in fact T + * can be any type that can be initialized with 0. + */ +template +struct ll_template_cast_impl +{ + T operator()(U) + { + return 0; + } +}; + +/** + * ll_template_cast(some_value) is for use in a template function when + * some_value might be of arbitrary type, but you want to recognize type T + * specially. + * + * It's designed for use with pointer types. Example: + * @code + * struct SpecialClass + * { + * void someMethod(const std::string&) const; + * }; + * + * template + * void somefunc(const REALCLASS& instance) + * { + * const SpecialClass* ptr = ll_template_cast(&instance); + * if (ptr) + * { + * ptr->someMethod("Call method only available on SpecialClass"); + * } + * } + * @endcode + * + * Why is this better than dynamic_cast<>? Because unless OtherClass is + * polymorphic, the following won't even compile (gcc 4.0.1): + * @code + * OtherClass other; + * SpecialClass* ptr = dynamic_cast(&other); + * @endcode + * to say nothing of this: + * @code + * void function(int); + * SpecialClass* ptr = dynamic_cast(&function); + * @endcode + * ll_template_cast handles these kinds of cases by returning 0. + */ +template +T ll_template_cast(U value) +{ + return ll_template_cast_impl()(value); +} + +/** + * Implementation for ll_template_cast() (q.v.). + * + * Implementation for identical types: return same value. + */ +template +struct ll_template_cast_impl +{ + T operator()(T value) + { + return value; + } +}; + +/** + * LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of + * type @c source, ll_template_cast(s) will return @c s -- + * presuming that @c source can be converted to @c dest by the normal rules of + * C++. + * + * By default, ll_template_cast(s) will return 0 unless @c s's + * type is literally identical to @c dest. (This is because of the + * straightforward application of template specialization rules.) That can + * lead to surprising results, e.g.: + * + * @code + * Foo myFoo; + * const Foo* fooptr = ll_template_cast(&myFoo); + * @endcode + * + * Here @c fooptr will be 0 because &myFoo is of type Foo* + * -- @em not const Foo*. (Declaring const Foo myFoo; would + * force the compiler to do the right thing.) + * + * More disappointingly: + * @code + * struct Base {}; + * struct Subclass: public Base {}; + * Subclass object; + * Base* ptr = ll_template_cast(&object); + * @endcode + * + * Here @c ptr will be 0 because &object is of type + * Subclass* rather than Base*. We @em want this cast to + * succeed, but without our help ll_template_cast can't recognize it. + * + * The following would suffice: + * @code + * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); + * ... + * Base* ptr = ll_template_cast(&object); + * @endcode + * + * However, as noted earlier, this is easily fooled: + * @code + * const Base* ptr = ll_template_cast(&object); + * @endcode + * would still produce 0 because we haven't yet seen: + * @code + * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); + * @endcode + * + * @TODO + * This macro should use Boost type_traits facilities for stripping and + * re-adding @c const and @c volatile qualifiers so that invoking + * LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all + * permitted permutations. It's really not fair to the coder to require + * separate: + * @code + * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*); + * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*); + * LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*); + * @endcode + * + * (Naturally we omit LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*) + * because that's not permitted by normal C++ assignment anyway.) + */ +#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \ +template <> \ +struct ll_template_cast_impl \ +{ \ + DEST operator()(SOURCE wrapper) \ + { \ + return wrapper; \ + } \ +} + + #endif // LL_LLSTL_H diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index d5bc65a63..44c6d1435 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -90,7 +90,7 @@ bool _read_file_into_string(std::string& str, const std::string& filename) llifstream ifs(filename, llifstream::binary); if (!ifs.is_open()) { - llinfos << "Unable to open file " << filename << llendl; + LL_INFOS() << "Unable to open file " << filename << LL_ENDL; return false; } @@ -168,7 +168,7 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars) } else { - llwarns << "Invalid Unicode character " << cur_char << "!" << llendl; + LL_WARNS() << "Invalid Unicode character " << cur_char << "!" << LL_ENDL; *outchars++ = LL_UNKNOWN_CHAR; } return outchars - base; diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp index 2f3a994d8..73573090b 100644 --- a/indra/llcommon/llstringtable.cpp +++ b/indra/llcommon/llstringtable.cpp @@ -323,7 +323,7 @@ void LLStringTable::removeString(const char *str) mUniqueEntries--; if (mUniqueEntries < 0) { - llerror("LLStringTable:removeString trying to remove too many strings!", 0); + LL_ERRS() << "LLStringTable:removeString trying to remove too many strings!" << LL_ENDL; } delete iter->second; mStringHash.erase(iter); @@ -349,7 +349,7 @@ void LLStringTable::removeString(const char *str) mUniqueEntries--; if (mUniqueEntries < 0) { - llerror("LLStringTable:removeString trying to remove too many strings!", 0); + LL_ERRS() << "LLStringTable:removeString trying to remove too many strings!" << LL_ENDL; } strlist->remove(entry); delete entry; diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 766d1bbc0..ba81301e3 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -640,7 +640,7 @@ S32 LLOSInfo::getMaxOpenFiles() } else { - llerrs << "LLOSInfo::getMaxOpenFiles: sysconf error for _SC_OPEN_MAX" << llendl; + LL_ERRS() << "LLOSInfo::getMaxOpenFiles: sysconf error for _SC_OPEN_MAX" << LL_ENDL; } } } @@ -699,12 +699,12 @@ U32 LLOSInfo::getProcessVirtualSizeKB() sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid()); int proc_fd = -1; if((proc_fd = open(proc_ps, O_RDONLY)) == -1){ - llwarns << "unable to open " << proc_ps << llendl; + LL_WARNS() << "unable to open " << proc_ps << LL_ENDL; return 0; } psinfo_t proc_psinfo; if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){ - llwarns << "Unable to read " << proc_ps << llendl; + LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL; close(proc_fd); return 0; } @@ -745,12 +745,12 @@ U32 LLOSInfo::getProcessResidentSizeKB() sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid()); int proc_fd = -1; if((proc_fd = open(proc_ps, O_RDONLY)) == -1){ - llwarns << "unable to open " << proc_ps << llendl; + LL_WARNS() << "unable to open " << proc_ps << LL_ENDL; return 0; } psinfo_t proc_psinfo; if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){ - llwarns << "Unable to read " << proc_ps << llendl; + LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL; close(proc_fd); return 0; } @@ -1482,7 +1482,7 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile) size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst); if (nwrit < (size_t) bytes) { - llwarns << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << llendl; + LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL; goto err; } } while(gzeof(src) == 0); @@ -1515,14 +1515,14 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) { if (gzwrite(dst, buffer, bytes) <= 0) { - llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl; + LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL; goto err; } } if (ferror(src)) { - llwarns << "Error reading " << srcfile << llendl; + LL_WARNS() << "Error reading " << srcfile << LL_ENDL; goto err; } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 7ab4b1f39..3c72bd3e2 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -68,7 +68,7 @@ LL_COMMON_API void assert_main_thread() { if (!AIThreadID::in_main_thread_inline()) { - llerrs << "Illegal execution outside main thread." << llendl; + LL_ERRS() << "Illegal execution outside main thread." << LL_ENDL; } } @@ -110,7 +110,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap // after the AICurlPrivate::curlthread::AICurlThread::run() function // exits and we actually change this variable (which really SHOULD // have been inside the critical area of the mSignal lock)]. - lldebugs << "LLThread::staticRun() Exiting: " << name << llendl; + LL_DEBUGS() << "LLThread::staticRun() Exiting: " << name << LL_ENDL; return NULL; } @@ -146,7 +146,7 @@ void LLThread::shutdown() // First, set the flag that indicates that we're ready to die setQuitting(); - llinfos << "LLThread::shutdown() Killing thread " << mName << " Status: " << mStatus << llendl; + LL_INFOS() << "LLThread::shutdown() Killing thread " << mName << " Status: " << mStatus << LL_ENDL; // Now wait a bit for the thread to exit // It's unclear whether I should even bother doing this - this destructor // should netver get called unless we're already stopped, really... @@ -168,7 +168,7 @@ void LLThread::shutdown() if (!isStopped()) { // This thread just wouldn't stop, even though we gave it time - llwarns << "LLThread::shutdown() exiting thread before clean exit!" << llendl; + LL_WARNS() << "LLThread::shutdown() exiting thread before clean exit!" << LL_ENDL; // Put a stake in its heart. apr_thread_exit(mAPRThreadp, -1); return; @@ -200,7 +200,7 @@ void LLThread::start() { --sRunning; mStatus = STOPPED; - llwarns << "failed to start thread " << mName << llendl; + LL_WARNS() << "failed to start thread " << mName << LL_ENDL; ll_apr_warn_status(status); } } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 1b83c07ce..33b6e9809 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -656,7 +656,7 @@ protected: { if (mRef != 0) { - llerrs << "deleting non-zero reference" << llendl; + LL_ERRS() << "deleting non-zero reference" << LL_ENDL; } } diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp index 05d24944f..427b55bb5 100644 --- a/indra/llcommon/llthreadsafequeue.cpp +++ b/indra/llcommon/llthreadsafequeue.cpp @@ -46,7 +46,7 @@ LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(unsigned int ca LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation() { if(mQueue != 0) { - if(apr_queue_size(mQueue) != 0) llwarns << + if(apr_queue_size(mQueue) != 0) LL_WARNS() << "terminating queue which still contains " << apr_queue_size(mQueue) << " elements;" << "memory will be leaked" << LL_ENDL; apr_queue_term(mQueue); diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 33a5dd2a0..558890901 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -341,7 +341,7 @@ LLURI LLURI::buildHTTP(const std::string& prefix, it != path.endArray(); ++it) { - lldebugs << "PATH: inserting " << it->asString() << llendl; + LL_DEBUGS() << "PATH: inserting " << it->asString() << LL_ENDL; result.mEscapedPath += "/" + escapePathComponent(it->asString()); } } @@ -381,8 +381,8 @@ LLURI LLURI::buildHTTP(const std::string& prefix, } else { - llwarns << "Valid path arguments to buildHTTP are array, string, or undef, you passed type" - << path.type() << llendl; + LL_WARNS() << "Valid path arguments to buildHTTP are array, string, or undef, you passed type" + << path.type() << LL_ENDL; } result.mEscapedOpaque = "//" + result.mEscapedAuthority + result.mEscapedPath; @@ -566,7 +566,7 @@ LLSD LLURI::queryMap() const // static LLSD LLURI::queryMap(std::string escaped_query_string) { - lldebugs << "LLURI::queryMap query params: " << escaped_query_string << llendl; + LL_DEBUGS() << "LLURI::queryMap query params: " << escaped_query_string << LL_ENDL; LLSD result = LLSD::emptyArray(); while(!escaped_query_string.empty()) @@ -592,12 +592,12 @@ LLSD LLURI::queryMap(std::string escaped_query_string) { std::string key = unescape(tuple.substr(0,key_end)); std::string value = unescape(tuple.substr(key_end+1)); - lldebugs << "inserting key " << key << " value " << value << llendl; + LL_DEBUGS() << "inserting key " << key << " value " << value << LL_ENDL; result[key] = value; } else { - lldebugs << "inserting key " << unescape(tuple) << " value true" << llendl; + LL_DEBUGS() << "inserting key " << unescape(tuple) << " value true" << LL_ENDL; result[unescape(tuple)] = true; } } diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 7e9460b23..ce83fbf55 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -215,7 +215,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit) { if(emit) { - llwarns << "Warning! Using broken UUID string format" << llendl; + LL_WARNS() << "Warning! Using broken UUID string format" << LL_ENDL; } broken_format = TRUE; } @@ -225,7 +225,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit) if(emit) { //don't spam the logs because a resident can't spell. - llwarns << "Bad UUID string: " << in_string << llendl; + LL_WARNS() << "Bad UUID string: " << in_string << LL_ENDL; } setNull(); return FALSE; @@ -264,7 +264,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit) { if(emit) { - llwarns << "Invalid UUID string character" << llendl; + LL_WARNS() << "Invalid UUID string character" << LL_ENDL; } setNull(); return FALSE; @@ -289,7 +289,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit) { if(emit) { - llwarns << "Invalid UUID string character" << llendl; + LL_WARNS() << "Invalid UUID string character" << LL_ENDL; } setNull(); return FALSE; diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 8106113df..e66c570f4 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -45,8 +45,8 @@ LLWorkerThread::~LLWorkerThread() // Delete any workers in the delete queue (should be safe - had better be!) if (!mDeleteList.empty()) { - llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size() - << " entries in delete list." << llendl; + LL_WARNS() << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size() + << " entries in delete list." << LL_ENDL; } delete mDeleteMutex; @@ -60,8 +60,8 @@ void LLWorkerThread::clearDeleteList() // Delete any workers in the delete queue (should be safe - had better be!) if (!mDeleteList.empty()) { - llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size() - << " entries in delete list." << llendl; + LL_WARNS() << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size() + << " entries in delete list." << LL_ENDL; mDeleteMutex->lock(); for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter) @@ -137,7 +137,7 @@ LLWorkerThread::handle_t LLWorkerThread::addWorkRequest(LLWorkerClass* workercla bool res = addRequest(req); if (!res) { - llerrs << "add called after LLWorkerThread::cleanupClass()" << llendl; + LL_ERRS() << "add called after LLWorkerThread::cleanupClass()" << LL_ENDL; req->deleteRequest(); handle = nullHandle(); } @@ -203,7 +203,7 @@ LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& na { if (!mWorkerThread) { - llerrs << "LLWorkerClass() called with NULL workerthread: " << name << llendl; + LL_ERRS() << "LLWorkerClass() called with NULL workerthread: " << name << LL_ENDL; } } @@ -217,13 +217,13 @@ LLWorkerClass::~LLWorkerClass() LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle); if (!workreq) { - llerrs << "LLWorkerClass destroyed with stale work handle" << llendl; + LL_ERRS() << "LLWorkerClass destroyed with stale work handle" << LL_ENDL; } if (workreq->getStatus() != LLWorkerThread::STATUS_ABORTED && workreq->getStatus() != LLWorkerThread::STATUS_COMPLETE && !(workreq->getFlags() & LLWorkerThread::FLAG_LOCKED)) { - llerrs << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << llendl; + LL_ERRS() << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << LL_ENDL; } } } @@ -233,7 +233,7 @@ void LLWorkerClass::setWorkerThread(LLWorkerThread* workerthread) mMutex.lock(); if (mRequestHandle != LLWorkerThread::nullHandle()) { - llerrs << "LLWorkerClass attempt to change WorkerThread with active worker!" << llendl; + LL_ERRS() << "LLWorkerClass attempt to change WorkerThread with active worker!" << LL_ENDL; } mWorkerThread = workerthread; mMutex.unlock(); @@ -293,10 +293,10 @@ void LLWorkerClass::addWork(S32 param, U32 priority) llassert_always(!(mWorkFlags & (WCF_WORKING|WCF_HAVE_WORK))); if (mRequestHandle != LLWorkerThread::nullHandle()) { - llerrs << "LLWorkerClass attempt to add work with active worker!" << llendl; + LL_ERRS() << "LLWorkerClass attempt to add work with active worker!" << LL_ENDL; } #if _DEBUG -// llinfos << "addWork: " << mWorkerClassName << " Param: " << param << llendl; +// LL_INFOS() << "addWork: " << mWorkerClassName << " Param: " << param << LL_ENDL; #endif startWork(param); clearFlags(WCF_WORK_FINISHED|WCF_WORK_ABORTED); @@ -311,7 +311,7 @@ void LLWorkerClass::abortWork(bool autocomplete) #if _DEBUG // LLWorkerThread::WorkRequest* workreq = mWorkerThread->getRequest(mRequestHandle); // if (workreq) -// llinfos << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << llendl; +// LL_INFOS() << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << LL_ENDL; #endif if (mRequestHandle != LLWorkerThread::nullHandle()) { diff --git a/indra/llcommon/string_table.h b/indra/llcommon/string_table.h deleted file mode 100644 index 176be21e6..000000000 --- a/indra/llcommon/string_table.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file string_table.h - * @brief Legacy wrapper header. - * - * $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 "llstringtable.h" diff --git a/indra/llcommon/u64.cpp b/indra/llcommon/u64.cpp index 01fe973a2..fbb1b97a0 100644 --- a/indra/llcommon/u64.cpp +++ b/indra/llcommon/u64.cpp @@ -42,7 +42,7 @@ U64 str_to_U64(const std::string& str) if (!aptr) { - llwarns << "str_to_U64: Bad string to U64 conversion attempt: format\n" << llendl; + LL_WARNS() << "str_to_U64: Bad string to U64 conversion attempt: format\n" << LL_ENDL; } else { diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index d9a8696a0..1d6a733ec 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -124,12 +124,12 @@ void LLImageBase::destroyPrivatePool() // virtual void LLImageBase::dump() { - llinfos << "LLImageBase mComponents " << mComponents + LL_INFOS() << "LLImageBase mComponents " << mComponents << " mData " << mData << " mDataSize " << mDataSize << " mWidth " << mWidth << " mHeight " << mHeight - << llendl; + << LL_ENDL; } // virtual @@ -141,13 +141,13 @@ void LLImageBase::sanityCheck() || mComponents > (S8)MAX_IMAGE_COMPONENTS ) { - llerrs << "Failed LLImageBase::sanityCheck " + LL_ERRS() << "Failed LLImageBase::sanityCheck " << "width " << mWidth << "height " << mHeight << "datasize " << mDataSize << "components " << mComponents << "data " << mData - << llendl; + << LL_ENDL; } } @@ -167,7 +167,7 @@ U8* LLImageBase::allocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl; + LL_ERRS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL; } } @@ -175,14 +175,14 @@ U8* LLImageBase::allocateData(S32 size) static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB if (size < 1 || size > MAX_BUFFER_SIZE) { - //llinfos << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << llendl ; + //LL_INFOS() << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << LL_ENDL ; if(mAllowOverSize) { - //llinfos << "Oversize: " << size << llendl ; + //LL_INFOS() << "Oversize: " << size << LL_ENDL ; } else { - llerrs << "LLImageBase::allocateData: bad size: " << size << llendl; + LL_ERRS() << "LLImageBase::allocateData: bad size: " << size << LL_ENDL; } } if (!mData || size != mDataSize) @@ -192,7 +192,7 @@ U8* LLImageBase::allocateData(S32 size) mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); if (!mData) { - llwarns << "Failed to allocate image data size [" << size << "]" << llendl; + LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL; size = 0 ; mWidth = mHeight = 0 ; mBadBufferAllocation = true ; @@ -211,12 +211,12 @@ U8* LLImageBase::reallocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - llerrs << llformat("LLImageBase::reallocateData called with bad dimensions: %dx%dx%d", mWidth, mHeight, (S32)mComponents) << llendl; + LL_ERRS() << llformat("LLImageBase::reallocateData called with bad dimensions: %dx%dx%d", mWidth, mHeight, (S32)mComponents) << LL_ENDL; } } else if (size <= 0 || (size > 4096 * 4096 * 16 && !mAllowOverSize)) { - llerrs << "LLImageBase::reallocateData: bad size: " << size << llendl; + LL_ERRS() << "LLImageBase::reallocateData: bad size: " << size << LL_ENDL; } if(mData && (mDataSize == size)) @@ -225,7 +225,7 @@ U8* LLImageBase::reallocateData(S32 size) U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size); if (!new_datap) { - llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; + LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL; return 0; } if (mData) @@ -243,7 +243,7 @@ const U8* LLImageBase::getData() const { if(mBadBufferAllocation) { - llerrs << "Bad memory allocation for the image buffer!" << llendl ; + LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ; } return mData; @@ -253,7 +253,7 @@ U8* LLImageBase::getData() { if(mBadBufferAllocation) { - llerrs << "Bad memory allocation for the image buffer!" << llendl ; + LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ; } return mData; @@ -417,7 +417,7 @@ U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const // Should do some simple bounds checking if (!data) { - llerrs << "Out of memory in LLImageRaw::getSubImage" << llendl; + LL_ERRS() << "Out of memory in LLImageRaw::getSubImage" << LL_ENDL; return NULL; } @@ -512,7 +512,7 @@ void LLImageRaw::verticalFlip() } catch(std::bad_alloc) { - llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl; + LL_ERRS() << "Out of memory in LLImageRaw::verticalFlip()" << LL_ENDL; } } @@ -634,7 +634,7 @@ void LLImageRaw::composite( LLImageRaw* src ) // Src and dst can be any size. Src has 4 components. Dst has 3 components. void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) { - llinfos << "compositeScaled4onto3" << llendl; + LL_INFOS() << "compositeScaled4onto3" << LL_ENDL; LLImageRaw* dst = this; // Just for clarity. @@ -660,7 +660,7 @@ void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) } catch(std::bad_alloc) { - llerrs << "Out of memory in LLImageRaw::compositeScaled4onto3()" << llendl; + LL_ERRS() << "Out of memory in LLImageRaw::compositeScaled4onto3()" << LL_ENDL; } } @@ -784,7 +784,7 @@ void LLImageRaw::copy(LLImageRaw* src) { if (!src) { - llwarns << "LLImageRaw::copy called with a null src pointer" << llendl; + LL_WARNS() << "LLImageRaw::copy called with a null src pointer" << LL_ENDL; return; } @@ -948,7 +948,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) } catch(std::bad_alloc) { - llerrs << "Out of memory in LLImageRaw::copyScaled()" << llendl; + LL_ERRS() << "Out of memory in LLImageRaw::copyScaled()" << LL_ENDL; } } @@ -1366,7 +1366,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip if (!ifs.is_open()) { // SJB: changed from llinfos to lldebugs to reduce spam - lldebugs << "Unable to open image file: " << name << llendl; + LL_DEBUGS() << "Unable to open image file: " << name << LL_ENDL; return false; } @@ -1380,7 +1380,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip if (!length) { - llinfos << "Zero length file file: " << name << llendl; + LL_INFOS() << "Zero length file file: " << name << LL_ENDL; return false; } @@ -1416,7 +1416,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip if (!success) { deleteData(); - llwarns << "Unable to decode image" << name << llendl; + LL_WARNS() << "Unable to decode image" << name << LL_ENDL; return false; } @@ -1520,11 +1520,11 @@ void LLImageFormatted::dump() { LLImageBase::dump(); - llinfos << "LLImageFormatted" + LL_INFOS() << "LLImageFormatted" << " mDecoding " << mDecoding << " mCodec " << S32(mCodec) << " mDecoded " << mDecoded - << llendl; + << LL_ENDL; } //---------------------------------------------------------------------------- @@ -1607,11 +1607,11 @@ void LLImageFormatted::sanityCheck() if (mCodec >= IMG_CODEC_EOF) { - llerrs << "Failed LLImageFormatted::sanityCheck " + LL_ERRS() << "Failed LLImageFormatted::sanityCheck " << "decoding " << S32(mDecoding) << "decoded " << S32(mDecoded) << "codec " << S32(mCodec) - << llendl; + << LL_ENDL; } } @@ -1784,7 +1784,7 @@ void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 heig *(U8*)data = (U8)(((U32)(indata[0]) + indata[1] + indata[in_width] + indata[in_width+1])>>2); break; default: - llerrs << "generateMmip called with bad num channels" << llendl; + LL_ERRS() << "generateMmip called with bad num channels" << LL_ENDL; } indata += nchannels*2; data += nchannels; @@ -1841,17 +1841,17 @@ F32 LLImageBase::calc_download_priority(F32 virtual_size, F32 visible_pixels, S3 bytes_weight *= bytes_weight; - //llinfos << "VS: " << virtual_size << llendl; + //LL_INFOS() << "VS: " << virtual_size << LL_ENDL; F32 virtual_size_factor = virtual_size / (10.f*10.f); // The goal is for weighted priority to be <= 0 when we've reached a point where // we've sent enough data. - //llinfos << "BytesSent: " << bytes_sent << llendl; - //llinfos << "BytesWeight: " << bytes_weight << llendl; - //llinfos << "PreLog: " << bytes_weight * virtual_size_factor << llendl; + //LL_INFOS() << "BytesSent: " << bytes_sent << LL_ENDL; + //LL_INFOS() << "BytesWeight: " << bytes_weight << LL_ENDL; + //LL_INFOS() << "PreLog: " << bytes_weight * virtual_size_factor << LL_ENDL; w_priority = (F32)log10(bytes_weight * virtual_size_factor); - //llinfos << "PreScale: " << w_priority << llendl; + //LL_INFOS() << "PreScale: " << w_priority << LL_ENDL; // We don't want to affect how MANY bytes we send based on the visible pixels, but the order // in which they're sent. We post-multiply so we don't change the zero point. diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp index ceded296a..dafcc5c82 100644 --- a/indra/llimage/llimagebmp.cpp +++ b/indra/llimage/llimagebmp.cpp @@ -327,7 +327,7 @@ BOOL LLImageBMP::updateData() mColorPalette = new U8[color_palette_size]; if (!mColorPalette) { - llerrs << "Out of memory in LLImageBMP::updateData()" << llendl; + LL_ERRS() << "Out of memory in LLImageBMP::updateData()" << LL_ENDL; return FALSE; } memcpy( mColorPalette, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE + extension_size, color_palette_size ); /* Flawfinder: ignore */ @@ -534,7 +534,7 @@ BOOL LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time) if( (2 == src_components) || (4 == src_components) ) { - llinfos << "Dropping alpha information during BMP encoding" << llendl; + LL_INFOS() << "Dropping alpha information during BMP encoding" << LL_ENDL; } setSize(raw_image->getWidth(), raw_image->getHeight(), dst_components); diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 34c679352..04e0e752e 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -52,7 +52,7 @@ S32 LLImageDXT::formatBits(EFileFormat format) case FORMAT_RGB8: return 24; case FORMAT_RGBA8: return 32; default: - llerrs << "LLImageDXT::Unknown format: " << format << llendl; + LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL; return 0; } }; @@ -82,7 +82,7 @@ S32 LLImageDXT::formatComponents(EFileFormat format) case FORMAT_RGB8: return 3; case FORMAT_RGBA8: return 4; default: - llerrs << "LLImageDXT::Unknown format: " << format << llendl; + LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL; return 0; } }; @@ -207,7 +207,7 @@ BOOL LLImageDXT::updateData() if (data_size < mHeaderSize) { - llerrs << "LLImageDXT: not enough data" << llendl; + LL_ERRS() << "LLImageDXT: not enough data" << LL_ENDL; } S32 ncomponents = formatComponents(mFileFormat); setSize(width, height, ncomponents); @@ -224,7 +224,7 @@ S32 LLImageDXT::getMipOffset(S32 discard) { if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXT5) { - llerrs << "getMipOffset called with old (unsupported) format" << llendl; + LL_ERRS() << "getMipOffset called with old (unsupported) format" << LL_ENDL; } S32 width = getWidth(), height = getHeight(); S32 num_mips = calcNumMips(width, height); @@ -251,7 +251,7 @@ void LLImageDXT::setFormat() { case 3: mFileFormat = FORMAT_DXR1; break; case 4: mFileFormat = FORMAT_DXR3; break; - default: llerrs << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << llendl; + default: LL_ERRS() << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << LL_ENDL; } mHeaderSize = calcHeaderSize(); } @@ -265,7 +265,7 @@ BOOL LLImageDXT::decode(LLImageRaw* raw_image, F32 time) if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXR5) { - llwarns << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << llendl; + LL_WARNS() << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << LL_ENDL; return FALSE; } @@ -303,7 +303,7 @@ BOOL LLImageDXT::getMipData(LLPointer& raw, S32 discard) } else if (discard < mDiscardLevel) { - llerrs << "Request for invalid discard level" << llendl; + LL_ERRS() << "Request for invalid discard level" << LL_ENDL; } U8* data = getData() + getMipOffset(discard); S32 width = 0; @@ -331,7 +331,7 @@ BOOL LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_ format = FORMAT_RGBA8; break; default: - llerrs << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << llendl; + LL_ERRS() << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << LL_ENDL; return 0; } @@ -422,7 +422,7 @@ bool LLImageDXT::convertToDXR() case FORMAT_DXT4: newformat = FORMAT_DXR4; break; case FORMAT_DXT5: newformat = FORMAT_DXR5; break; default: - llwarns << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << llendl; + LL_WARNS() << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << LL_ENDL; return false; } mFileFormat = newformat; @@ -433,7 +433,7 @@ bool LLImageDXT::convertToDXR() U8* newdata = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_bytes); if (!newdata) { - llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl; + LL_ERRS() << "Out of memory in LLImageDXT::convertToDXR()" << LL_ENDL; return false; } llassert(total_bytes > 0); @@ -466,7 +466,7 @@ S32 LLImageDXT::calcDataSize(S32 discard_level) { if (mFileFormat == FORMAT_UNKNOWN) { - llerrs << "calcDataSize called with unloaded LLImageDXT" << llendl; + LL_ERRS() << "calcDataSize called with unloaded LLImageDXT" << LL_ENDL; return 0; } if (discard_level < 0) diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index 79ea79cc0..8181c39d9 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -380,7 +380,7 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo ) U8* new_buffer = new U8[ new_buffer_size ]; if (!new_buffer) { - llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl; + LL_ERRS() << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << LL_ENDL; return FALSE; } memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */ @@ -471,7 +471,7 @@ void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo ) LLImage::setLastError(error); BOOL is_decode = (cinfo->is_decompressor != 0); - llwarns << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << llendl; + LL_WARNS() << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << LL_ENDL; } BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index 58426d31f..f034909da 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -266,7 +266,7 @@ BOOL LLImageTGA::updateData() mColorMap = new U8[ color_map_bytes ]; if (!mColorMap) { - llerrs << "Out of Memory in BOOL LLImageTGA::updateData()" << llendl; + LL_ERRS() << "Out of Memory in BOOL LLImageTGA::updateData()" << LL_ENDL; return FALSE; } memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); /* Flawfinder: ignore */ @@ -1043,7 +1043,7 @@ BOOL LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight // Only works for unflipped monochrome RLE images if( (getComponents() != 1) || (mImageType != 11) || mOriginTopBit || mOriginRightBit ) { - llerrs << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << llendl; + LL_ERRS() << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << LL_ENDL; return FALSE; } @@ -1151,7 +1151,7 @@ bool LLImageTGA::loadFile( const std::string& path ) LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */ if( !file ) { - llwarns << "Couldn't open file " << path << llendl; + LL_WARNS() << "Couldn't open file " << path << LL_ENDL; return false; } @@ -1167,7 +1167,7 @@ bool LLImageTGA::loadFile( const std::string& path ) if( bytes_read != file_size ) { deleteData(); - llwarns << "Couldn't read file " << path << llendl; + LL_WARNS() << "Couldn't read file " << path << LL_ENDL; return false; } @@ -1175,7 +1175,7 @@ bool LLImageTGA::loadFile( const std::string& path ) if( !updateData() ) { - llwarns << "Couldn't decode file " << path << llendl; + LL_WARNS() << "Couldn't decode file " << path << LL_ENDL; deleteData(); return false; } diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 161b25f5e..d710a065d 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -58,7 +58,7 @@ S32 LLImageDecodeThread::update(F32 max_time_ms) bool res = addRequest(req); if (!res) { - llerrs << "request added after LLLFSThread::cleanupClass()" << llendl; + LL_ERRS() << "request added after LLLFSThread::cleanupClass()" << LL_ENDL; } } mCreationList.clear(); diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 3db9c077d..479bdce10 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -71,21 +71,21 @@ sample error callback expecting a LLFILE* client object */ void error_callback(const char* msg, void*) { - lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; + LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; } /** sample warning callback expecting a LLFILE* client object */ void warning_callback(const char* msg, void*) { - lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; + LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; } /** sample debug callback expecting no client object */ void info_callback(const char* msg, void*) { - lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; + LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; } // Divide a by 2 to the power of b and round upwards @@ -222,7 +222,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod { if (image->comps[i].factor != base.getRawDiscardLevel()) { - LL_WARNS("Texture") << "Expected discard level not reached!" << llendl; + LL_WARNS("Texture") << "Expected discard level not reached!" << LL_ENDL; // if we didn't get the discard level we're expecting, fail opj_image_destroy(image); base.decodeFailed(); @@ -232,7 +232,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod if(image->numcomps <= first_channel) { - LL_WARNS("Texture") << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl; + LL_WARNS("Texture") << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << LL_ENDL; if (image) { opj_image_destroy(image); @@ -283,7 +283,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod } else // Some rare OpenJPEG versions have this bug. { - LL_WARNS("Texture") << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << llendl; + LL_WARNS("Texture") << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << LL_ENDL; opj_image_destroy(image); base.decodeFailed(); @@ -418,7 +418,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con if (!bSuccess) { opj_cio_close(cio); - LL_WARNS("Texture") << "Failed to encode image." << llendl; + LL_WARNS("Texture") << "Failed to encode image." << LL_ENDL; return FALSE; } codestream_length = cio_tell(cio); @@ -572,7 +572,7 @@ BOOL LLImageJ2COJ::getMetadata(LLImageJ2C &base) if(!image) { - llwarns << "ERROR -> getMetadata: failed to decode image!" << llendl; + LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL; return FALSE; } diff --git a/indra/llinventory/llcategory.h b/indra/llinventory/llcategory.h index c8e2dac30..378cd0d8d 100644 --- a/indra/llinventory/llcategory.h +++ b/indra/llinventory/llcategory.h @@ -49,7 +49,7 @@ // S32 count = LLCategory::none.getSubCategoryCount(); // for(S32 i = 0; i < count; i++) // { -// llinfos << none.getSubCategory(i).lookupNmae() << llendl; +// LL_INFOS() << none.getSubCategory(i).lookupNmae() << LL_ENDL; // } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/llinventory/lleconomy.cpp b/indra/llinventory/lleconomy.cpp index d643ea6ed..e10402196 100644 --- a/indra/llinventory/lleconomy.cpp +++ b/indra/llinventory/lleconomy.cpp @@ -101,7 +101,7 @@ void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* if (fakeprice_str) { S32 fakeprice = (S32)atoi(fakeprice_str); - llwarns << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << llendl; + LL_WARNS() << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << LL_ENDL; econ_data->setPriceUpload(fakeprice); } #endif @@ -143,19 +143,19 @@ S32 LLGlobalEconomy::calculateLightRent(const LLVector3& object_size) const void LLGlobalEconomy::print() { - llinfos << "Global Economy Settings: " << llendl; - llinfos << "Object Capacity: " << mObjectCapacity << llendl; - llinfos << "Object Count: " << mObjectCount << llendl; - llinfos << "Claim Price Per Object: " << mPriceObjectClaim << llendl; - llinfos << "Claim Price Per Public Object: " << mPricePublicObjectDecay << llendl; - llinfos << "Delete Price Per Public Object: " << mPricePublicObjectDelete << llendl; - llinfos << "Release Price Per Public Object: " << getPricePublicObjectRelease() << llendl; - llinfos << "Price Per Energy Unit: " << mPriceEnergyUnit << llendl; - llinfos << "Price Per Upload: " << mPriceUpload << llendl; - llinfos << "Light Base Price: " << mPriceRentLight << llendl; - llinfos << "Teleport Min Price: " << mTeleportMinPrice << llendl; - llinfos << "Teleport Price Exponent: " << mTeleportPriceExponent << llendl; - llinfos << "Price for group creation: " << mPriceGroupCreate << llendl; + LL_INFOS() << "Global Economy Settings: " << LL_ENDL; + LL_INFOS() << "Object Capacity: " << mObjectCapacity << LL_ENDL; + LL_INFOS() << "Object Count: " << mObjectCount << LL_ENDL; + LL_INFOS() << "Claim Price Per Object: " << mPriceObjectClaim << LL_ENDL; + LL_INFOS() << "Claim Price Per Public Object: " << mPricePublicObjectDecay << LL_ENDL; + LL_INFOS() << "Delete Price Per Public Object: " << mPricePublicObjectDelete << LL_ENDL; + LL_INFOS() << "Release Price Per Public Object: " << getPricePublicObjectRelease() << LL_ENDL; + LL_INFOS() << "Price Per Energy Unit: " << mPriceEnergyUnit << LL_ENDL; + LL_INFOS() << "Price Per Upload: " << mPriceUpload << LL_ENDL; + LL_INFOS() << "Light Base Price: " << mPriceRentLight << LL_ENDL; + LL_INFOS() << "Teleport Min Price: " << mTeleportMinPrice << LL_ENDL; + LL_INFOS() << "Teleport Price Exponent: " << mTeleportPriceExponent << LL_ENDL; + LL_INFOS() << "Price for group creation: " << mPriceGroupCreate << LL_ENDL; } LLRegionEconomy::LLRegionEconomy() @@ -209,8 +209,8 @@ void LLRegionEconomy::processEconomyDataRequest(LLMessageSystem *msg, void **use LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data; if (!this_ptr->hasData()) { - llwarns << "Dropping EconomyDataRequest, because EconomyData message " - << "has not been processed" << llendl; + LL_WARNS() << "Dropping EconomyDataRequest, because EconomyData message " + << "has not been processed" << LL_ENDL; } msg->newMessageFast(_PREHASH_EconomyData); @@ -254,12 +254,12 @@ void LLRegionEconomy::print() { this->LLGlobalEconomy::print(); - llinfos << "Region Economy Settings: " << llendl; - llinfos << "Land (square meters): " << mAreaTotal << llendl; - llinfos << "Owned Land (square meters): " << mAreaOwned << llendl; - llinfos << "Daily Object Rent: " << mPriceObjectRent << llendl; - llinfos << "Daily Land Rent (per meter): " << getPriceParcelRent() << llendl; - llinfos << "Energey Efficiency: " << mEnergyEfficiency << llendl; + LL_INFOS() << "Region Economy Settings: " << LL_ENDL; + LL_INFOS() << "Land (square meters): " << mAreaTotal << LL_ENDL; + LL_INFOS() << "Owned Land (square meters): " << mAreaOwned << LL_ENDL; + LL_INFOS() << "Daily Object Rent: " << mPriceObjectRent << LL_ENDL; + LL_INFOS() << "Daily Land Rent (per meter): " << getPriceParcelRent() << LL_ENDL; + LL_INFOS() << "Energey Efficiency: " << mEnergyEfficiency << LL_ENDL; } diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp index 280606b4f..392dfd345 100644 --- a/indra/llinventory/llfoldertype.cpp +++ b/indra/llinventory/llfoldertype.cpp @@ -152,7 +152,7 @@ LLAssetType::EType LLFolderType::folderTypeToAssetType(LLFolderType::EType folde { if (LLAssetType::lookup(LLAssetType::EType(folder_type)) == LLAssetType::badLookup()) { - llwarns << "Converting to unknown asset type " << folder_type << llendl; + LL_WARNS() << "Converting to unknown asset type " << folder_type << LL_ENDL; } return (LLAssetType::EType)folder_type; } @@ -162,7 +162,7 @@ LLFolderType::EType LLFolderType::assetTypeToFolderType(LLAssetType::EType asset { if (LLFolderType::lookup(LLFolderType::EType(asset_type)) == LLFolderType::badLookup()) { - llwarns << "Converting to unknown folder type " << asset_type << llendl; + LL_WARNS() << "Converting to unknown folder type " << asset_type << LL_ENDL; } return (LLFolderType::EType)asset_type; } diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 66a0f0278..7f76e4478 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -212,8 +212,8 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << LL_ENDL; } } return TRUE; @@ -253,19 +253,19 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co void LLInventoryObject::removeFromServer() { // don't do nothin' - llwarns << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << LL_ENDL; } void LLInventoryObject::updateParentOnServer(BOOL) const { // don't do nothin' - llwarns << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << LL_ENDL; } void LLInventoryObject::updateServer(BOOL) const { // don't do nothin' - llwarns << "LLInventoryObject::updateServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::updateServer() called. Doesn't do anything." << LL_ENDL; } // inline @@ -397,23 +397,23 @@ U32 LLInventoryItem::getCRC32() const // *NOTE: We currently do not validate the name or description, // but if they change in transit, it's no big deal. U32 crc = mUUID.getCRC32(); - //lldebugs << "1 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "1 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mParentUUID.getCRC32(); - //lldebugs << "2 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "2 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mPermissions.getCRC32(); - //lldebugs << "3 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "3 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mAssetUUID.getCRC32(); - //lldebugs << "4 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "4 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mType; - //lldebugs << "5 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "5 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mInventoryType; - //lldebugs << "6 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "6 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mFlags; - //lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "7 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mSaleInfo.getCRC32(); - //lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "8 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += (U32)mCreationDate; - //lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "9 crc: " << std::hex << crc << std::dec << LL_ENDL; return crc; } @@ -573,13 +573,13 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 #ifdef CRC_CHECK if(local_crc == remote_crc) { - lldebugs << "crc matches" << llendl; + LL_DEBUGS() << "crc matches" << LL_ENDL; return TRUE; } else { - llwarns << "inventory crc mismatch: local=" << std::hex << local_crc - << " remote=" << remote_crc << std::dec << llendl; + LL_WARNS() << "inventory crc mismatch: local=" << std::hex << local_crc + << " remote=" << remote_crc << std::dec << LL_ENDL; return FALSE; } #else @@ -715,7 +715,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) const char *donkey = mDescription.c_str(); if (donkey[0] == '|') { - llerrs << "Donkey" << llendl; + LL_ERRS() << "Donkey" << LL_ENDL; } */ } @@ -727,8 +727,8 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import of item " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import of item " << mUUID << LL_ENDL; } } @@ -738,7 +738,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -921,7 +921,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) const char *donkey = mDescription.c_str(); if (donkey[0] == '|') { - llerrs << "Donkey" << llendl; + LL_ERRS() << "Donkey" << LL_ENDL; } */ } @@ -933,8 +933,8 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import of item " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import of item " << mUUID << LL_ENDL; } } @@ -944,7 +944,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -1169,7 +1169,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) // Because WT_UNKNOWN now has locally a special meaning, make sure we don't receive it from the server. if (wt == WT_UNKNOWN) { - lldebugs << "Received inventory item with wearable type WT_UNKNOWN from server!" << llendl; + LL_DEBUGS() << "Received inventory item with wearable type WT_UNKNOWN from server!" << LL_ENDL; // Change this new wearable type to WT_COUNT, as if when we had not inserted WT_UNKNOWN locally. mFlags += 1; wt = WT_COUNT; @@ -1210,7 +1210,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -1283,7 +1283,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) if (NULL == bin_bucket) { - llerrs << "unpackBinaryBucket failed. bin_bucket is NULL." << llendl; + LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL; return; } @@ -1293,7 +1293,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) item_buffer[bin_bucket_size] = '\0'; std::string str(&item_buffer[0]); - lldebugs << "item buffer: " << str << llendl; + LL_DEBUGS() << "item buffer: " << str << LL_ENDL; // Tokenize the string. typedef boost::tokenizer > tokenizer; @@ -1330,7 +1330,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) perm.init(creator_id, owner_id, last_owner_id, group_id); perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next); setPermissions(perm); - //lldebugs << "perm: " << perm << llendl; + //LL_DEBUGS() << "perm: " << perm << LL_ENDL; LLUUID asset_id((*(iter++)).c_str()); setAssetUUID(asset_id); @@ -1531,8 +1531,8 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import category " << mUUID << LL_ENDL; } } return TRUE; @@ -1610,8 +1610,8 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import category " << mUUID << LL_ENDL; } } return TRUE; @@ -1642,8 +1642,8 @@ LLSD ll_create_sd_from_inventory_item(LLPointer item) if(item.isNull()) return rv; if (item->getType() == LLAssetType::AT_NONE) { - llwarns << "ll_create_sd_from_inventory_item() for item with AT_NONE" - << llendl; + LL_WARNS() << "ll_create_sd_from_inventory_item() for item with AT_NONE" + << LL_ENDL; return rv; } rv[INV_ITEM_ID_LABEL] = item->getUUID(); @@ -1668,8 +1668,8 @@ LLSD ll_create_sd_from_inventory_category(LLPointer cat) if(cat.isNull()) return rv; if (cat->getType() == LLAssetType::AT_NONE) { - llwarns << "ll_create_sd_from_inventory_category() for cat with AT_NONE" - << llendl; + LL_WARNS() << "ll_create_sd_from_inventory_category() for cat with AT_NONE" + << LL_ENDL; return rv; } rv[INV_FOLDER_ID_LABEL] = cat->getUUID(); diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp index 83b6392ca..73166ff5c 100644 --- a/indra/llinventory/lllandmark.cpp +++ b/indra/llinventory/lllandmark.cpp @@ -134,7 +134,7 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer) goto error; } cur += chars_read; - // llinfos << "Landmark read: " << pos << llendl; + // LL_INFOS() << "Landmark read: " << pos << LL_ENDL; return new LLLandmark(pos); } @@ -161,7 +161,7 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer) } error: - llinfos << "Bad Landmark Asset: bad _DATA_ block." << llendl; + LL_INFOS() << "Bad Landmark Asset: bad _DATA_ block." << LL_ENDL; return NULL; } @@ -182,7 +182,7 @@ void LLLandmark::requestRegionHandle( if(region_id.isNull()) { // don't bother with checking - it's 0. - lldebugs << "requestRegionHandle: null" << llendl; + LL_DEBUGS() << "requestRegionHandle: null" << LL_ENDL; if(callback) { const U64 U64_ZERO = 0; @@ -193,7 +193,7 @@ void LLLandmark::requestRegionHandle( { if(region_id == mLocalRegion.first) { - lldebugs << "requestRegionHandle: local" << llendl; + LL_DEBUGS() << "requestRegionHandle: local" << LL_ENDL; if(callback) { callback(region_id, mLocalRegion.second); @@ -204,14 +204,14 @@ void LLLandmark::requestRegionHandle( region_map_t::iterator it = mRegions.find(region_id); if(it == mRegions.end()) { - lldebugs << "requestRegionHandle: upstream" << llendl; + LL_DEBUGS() << "requestRegionHandle: upstream" << LL_ENDL; if(callback) { region_callback_map_t::value_type vt(region_id, callback); sRegionCallbackMap.insert(vt); } - lldebugs << "Landmark requesting information about: " - << region_id << llendl; + LL_DEBUGS() << "Landmark requesting information about: " + << region_id << LL_ENDL; msg->newMessage("RegionHandleRequest"); msg->nextBlock("RequestBlock"); msg->addUUID("RegionID", region_id); @@ -220,7 +220,7 @@ void LLLandmark::requestRegionHandle( else if(callback) { // we have the answer locally - just call the callack. - lldebugs << "requestRegionHandle: ready" << llendl; + LL_DEBUGS() << "requestRegionHandle: ready" << LL_ENDL; callback(region_id, (*it).second.mRegionHandle); } } @@ -254,8 +254,8 @@ void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**) #if LL_DEBUG U32 grid_x, grid_y; grid_from_region_handle(info.mRegionHandle, &grid_x, &grid_y); - lldebugs << "Landmark got reply for region: " << region_id << " " - << grid_x << "," << grid_y << llendl; + LL_DEBUGS() << "Landmark got reply for region: " << region_id << " " + << grid_x << "," << grid_y << LL_ENDL; #endif // make all the callbacks here. diff --git a/indra/llinventory/llnotecard.cpp b/indra/llinventory/llnotecard.cpp index 13ac4c9f0..0281df3f4 100644 --- a/indra/llinventory/llnotecard.cpp +++ b/indra/llinventory/llnotecard.cpp @@ -63,33 +63,33 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) str >> std::ws >> "LLEmbeddedItems version" >> mEmbeddedVersion >> "\n"; if (str.fail()) { - llwarns << "Invalid Linden text file header" << llendl; + LL_WARNS() << "Invalid Linden text file header" << LL_ENDL; goto import_file_failed; } if( 1 != mEmbeddedVersion ) { - llwarns << "Invalid LLEmbeddedItems version: " << mEmbeddedVersion << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems version: " << mEmbeddedVersion << LL_ENDL; goto import_file_failed; } str >> std::ws >> "{\n"; if(str.fail()) { - llwarns << "Invalid Linden text file format: missing {" << llendl; + LL_WARNS() << "Invalid Linden text file format: missing {" << LL_ENDL; goto import_file_failed; } str >> std::ws >> "count " >> count >> "\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems count" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems count" << LL_ENDL; goto import_file_failed; } if((count < 0)) { - llwarns << "Invalid LLEmbeddedItems count value: " << count << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems count value: " << count << LL_ENDL; goto import_file_failed; } @@ -98,7 +98,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) str >> std::ws >> "{\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems file format: missing {" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems file format: missing {" << LL_ENDL; goto import_file_failed; } @@ -106,21 +106,21 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) str >> std::ws >> "ext char index " >> index >> "\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems file format: missing ext char index" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems file format: missing ext char index" << LL_ENDL; goto import_file_failed; } str >> std::ws >> "inv_item\t0\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems file format: missing inv_item" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems file format: missing inv_item" << LL_ENDL; goto import_file_failed; } LLPointer item = new LLInventoryItem; if (!item->importLegacyStream(str)) { - llinfos << "notecard import failed" << llendl; + LL_INFOS() << "notecard import failed" << LL_ENDL; goto import_file_failed; } mItems.push_back(item); @@ -128,7 +128,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) str >> std::ws >> "}\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems file format: missing }" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems file format: missing }" << LL_ENDL; goto import_file_failed; } } @@ -136,7 +136,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str) str >> std::ws >> "}\n"; if(str.fail()) { - llwarns << "Invalid LLEmbeddedItems file format: missing }" << llendl; + LL_WARNS() << "Invalid LLEmbeddedItems file format: missing }" << LL_ENDL; goto import_file_failed; } @@ -167,20 +167,20 @@ bool LLNotecard::importStream(std::istream& str) str >> std::ws >> "Linden text version " >> mVersion >> "\n"; if(str.fail()) { - llwarns << "Invalid Linden text file header " << llendl; + LL_WARNS() << "Invalid Linden text file header " << LL_ENDL; return FALSE; } if( 1 != mVersion && 2 != mVersion) { - llwarns << "Invalid Linden text file version: " << mVersion << llendl; + LL_WARNS() << "Invalid Linden text file version: " << mVersion << LL_ENDL; return FALSE; } str >> std::ws >> "{\n"; if(str.fail()) { - llwarns << "Invalid Linden text file format" << llendl; + LL_WARNS() << "Invalid Linden text file format" << LL_ENDL; return FALSE; } @@ -193,7 +193,7 @@ bool LLNotecard::importStream(std::istream& str) str.getline(line_buf, STD_STRING_BUF_SIZE); if(str.fail()) { - llwarns << "Invalid Linden text length field" << llendl; + LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; return FALSE; } line_buf[STD_STRING_STR_LEN] = '\0'; @@ -201,13 +201,13 @@ bool LLNotecard::importStream(std::istream& str) S32 text_len = 0; if( 1 != sscanf(line_buf, "Text length %d", &text_len) ) { - llwarns << "Invalid Linden text length field" << llendl; + LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; return FALSE; } if(text_len > mMaxText || text_len < 0) { - llwarns << "Invalid Linden text length: " << text_len << llendl; + LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL; return FALSE; } @@ -217,7 +217,7 @@ bool LLNotecard::importStream(std::istream& str) fullread(str, text, text_len); if(str.fail()) { - llwarns << "Invalid Linden text: text shorter than text length: " << text_len << llendl; + LL_WARNS() << "Invalid Linden text: text shorter than text length: " << text_len << LL_ENDL; success = FALSE; } text[text_len] = '\0'; diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 99a37acd5..f32e61e53 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -582,8 +582,8 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr } else { - llwarns << "Unknown keyword in parcel access entry section: <" - << keyword << ">" << llendl; + LL_WARNS() << "Unknown keyword in parcel access entry section: <" + << keyword << ">" << LL_ENDL; } } return input_stream.good(); @@ -1208,9 +1208,9 @@ void LLParcel::clearParcel() void LLParcel::dump() { - llinfos << "parcel " << mLocalID << " area " << mArea << llendl; - llinfos << " name <" << mName << ">" << llendl; - llinfos << " desc <" << mDesc << ">" << llendl; + LL_INFOS() << "parcel " << mLocalID << " area " << mArea << LL_ENDL; + LL_INFOS() << " name <" << mName << ">" << LL_ENDL; + LL_INFOS() << " desc <" << mDesc << ">" << LL_ENDL; } const std::string& ownership_status_to_string(LLParcel::EOwnershipStatus status) @@ -1290,7 +1290,7 @@ LLParcel::ECategory category_string_to_category(const std::string& s) return (LLParcel::ECategory)i; } } - llwarns << "Parcel category outside of possibilities " << s << llendl; + LL_WARNS() << "Parcel category outside of possibilities " << s << LL_ENDL; return LLParcel::C_NONE; } diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index fb5359a88..b8b2f5a1e 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -117,7 +117,7 @@ LLUUID LLPermissions::getSafeOwner() const } else { - llwarns << "LLPermissions::getSafeOwner() called with no valid owner!" << llendl; + LL_WARNS() << "LLPermissions::getSafeOwner() called with no valid owner!" << LL_ENDL; LLUUID unused_uuid; unused_uuid.generate(); @@ -603,14 +603,14 @@ BOOL LLPermissions::importStream(std::istream& input_stream) input_stream.getline(buffer, BUFSIZE); if (input_stream.eof()) { - llwarns << "Bad permissions: early end of input stream" - << llendl; + LL_WARNS() << "Bad permissions: early end of input stream" + << LL_ENDL; return FALSE; } if (input_stream.fail()) { - llwarns << "Bad permissions: failed to read from input stream" - << llendl; + LL_WARNS() << "Bad permissions: failed to read from input stream" + << LL_ENDL; return FALSE; } sscanf( /* Flawfinder: ignore */ @@ -686,8 +686,8 @@ BOOL LLPermissions::importStream(std::istream& input_stream) } else { - llwarns << "unknown keyword " << keyword - << " in permissions import" << llendl; + LL_WARNS() << "unknown keyword " << keyword + << " in permissions import" << LL_ENDL; } } fix(); @@ -874,8 +874,8 @@ void LLAggregatePermissions::aggregateBit(EPermIndex idx, BOOL allowed) mBits[idx] = allowed ? AP_ALL : AP_SOME; break; default: - llwarns << "Bad aggregateBit " << (S32)idx << " " - << (allowed ? "true" : "false") << llendl; + LL_WARNS() << "Bad aggregateBit " << (S32)idx << " " + << (allowed ? "true" : "false") << LL_ENDL; break; } } @@ -919,8 +919,8 @@ void LLAggregatePermissions::aggregateIndex(EPermIndex idx, U8 bits) } break; default: - llwarns << "Bad aggregate index " << (S32)idx << " " - << (S32)bits << llendl; + LL_WARNS() << "Bad aggregate index " << (S32)idx << " " + << (S32)bits << LL_ENDL; break; } } diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index b39f02f6a..30acb7f3a 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -161,14 +161,14 @@ BOOL LLSaleInfo::importStream(std::istream& input_stream, BOOL& has_perm_mask, U input_stream.getline(buffer, MAX_STRING); if (input_stream.eof()) { - llwarns << "Bad sale info: early end of input stream" - << llendl; + LL_WARNS() << "Bad sale info: early end of input stream" + << LL_ENDL; return FALSE; } if (input_stream.fail()) { - llwarns << "Bad sale info: failed to read from input stream" - << llendl; + LL_WARNS() << "Bad sale info: failed to read from input stream" + << LL_ENDL; return FALSE; } sscanf( /* Flawfinder: ignore */ @@ -198,14 +198,14 @@ BOOL LLSaleInfo::importStream(std::istream& input_stream, BOOL& has_perm_mask, U } else if (!strcmp("perm_mask", keyword)) { - //llinfos << "found deprecated keyword perm_mask" << llendl; + //LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL; has_perm_mask = TRUE; sscanf(valuestr, "%x", &perm_mask); } else { - llwarns << "unknown keyword '" << keyword - << "' in sale info import" << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in sale info import" << LL_ENDL; } } return TRUE; diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp index 084107c83..c03945b0a 100644 --- a/indra/llinventory/lltransactionflags.cpp +++ b/indra/llinventory/lltransactionflags.cpp @@ -94,11 +94,11 @@ std::string build_transfer_message_to_source( S32 transaction_type, const std::string& description) { - lldebugs << "build_transfer_message_to_source: " << amount << " " + LL_DEBUGS() << "build_transfer_message_to_source: " << amount << " " << source_id << " " << dest_id << " " << dest_name << " " << transaction_type << " " << (description.empty() ? "(no desc)" : description) - << llendl; + << LL_ENDL; if(source_id.isNull()) { return description; @@ -143,10 +143,10 @@ std::string build_transfer_message_to_destination( S32 transaction_type, const std::string& description) { - lldebugs << "build_transfer_message_to_dest: " << amount << " " + LL_DEBUGS() << "build_transfer_message_to_dest: " << amount << " " << dest_id << " " << source_id << " " << source_name << " " << transaction_type << " " << (description.empty() ? "(no desc)" : description) - << llendl; + << LL_ENDL; if(0 == amount) { return std::string(); diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp index 331e363e7..46330a767 100644 --- a/indra/llmath/llcalc.cpp +++ b/indra/llmath/llcalc.cpp @@ -144,9 +144,9 @@ bool LLCalc::evalString(const std::string& expression, F32& result) if (!expression::parse(itr, expression.end(), calc, result) || itr != expression.end()) { mLastErrorPos = itr - expression.begin(); - llinfos << "Unhandled syntax error at " << mLastErrorPos << " in expression: " << expression << llendl; + LL_INFOS() << "Unhandled syntax error at " << mLastErrorPos << " in expression: " << expression << LL_ENDL; return false; } - lldebugs << "Math expression: " << expression << " = " << result << llendl; + LL_DEBUGS() << "Math expression: " << expression << " = " << result << LL_ENDL; return true; } diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp index 962f593e1..1dee57185 100644 --- a/indra/llmath/llcoordframe.cpp +++ b/indra/llmath/llcoordframe.cpp @@ -59,7 +59,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin) : if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -71,7 +71,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLVector3 &direction) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -86,7 +86,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &x_axis, if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -102,7 +102,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -117,7 +117,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -132,7 +132,7 @@ LLCoordFrame::LLCoordFrame(const LLQuaternion &q) : if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -147,7 +147,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLQuaternion &q) : if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -160,7 +160,7 @@ LLCoordFrame::LLCoordFrame(const LLMatrix4 &mat) : if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } @@ -176,7 +176,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin, const F32 *rotation) : if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } */ @@ -191,7 +191,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin_and_rotation) : if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL; } } */ @@ -220,7 +220,7 @@ void LLCoordFrame::setOrigin(F32 x, F32 y, F32 z) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL; } } @@ -230,7 +230,7 @@ void LLCoordFrame::setOrigin(const LLVector3 &new_origin) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL; } } @@ -243,7 +243,7 @@ void LLCoordFrame::setOrigin(const F32 *origin) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL; } } @@ -254,7 +254,7 @@ void LLCoordFrame::setOrigin(const LLCoordFrame &frame) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL; } } @@ -271,7 +271,7 @@ void LLCoordFrame::setAxes(const LLVector3 &x_axis, if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL; } } @@ -284,7 +284,7 @@ void LLCoordFrame::setAxes(const LLMatrix3 &rotation_matrix) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL; } } @@ -296,7 +296,7 @@ void LLCoordFrame::setAxes(const LLQuaternion &q ) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL; } } @@ -316,7 +316,7 @@ void LLCoordFrame::setAxes( const F32 *rotation_matrix ) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL; } } @@ -330,7 +330,7 @@ void LLCoordFrame::setAxes(const LLCoordFrame &frame) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL; } } @@ -346,7 +346,7 @@ void LLCoordFrame::translate(F32 x, F32 y, F32 z) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL; } } @@ -358,7 +358,7 @@ void LLCoordFrame::translate(const LLVector3 &v) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL; } } @@ -372,7 +372,7 @@ void LLCoordFrame::translate(const F32 *origin) if( !mOrigin.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL; } } @@ -409,7 +409,7 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::rotate()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::rotate()" << LL_ENDL; } } @@ -423,7 +423,7 @@ void LLCoordFrame::roll(F32 angle) if( !mYAxis.isFinite() || !mZAxis.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::roll()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::roll()" << LL_ENDL; } } @@ -436,7 +436,7 @@ void LLCoordFrame::pitch(F32 angle) if( !mXAxis.isFinite() || !mZAxis.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::pitch()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::pitch()" << LL_ENDL; } } @@ -449,7 +449,7 @@ void LLCoordFrame::yaw(F32 angle) if( !mXAxis.isFinite() || !mYAxis.isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::yaw()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::yaw()" << LL_ENDL; } } @@ -509,7 +509,7 @@ size_t LLCoordFrame::readOrientation(const char *buffer) if( !isFinite() ) { reset(); - llwarns << "Non Finite in LLCoordFrame::readOrientation()" << llendl; + LL_WARNS() << "Non Finite in LLCoordFrame::readOrientation()" << LL_ENDL; } return 12*sizeof(F32); diff --git a/indra/llmath/llline.cpp b/indra/llmath/llline.cpp index a503bfb4a..63d34bbde 100644 --- a/indra/llmath/llline.cpp +++ b/indra/llmath/llline.cpp @@ -82,10 +82,10 @@ LLVector3 LLLine::nearestApproach( const LLLine& other_line ) const if ( one_minus_dir_dot_dir < SOME_VERY_SMALL_NUMBER ) { #ifdef LL_DEBUG - llwarns << "LLLine::nearestApproach() was given two very " + LL_WARNS() << "LLLine::nearestApproach() was given two very " << "nearly parallel lines dir1 = " << mDirection << " dir2 = " << other_line.mDirection << " with 1-dot_product = " - << one_minus_dir_dot_dir << llendl; + << one_minus_dir_dot_dir << LL_ENDL; #endif // the lines are approximately parallel // We shouldn't fall in here because this check should have been made diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 25bec541c..3d6310310 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -110,7 +110,7 @@ public: } void dump() { - llinfos << llformat("Lifetime: Allocs:(+%u|-%u) Allocs/s: (+%lf|-%lf) Nodes: %u AccumSize: %llubytes Avg: %lf LargestSize: %u", + LL_INFOS() << llformat("Lifetime: Allocs:(+%u|-%u) Allocs/s: (+%lf|-%lf) Nodes: %u AccumSize: %llubytes Avg: %lf LargestSize: %u", mTotalAllocs, mTotalFrees, F64(mTotalAllocs)/mTotalTimer.getElapsedTimeF64(), @@ -119,8 +119,8 @@ public: mTotalSize*sizeof(LLPointer), F64(mTotalSize)/F64(mTotalNodes), mLargestSize - ) << llendl; - llinfos << llformat("Timeslice: Allocs:(+%u|-%u) Allocs/s: (+%lf|-%lf) Nodes:(+%u|-%u) LargestSize: %u", + ) << LL_ENDL; + LL_INFOS() << llformat("Timeslice: Allocs:(+%u|-%u) Allocs/s: (+%lf|-%lf) Nodes:(+%u|-%u) LargestSize: %u", mPeriodAllocs, mPeriodFrees, F64(mPeriodAllocs)/mPeriodTimer.getElapsedTimeF64(), @@ -128,7 +128,7 @@ public: mPeriodNodesCreated, mPeriodNodesDestroyed, mPeriodLargestSize - ) << llendl; + ) << LL_ENDL; mPeriodNodesCreated=0; mPeriodNodesDestroyed=0; @@ -197,7 +197,7 @@ struct OctreeGuard { if((*it)->mNode == node) { - OCT_ERRS << "!!! MANIPULATING OCTREE BRANCH DURING ITERATION !!!" << llendl; + OCT_ERRS << "!!! MANIPULATING OCTREE BRANCH DURING ITERATION !!!" << LL_ENDL; return true; } } @@ -456,12 +456,12 @@ public: if (child->getOctant() != i) { - llerrs << "Invalid child map, bad octant data." << llendl; + LL_ERRS() << "Invalid child map, bad octant data." << LL_ENDL; } if (getOctant(child->getCenter()) != child->getOctant()) { - llerrs << "Invalid child octant compared to position data." << llendl; + LL_ERRS() << "Invalid child octant compared to position data." << LL_ENDL; } } } @@ -503,7 +503,7 @@ public: OctreeGuard::checkGuarded(this); if (data == NULL || data->getBinIndex() != -1) { - OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << llendl; + OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << LL_ENDL; return false; } LLOctreeNode* parent = getOctParent(); @@ -601,7 +601,7 @@ public: if (getChildCount() == 8) { //this really isn't possible, something bad has happened - OCT_ERRS << "Octree detected floating point error and gave up." << llendl; + OCT_ERRS << "Octree detected floating point error and gave up." << LL_ENDL; return false; } @@ -610,7 +610,7 @@ public: { if (mChild[i]->getCenter().equals3(center)) { - OCT_ERRS << "Octree detected duplicate child center and gave up." << llendl; + OCT_ERRS << "Octree detected duplicate child center and gave up." << LL_ENDL; return false; } } @@ -629,7 +629,7 @@ public: else { //it's not in here, give it to the root - OCT_ERRS << "Octree insertion failed, starting over from root!" << llendl; + OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL; oct_node* node = this; @@ -749,7 +749,7 @@ public: } //node is now root - llwarns << "!!! OCTREE REMOVING ELEMENT BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl; + LL_WARNS() << "!!! OCTREE REMOVING ELEMENT BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << LL_ENDL; node->removeByAddress(data); llassert(data->getBinIndex() == -1); return true; @@ -764,7 +764,7 @@ public: if (mData[i] == data) { //we have data _remove(data, i); - llwarns << "FOUND!" << llendl; + LL_WARNS() << "FOUND!" << LL_ENDL; return; } } @@ -793,7 +793,7 @@ public: mChild[i]->validate(); if (mChild[i]->getParent() != this) { - llerrs << "Octree child has invalid parent." << llendl; + LL_ERRS() << "Octree child has invalid parent." << LL_ENDL; } } #endif @@ -819,24 +819,24 @@ public: if (child->getSize().equals3(getSize())) { - OCT_ERRS << "Child size is same as parent size!" << llendl; + OCT_ERRS << "Child size is same as parent size!" << LL_ENDL; } for (U32 i = 0; i < getChildCount(); i++) { if(!mChild[i]->getSize().equals3(child->getSize())) { - OCT_ERRS <<"Invalid octree child size." << llendl; + OCT_ERRS <<"Invalid octree child size." << LL_ENDL; } if (mChild[i]->getCenter().equals3(child->getCenter())) { - OCT_ERRS <<"Duplicate octree child position." << llendl; + OCT_ERRS <<"Duplicate octree child position." << LL_ENDL; } } if (mChild.size() >= 8) { - OCT_ERRS <<"Octree node has too many children... why?" << llendl; + OCT_ERRS <<"Octree node has too many children... why?" << LL_ENDL; } #endif OctreeGuard::checkGuarded(this); @@ -913,7 +913,7 @@ public: } } - OCT_ERRS << "Octree failed to delete requested child." << llendl; + OCT_ERRS << "Octree failed to delete requested child." << LL_ENDL; } protected: @@ -1016,13 +1016,13 @@ public: { if (data == NULL) { - OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << llendl; + OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << LL_ENDL; return false; } if (data->getBinRadius() > 4096.0) { - OCT_ERRS << "!!! ELEMENT EXCEEDS MAXIMUM SIZE IN OCTREE ROOT !!!" << llendl; + OCT_ERRS << "!!! ELEMENT EXCEEDS MAXIMUM SIZE IN OCTREE ROOT !!!" << LL_ENDL; return false; } @@ -1038,7 +1038,7 @@ public: if (lt != 0x7) { - //OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl; + //OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << LL_ENDL; return false; } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index e415961f0..29c0c9b91 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -426,7 +426,7 @@ public: } else { - llerrs << "Empty leaf" << llendl; + LL_ERRS() << "Empty leaf" << LL_ENDL; } for (U32 i = 0; i < branch->getChildCount(); ++i) @@ -833,7 +833,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai if (detail < MIN_LOD) { - llinfos << "Generating profile with LOD < MIN_LOD. CLAMPING" << llendl; + LL_INFOS() << "Generating profile with LOD < MIN_LOD. CLAMPING" << LL_ENDL; detail = MIN_LOD; } @@ -849,7 +849,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai // Quick validation to eliminate some server crashes. if (begin > end - 0.01f) { - llwarns << "LLProfile::generate() assertion failed (begin >= end)" << llendl; + LL_WARNS() << "LLProfile::generate() assertion failed (begin >= end)" << LL_ENDL; return FALSE; } @@ -1070,7 +1070,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai } break; default: - llerrs << "Unknown profile: getCurveType()=" << params.getCurveType() << llendl; + LL_ERRS() << "Unknown profile: getCurveType()=" << params.getCurveType() << LL_ENDL; break; }; @@ -1152,7 +1152,7 @@ BOOL LLProfileParams::importFile(LLFILE *fp) } else { - llwarns << "unknown keyword " << keyword << " in profile import" << llendl; + LL_WARNS() << "unknown keyword " << keyword << " in profile import" << LL_ENDL; } } @@ -1224,7 +1224,7 @@ BOOL LLProfileParams::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword " << keyword << " in profile import" << llendl; + LL_WARNS() << "unknown keyword " << keyword << " in profile import" << LL_ENDL; } } @@ -1546,7 +1546,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, if (detail < MIN_LOD) { - llinfos << "Generating path with LOD < MIN! Clamping to 1" << llendl; + LL_INFOS() << "Generating path with LOD < MIN! Clamping to 1" << LL_ENDL; detail = MIN_LOD; } @@ -1808,7 +1808,7 @@ BOOL LLPathParams::importFile(LLFILE *fp) } else { - llwarns << "unknown keyword " << " in path import" << llendl; + LL_WARNS() << "unknown keyword " << " in path import" << LL_ENDL; } } return TRUE; @@ -1948,7 +1948,7 @@ BOOL LLPathParams::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword " << " in path import" << llendl; + LL_WARNS() << "unknown keyword " << " in path import" << LL_ENDL; } } return TRUE; @@ -2039,7 +2039,7 @@ LLProfile::~LLProfile() { if(profile_delete_lock) { - llerrs << "LLProfile should not be deleted here!" << llendl ; + LL_ERRS() << "LLProfile should not be deleted here!" << LL_ENDL ; } } @@ -2380,7 +2380,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (face_count == 0) { //no faces unpacked, treat as failed decode - llwarns << "found no faces!" << llendl; + LL_WARNS() << "found no faces!" << LL_ENDL; return false; } @@ -2413,7 +2413,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (idx.empty() || face.mNumIndices < 3) { //why is there an empty index list? - llwarns <<"Empty face present!" << llendl; + LL_WARNS() <<"Empty face present!" << LL_ENDL; continue; } @@ -2559,7 +2559,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) if (cur_vertex != num_verts || idx != weights.size()) { - llwarns << "Vertex weight count does not match vertex count!" << llendl; + LL_WARNS() << "Vertex weight count does not match vertex count!" << LL_ENDL; } } @@ -2725,7 +2725,7 @@ void LLVolume::createVolumeFaces() vf.mNumS = face.mCount; if (vf.mNumS < 0) { - llerrs << "Volume face corruption detected." << llendl; + LL_ERRS() << "Volume face corruption detected." << LL_ENDL; } vf.mBeginT = 0; @@ -2773,7 +2773,7 @@ void LLVolume::createVolumeFaces() vf.mNumS = vf.mNumS*2; if (vf.mNumS < 0) { - llerrs << "Volume face corruption detected." << llendl; + LL_ERRS() << "Volume face corruption detected." << LL_ENDL; } } } @@ -3141,7 +3141,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, // weird crash bug - DEV-11158 - trying to collect more data: if ((sizeS == 0) || (sizeT == 0)) { - llwarns << "sculpt bad mesh size " << sizeS << " " << sizeT << llendl; + LL_WARNS() << "sculpt bad mesh size " << sizeS << " " << sizeT << LL_ENDL; } sNumMeshPoints -= mMesh.size(); @@ -3536,16 +3536,16 @@ bool LLVolumeParams::setType(U8 profile, U8 path) // Bad profile. Make it square. profile = LL_PCODE_PROFILE_SQUARE; result = false; - llwarns << "LLVolumeParams::setType changing bad profile type (" << profile_type - << ") to be LL_PCODE_PROFILE_SQUARE" << llendl; + LL_WARNS() << "LLVolumeParams::setType changing bad profile type (" << profile_type + << ") to be LL_PCODE_PROFILE_SQUARE" << LL_ENDL; } else if (hole_type > LL_PCODE_HOLE_MAX) { // Bad hole. Make it the same. profile = profile_type; result = false; - llwarns << "LLVolumeParams::setType changing bad hole type (" << hole_type - << ") to be LL_PCODE_HOLE_SAME" << llendl; + LL_WARNS() << "LLVolumeParams::setType changing bad hole type (" << hole_type + << ") to be LL_PCODE_HOLE_SAME" << LL_ENDL; } if (path_type < LL_PCODE_PATH_MIN || @@ -3553,8 +3553,8 @@ bool LLVolumeParams::setType(U8 profile, U8 path) { // Bad path. Make it linear. result = false; - llwarns << "LLVolumeParams::setType changing bad path (" << path - << ") to be LL_PCODE_PATH_LINE" << llendl; + LL_WARNS() << "LLVolumeParams::setType changing bad path (" << path + << ") to be LL_PCODE_PATH_LINE" << LL_ENDL; path = LL_PCODE_PATH_LINE; } @@ -4142,7 +4142,7 @@ BOOL equalTriangle(const S32 *a, const S32 *b) BOOL LLVolumeParams::importFile(LLFILE *fp) { - //llinfos << "importing volume" << llendl; + //LL_INFOS() << "importing volume" << LL_ENDL; const S32 BUFSIZE = 16384; char buffer[BUFSIZE]; /* Flawfinder: ignore */ // *NOTE: changing the size or type of this buffer will require @@ -4176,7 +4176,7 @@ BOOL LLVolumeParams::importFile(LLFILE *fp) } else { - llwarns << "unknown keyword " << keyword << " in volume import" << llendl; + LL_WARNS() << "unknown keyword " << keyword << " in volume import" << LL_ENDL; } } @@ -4196,7 +4196,7 @@ BOOL LLVolumeParams::exportFile(LLFILE *fp) const BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream) { - //llinfos << "importing volume" << llendl; + //LL_INFOS() << "importing volume" << LL_ENDL; const S32 BUFSIZE = 16384; // *NOTE: changing the size or type of this buffer will require // changing the sscanf below. @@ -4226,7 +4226,7 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword " << keyword << " in volume import" << llendl; + LL_WARNS() << "unknown keyword " << keyword << " in volume import" << LL_ENDL; } } @@ -4438,7 +4438,7 @@ LLFaceID LLVolume::generateFaceMask() } break; default: - llerrs << "Unknown profile!" << llendl; + LL_ERRS() << "Unknown profile!" << LL_ENDL; break; } @@ -4735,7 +4735,7 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) } else { - llerrs << "Unknown/uninitialized face type!" << llendl; + LL_ERRS() << "Unknown/uninitialized face type!" << LL_ENDL; } return ret ; @@ -5336,7 +5336,7 @@ void LLVolumeFace::cacheOptimize() mTangents = binorm; //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); - //llinfos << result << llendl; + //LL_INFOS() << result << LL_ENDL; } @@ -6205,12 +6205,12 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat if (new_count > 65536) { - llerrs << "Cannot append face -- 16-bit overflow will occur." << llendl; + LL_ERRS() << "Cannot append face -- 16-bit overflow will occur." << LL_ENDL; } if (face.mNumVertices == 0) { - llerrs << "Cannot append empty face." << llendl; + LL_ERRS() << "Cannot append empty face." << LL_ENDL; } U32 old_vsize = mNumVertices*16; diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index dcc2d81cf..07d174926 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -147,7 +147,7 @@ void LLVolumeMgr::unrefVolume(LLVolume *volumep) volume_lod_group_map_t::iterator iter = mVolumeLODGroups.find(params); if( iter == mVolumeLODGroups.end() ) { - llerrs << "Warning! Tried to cleanup unknown volume type! " << *params << llendl; + LL_ERRS() << "Warning! Tried to cleanup unknown volume type! " << *params << LL_ENDL; if (mDataMutex) { mDataMutex->unlock(); @@ -207,7 +207,7 @@ void LLVolumeMgr::dump() { mDataMutex->unlock(); } - llinfos << "Average usage of LODs " << avg << llendl; + LL_INFOS() << "Average usage of LODs " << avg << LL_ENDL; } void LLVolumeMgr::useMutex() @@ -270,18 +270,18 @@ bool LLVolumeLODGroup::cleanupRefs() bool res = true; if (mRefs != 0) { - llwarns << "Volume group has remaining refs:" << getNumRefs() << llendl; + LL_WARNS() << "Volume group has remaining refs:" << getNumRefs() << LL_ENDL; mRefs = 0; for (S32 i = 0; i < NUM_LODS; i++) { if (mLODRefs[i] > 0) { - llwarns << " LOD " << i << " refs = " << mLODRefs[i] << llendl; + LL_WARNS() << " LOD " << i << " refs = " << mLODRefs[i] << LL_ENDL; mLODRefs[i] = 0; mVolumeLODs[i] = NULL; } } - llwarns << *getVolumeParams() << llendl; + LL_WARNS() << *getVolumeParams() << LL_ENDL; res = false; } return res; @@ -320,7 +320,7 @@ BOOL LLVolumeLODGroup::derefLOD(LLVolume *volumep) return TRUE; } } - llerrs << "Deref of non-matching LOD in volume LOD group" << llendl; + LL_ERRS() << "Deref of non-matching LOD in volume LOD group" << LL_ENDL; return FALSE; } @@ -393,7 +393,7 @@ F32 LLVolumeLODGroup::dump() std::string dump_str = llformat("%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); - llinfos << dump_str << llendl; + LL_INFOS() << dump_str << LL_ENDL; return usage; } diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index dc1f013b7..617e0812a 100644 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp @@ -237,7 +237,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode* branch) if (!test_min.equals3(min, 0.001f) || !test_max.equals3(max, 0.001f)) { - llerrs << "Bad bounding box data found." << llendl; + LL_ERRS() << "Bad bounding box data found." << LL_ENDL; } test_min.sub(LLVector4a(0.001f)); @@ -251,7 +251,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode* branch) if (child->mExtents[0].lessThan(test_min).areAnySet(LLVector4Logical::MASK_XYZ) || child->mExtents[1].greaterThan(test_max).areAnySet(LLVector4Logical::MASK_XYZ)) { - llerrs << "Child protrudes from bounding box." << llendl; + LL_ERRS() << "Child protrudes from bounding box." << LL_ENDL; } } @@ -267,7 +267,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode* branch) if (tri->mV[i]->greaterThan(test_max).areAnySet(LLVector4Logical::MASK_XYZ) || tri->mV[i]->lessThan(test_min).areAnySet(LLVector4Logical::MASK_XYZ)) { - llerrs << "Triangle protrudes from node." << llendl; + LL_ERRS() << "Triangle protrudes from node." << LL_ENDL; } } } diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 61b90f68a..0cc78fd13 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -58,7 +58,7 @@ public: const LLVolumeTriangle& operator=(const LLVolumeTriangle& rhs) { - llerrs << "Illegal operation!" << llendl; + LL_ERRS() << "Illegal operation!" << LL_ENDL; return *this; } @@ -107,7 +107,7 @@ public: const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) { - llerrs << "Illegal operation!" << llendl; + LL_ERRS() << "Illegal operation!" << LL_ENDL; return *this; } diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 8e63b4357..a47c93e93 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -245,7 +245,7 @@ void LLColor4::setValue(const LLSD& sd) if (out_of_range) { - llwarns << "LLSD color value out of range!" << llendl; + LL_WARNS() << "LLSD color value out of range!" << LL_ENDL; } #else mV[0] = (F32) sd[0].asReal(); @@ -417,7 +417,7 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) if (token_iter == tokens.end()) { // This is a malformed vector. - llwarns << "LLColor4::parseColor() malformed color " << buf << llendl; + LL_WARNS() << "LLColor4::parseColor() malformed color " << buf << LL_ENDL; } else { @@ -704,7 +704,7 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) } else { - llwarns << "invalid color " << color_name << llendl; + LL_WARNS() << "invalid color " << color_name << LL_ENDL; } } diff --git a/indra/llmath/xform.cpp b/indra/llmath/xform.cpp index 62033eabd..e7a9c9bdf 100644 --- a/indra/llmath/xform.cpp +++ b/indra/llmath/xform.cpp @@ -39,7 +39,7 @@ LLXform::~LLXform() // Link optimization - don't inline these LL_WARNS() void LLXform::warn(const char* const msg) { - llwarns << msg << llendl; + LL_WARNS() << msg << LL_ENDL; } LLXform* LLXform::getRoot() const diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 06efd3cb4..f9fd07c64 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -219,9 +219,9 @@ void ssl_init(void) if (linked_openSSL_major != compiled_openSSL_major || (linked_openSSL_major == 0 && linked_openSSL_minor != compiled_openSSL_minor)) { - llerrs << "The viewer was compiled against " << OPENSSL_VERSION_TEXT << + LL_ERRS() << "The viewer was compiled against " << OPENSSL_VERSION_TEXT << " but linked against " << SSLeay_version(SSLEAY_VERSION) << - ". Those versions are not compatible." << llendl; + ". Those versions are not compatible." << LL_ENDL; } // Static locks vector. ssl_rwlock_array = new AIRWLock[CRYPTO_num_locks()]; @@ -251,8 +251,8 @@ void ssl_init(void) CRYPTO_set_dynlock_lock_callback(&ssl_dyn_lock_function); CRYPTO_set_dynlock_destroy_callback(&ssl_dyn_destroy_function); need_renegotiation_hack = (0x10001000UL <= ssleay); - llinfos << "Successful initialization of " << - SSLeay_version(SSLEAY_VERSION) << " (0x" << std::hex << SSLeay() << std::dec << ")." << llendl; + LL_INFOS() << "Successful initialization of " << + SSLeay_version(SSLEAY_VERSION) << " (0x" << std::hex << SSLeay() << std::dec << ")." << LL_ENDL; } // Cleanup OpenSSL library thread-safety. @@ -329,7 +329,7 @@ void initCurl(void) CURLcode res = curl_global_init(CURL_GLOBAL_ALL); if (res != CURLE_OK) { - llerrs << "curl_global_init(CURL_GLOBAL_ALL) failed." << llendl; + LL_ERRS() << "curl_global_init(CURL_GLOBAL_ALL) failed." << LL_ENDL; } // Print version and do some feature sanity checks. @@ -339,26 +339,26 @@ void initCurl(void) llassert_always(version_info->age >= 0); if (version_info->age < 1) { - llwarns << "libcurl's age is 0; no ares support." << llendl; + LL_WARNS() << "libcurl's age is 0; no ares support." << LL_ENDL; } llassert_always((version_info->features & CURL_VERSION_SSL)); // SSL support, added in libcurl 7.10. if (!(version_info->features & CURL_VERSION_ASYNCHDNS)) // Asynchronous name lookups (added in libcurl 7.10.7). { - llwarns << "libcurl was not compiled with support for asynchronous name lookups!" << llendl; + LL_WARNS() << "libcurl was not compiled with support for asynchronous name lookups!" << LL_ENDL; } if (!version_info->ssl_version) { - llerrs << "This libcurl has no SSL support!" << llendl; + LL_ERRS() << "This libcurl has no SSL support!" << LL_ENDL; } - llinfos << "Successful initialization of libcurl " << + LL_INFOS() << "Successful initialization of libcurl " << version_info->version << " (0x" << std::hex << version_info->version_num << std::dec << "), (" << version_info->ssl_version; if (version_info->libz_version) { - llcont << ", libz/" << version_info->libz_version; + LL_CONT << ", libz/" << version_info->libz_version; } - llcont << ")." << llendl; + LL_CONT << ")." << LL_ENDL; // Detect SSL library used. gSSLlib = ssl_unknown; @@ -376,12 +376,12 @@ void initCurl(void) { case ssl_unknown: { - llerrs << "Unknown SSL library \"" << version_info->ssl_version << "\", required actions for thread-safe handling are unknown! Bailing out." << llendl; + LL_ERRS() << "Unknown SSL library \"" << version_info->ssl_version << "\", required actions for thread-safe handling are unknown! Bailing out." << LL_ENDL; } case ssl_openssl: { #ifndef OPENSSL_THREADS - llerrs << "OpenSSL was not configured with thread support! Bailing out." << llendl; + LL_ERRS() << "OpenSSL was not configured with thread support! Bailing out." << LL_ENDL; #endif ssl_init(); } @@ -402,7 +402,7 @@ void initCurl(void) gSetoptParamsNeedDup = (version_info->version_num < encoded_version(7, 17, 0)); if (gSetoptParamsNeedDup) { - llwarns << "Your libcurl version is too old." << llendl; + LL_WARNS() << "Your libcurl version is too old." << LL_ENDL; } llassert_always(!gSetoptParamsNeedDup); // Might add support later. } @@ -427,7 +427,7 @@ void cleanupCurl(void) stopCurlThread(); if (CurlMultiHandle::getTotalMultiHandles() != 0) - llwarns << "Not all CurlMultiHandle objects were destroyed!" << llendl; + LL_WARNS() << "Not all CurlMultiHandle objects were destroyed!" << LL_ENDL; gMainThreadEngine.flush(); // Not really related to curl, but why not. gStateMachineThreadEngine.flush(); clearCommandQueue(); @@ -470,20 +470,20 @@ U32 getNumHTTPRunning(void) void Stats::print(void) { int const easy_handles = easy_init_calls - easy_init_errors - easy_cleanup_calls; - llinfos_nf << "============ CURL STATS ============" << llendl; - llinfos_nf << " Curl multi errors/calls : " << std::dec << multi_errors << "/" << multi_calls << llendl; - llinfos_nf << " Curl easy errors/calls : " << std::dec << easy_errors << "/" << easy_calls << llendl; - llinfos_nf << " curl_easy_init() errors/calls : " << std::dec << easy_init_errors << "/" << easy_init_calls << llendl; - llinfos_nf << " Current number of curl easy handles: " << std::dec << easy_handles << llendl; + LL_INFOS_NF() << "============ CURL STATS ============" << LL_ENDL; + LL_INFOS_NF() << " Curl multi errors/calls : " << std::dec << multi_errors << "/" << multi_calls << LL_ENDL; + LL_INFOS_NF() << " Curl easy errors/calls : " << std::dec << easy_errors << "/" << easy_calls << LL_ENDL; + LL_INFOS_NF() << " curl_easy_init() errors/calls : " << std::dec << easy_init_errors << "/" << easy_init_calls << LL_ENDL; + LL_INFOS_NF() << " Current number of curl easy handles: " << std::dec << easy_handles << LL_ENDL; #ifdef DEBUG_CURLIO - llinfos_nf << " Current number of BufferedCurlEasyRequest objects: " << BufferedCurlEasyRequest_count << llendl; - llinfos_nf << " Current number of ThreadSafeBufferedCurlEasyRequest objects: " << ThreadSafeBufferedCurlEasyRequest_count << llendl; - llinfos_nf << " Current number of AICurlEasyRequest objects: " << AICurlEasyRequest_count << llendl; - llinfos_nf << " Current number of AICurlEasyRequestStateMachine objects: " << AICurlEasyRequestStateMachine_count << llendl; + LL_INFOS_NF() << " Current number of BufferedCurlEasyRequest objects: " << BufferedCurlEasyRequest_count << LL_ENDL; + LL_INFOS_NF() << " Current number of ThreadSafeBufferedCurlEasyRequest objects: " << ThreadSafeBufferedCurlEasyRequest_count << LL_ENDL; + LL_INFOS_NF() << " Current number of AICurlEasyRequest objects: " << AICurlEasyRequest_count << LL_ENDL; + LL_INFOS_NF() << " Current number of AICurlEasyRequestStateMachine objects: " << AICurlEasyRequestStateMachine_count << LL_ENDL; #endif - llinfos_nf << " Current number of Responders: " << ResponderBase_count << llendl; - llinfos_nf << " Received HTTP bodies LLSD / LLSD parse errors / non-LLSD: " << llsd_body_count << "/" << llsd_body_parse_error << "/" << raw_body_count << llendl; - llinfos_nf << " Received HTTP status codes: status (count) [...]: "; + LL_INFOS_NF() << " Current number of Responders: " << ResponderBase_count << LL_ENDL; + LL_INFOS_NF() << " Received HTTP bodies LLSD / LLSD parse errors / non-LLSD: " << llsd_body_count << "/" << llsd_body_parse_error << "/" << raw_body_count << LL_ENDL; + LL_INFOS_NF() << " Received HTTP status codes: status (count) [...]: "; bool first = true; for (U32 index = 0; index < 100; ++index) { @@ -491,17 +491,17 @@ void Stats::print(void) { if (!first) { - llcont << ", "; + LL_CONT << ", "; } else { first = false; } - llcont << index2status(index) << " (" << status_count[index] << ')'; + LL_CONT << index2status(index) << " (" << status_count[index] << ')'; } } - llcont << llendl; - llinfos_nf << "========= END OF CURL STATS =========" << llendl; + LL_CONT << LL_ENDL; + LL_INFOS_NF() << "========= END OF CURL STATS =========" << LL_ENDL; // Leak tests. // There is one easy handle per CurlEasyHandle, and BufferedCurlEasyRequest is derived from that. // It is not allowed to create CurlEasyHandle (or CurlEasyRequest) directly, only by creating a BufferedCurlEasyRequest, @@ -536,8 +536,8 @@ extern int debug_callback(CURL*, curl_infotype infotype, char* buf, size_t size, void handle_multi_error(CURLMcode code) { Stats::multi_errors++; - llinfos << "curl multi error detected: " << curl_multi_strerror(code) << - "; (errors/calls = " << Stats::multi_errors << "/" << Stats::multi_calls << ")" << llendl; + LL_INFOS() << "curl multi error detected: " << curl_multi_strerror(code) << + "; (errors/calls = " << Stats::multi_errors << "/" << Stats::multi_calls << ")" << LL_ENDL; } //============================================================================= @@ -552,13 +552,13 @@ void handle_multi_error(CURLMcode code) void CurlEasyHandle::handle_easy_error(CURLcode code) { char* error_buffer = LLThreadLocalData::tldata().mCurlErrorBuffer; - llinfos << "curl easy error detected: " << curl_easy_strerror(code); + LL_INFOS() << "curl easy error detected: " << curl_easy_strerror(code); if (error_buffer && *error_buffer != '\0') { - llcont << ": " << error_buffer; + LL_CONT << ": " << error_buffer; } Stats::easy_errors++; - llcont << "; (errors/calls = " << Stats::easy_errors << "/" << Stats::easy_calls << ")" << llendl; + LL_CONT << "; (errors/calls = " << Stats::easy_errors << "/" << Stats::easy_calls << ")" << LL_ENDL; } // Throws AICurlNoEasyHandle. @@ -637,7 +637,7 @@ void CurlEasyHandle::setErrorBuffer(void) const CURLcode res = curl_easy_setopt(mEasyHandle, CURLOPT_ERRORBUFFER, error_buffer); if (res != CURLE_OK) { - llwarns << "curl_easy_setopt(" << (void*)mEasyHandle << "CURLOPT_ERRORBUFFER, " << (void*)error_buffer << ") failed with error " << res << llendl; + LL_WARNS() << "curl_easy_setopt(" << (void*)mEasyHandle << "CURLOPT_ERRORBUFFER, " << (void*)error_buffer << ") failed with error " << res << LL_ENDL; mErrorBuffer = NULL; } } @@ -918,35 +918,35 @@ void CurlEasyRequest::setProgressCallback(curl_progress_callback callback, void* setopt(CURLOPT_PROGRESSDATA, userdata ? this : NULL); } -#define llmaybewarns lllog(LLApp::isExiting() ? LLError::LEVEL_INFO : LLError::LEVEL_WARN, NULL, NULL, false, true) +#define llmaybewarns lllog(LLApp::isExiting() ? LLError::LEVEL_INFO : LLError::LEVEL_WARN, false, true) static size_t noHeaderCallback(char* ptr, size_t size, size_t nmemb, void* userdata) { - llmaybewarns << "Calling noHeaderCallback(); curl session aborted." << llendl; + llmaybewarns << "Calling noHeaderCallback(); curl session aborted." << LL_ENDL; return 0; // Cause a CURLE_WRITE_ERROR } static size_t noWriteCallback(char* ptr, size_t size, size_t nmemb, void* userdata) { - llmaybewarns << "Calling noWriteCallback(); curl session aborted." << llendl; + llmaybewarns << "Calling noWriteCallback(); curl session aborted." << LL_ENDL; return 0; // Cause a CURLE_WRITE_ERROR } static size_t noReadCallback(char* ptr, size_t size, size_t nmemb, void* userdata) { - llmaybewarns << "Calling noReadCallback(); curl session aborted." << llendl; + llmaybewarns << "Calling noReadCallback(); curl session aborted." << LL_ENDL; return CURL_READFUNC_ABORT; // Cause a CURLE_ABORTED_BY_CALLBACK } static CURLcode noSSLCtxCallback(CURL* curl, void* sslctx, void* parm) { - llmaybewarns << "Calling noSSLCtxCallback(); curl session aborted." << llendl; + llmaybewarns << "Calling noSSLCtxCallback(); curl session aborted." << LL_ENDL; return CURLE_ABORTED_BY_CALLBACK; } static int noProgressCallback(void* userdata, double, double, double, double) { - llmaybewarns << "Calling noProgressCallback(); curl session aborted." << llendl; + llmaybewarns << "Calling noProgressCallback(); curl session aborted." << LL_ENDL; return -1; // Cause a CURLE_ABORTED_BY_CALLBACK } @@ -968,7 +968,7 @@ void CurlEasyRequest::revokeCallbacks(void) mProgressCallback = &noProgressCallback; if (active() && !no_warning()) { - llwarns << "Revoking callbacks on a still active CurlEasyRequest object!" << llendl; + LL_WARNS() << "Revoking callbacks on a still active CurlEasyRequest object!" << LL_ENDL; } curl_easy_setopt(getEasyHandle(), CURLOPT_HEADERFUNCTION, &noHeaderCallback); curl_easy_setopt(getEasyHandle(), CURLOPT_WRITEHEADER, &noWriteCallback); @@ -1139,7 +1139,7 @@ void CurlEasyRequest::finalizeRequest(std::string const& url, AIHTTPTimeoutPolic } if (content_type_count > 1) { - llwarns << "Requesting: \"" << url << "\": " << content_type_count << " Content-Type: headers!" << llendl; + LL_WARNS() << "Requesting: \"" << url << "\": " << content_type_count << " Content-Type: headers!" << LL_ENDL; } #endif setopt(CURLOPT_HTTPHEADER, mHeaders); @@ -1313,7 +1313,7 @@ BufferedCurlEasyRequest::BufferedCurlEasyRequest() : AICurlInterface::Stats::BufferedCurlEasyRequest_count++; } -#define llmaybeerrs lllog(LLApp::isRunning() ? LLError::LEVEL_ERROR : LLError::LEVEL_WARN, NULL, NULL, false, true) +#define llmaybeerrs lllog(LLApp::isRunning() ? LLError::LEVEL_ERROR : LLError::LEVEL_WARN, false, true) BufferedCurlEasyRequest::~BufferedCurlEasyRequest() { @@ -1327,7 +1327,7 @@ BufferedCurlEasyRequest::~BufferedCurlEasyRequest() // in which case AICurlEasyRequestStateMachine::mTimer times out, a socket goes bad, or // the state machine is aborted, but those already call BufferedCurlEasyRequest::aborted() // which sets mResponder to NULL. - llmaybeerrs << "Calling ~BufferedCurlEasyRequest() with active responder!" << llendl; + llmaybeerrs << "Calling ~BufferedCurlEasyRequest() with active responder!" << LL_ENDL; if (!LLApp::isRunning()) { // It might happen if some BufferedCurlEasyRequest escaped clean up somehow :/ @@ -1414,7 +1414,7 @@ void BufferedCurlEasyRequest::print_diagnostics(CURLcode code) } else { - llwarns << "Curl returned error code " << code << " (" << curl_easy_strerror(code) << ") for HTTP request to \"" << eff_url << "\"." << llendl; + LL_WARNS() << "Curl returned error code " << code << " (" << curl_easy_strerror(code) << ") for HTTP request to \"" << eff_url << "\"." << LL_ENDL; } } diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index fb8427da4..cfb4fc709 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -658,6 +658,6 @@ void AIPerService::Approvement::honored(void) void AIPerService::Approvement::not_honored(void) { honored(); - llwarns << "Approvement for has not been honored." << llendl; + LL_WARNS() << "Approvement for has not been honored." << LL_ENDL; } diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 8bc56d6f0..a66790f1d 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -563,7 +563,7 @@ refresh_t PollSet::refresh(void) // by not calculating mMaxFdSet here. if (mNrFds >= FD_SETSIZE) { - llwarns << "PollSet::reset: More than FD_SETSIZE (" << FD_SETSIZE << ") file descriptors active!" << llendl; + LL_WARNS() << "PollSet::reset: More than FD_SETSIZE (" << FD_SETSIZE << ") file descriptors active!" << LL_ENDL; #if !WINDOWS_CODE // Calculate mMaxFdSet. // Run over FD_SETSIZE - 1 elements, starting at mNext, wrapping to 0 when we reach the end. @@ -1020,20 +1020,20 @@ void AICurlThread::create_wakeup_fds(void) curl_socket_t socks[2]; if (dumb_socketpair(socks, false) == SOCKET_ERROR) { - llerrs << "Failed to generate wake-up socket pair" << formatWSAError() << llendl; + LL_ERRS() << "Failed to generate wake-up socket pair" << formatWSAError() << LL_ENDL; return; } u_long nonblocking_enable = TRUE; int error = ioctlsocket(socks[0], FIONBIO, &nonblocking_enable); if(error) { - llerrs << "Failed to set wake-up socket nonblocking: " << formatWSAError() << llendl; + LL_ERRS() << "Failed to set wake-up socket nonblocking: " << formatWSAError() << LL_ENDL; } llassert(nonblocking_enable); error = ioctlsocket(socks[1], FIONBIO, &nonblocking_enable); if(error) { - llerrs << "Failed to set wake-up input socket nonblocking: " << formatWSAError() << llendl; + LL_ERRS() << "Failed to set wake-up input socket nonblocking: " << formatWSAError() << LL_ENDL; } mWakeUpFd = socks[0]; mWakeUpFd_in = socks[1]; @@ -1041,14 +1041,14 @@ void AICurlThread::create_wakeup_fds(void) int pipefd[2]; if (pipe(pipefd)) { - llerrs << "Failed to create wakeup pipe: " << strerror(errno) << llendl; + LL_ERRS() << "Failed to create wakeup pipe: " << strerror(errno) << LL_ENDL; } int const flags = O_NONBLOCK; for (int i = 0; i < 2; ++i) { if (fcntl(pipefd[i], F_SETFL, flags)) { - llerrs << "Failed to set pipe to non-blocking: " << strerror(errno) << llendl; + LL_ERRS() << "Failed to set pipe to non-blocking: " << strerror(errno) << LL_ENDL; } } mWakeUpFd = pipefd[0]; // Read-end of the pipe. @@ -1066,7 +1066,7 @@ void AICurlThread::cleanup_wakeup_fds(void) int error = closesocket(mWakeUpFd); if (error) { - llwarns << "Error closing wake-up socket" << formatWSAError() << llendl; + LL_WARNS() << "Error closing wake-up socket" << formatWSAError() << LL_ENDL; } } if (mWakeUpFd_in != CURL_SOCKET_BAD) @@ -1074,7 +1074,7 @@ void AICurlThread::cleanup_wakeup_fds(void) int error = closesocket(mWakeUpFd_in); if (error) { - llwarns << "Error closing wake-up input socket" << formatWSAError() << llendl; + LL_WARNS() << "Error closing wake-up input socket" << formatWSAError() << LL_ENDL; } } #else @@ -1128,7 +1128,7 @@ void AICurlThread::wakeup_thread(bool stop_thread) int len = send(mWakeUpFd_in, "!", 1, 0); if (len == SOCKET_ERROR) { - llerrs << "Send to wake-up socket failed: " << formatWSAError() << llendl; + LL_ERRS() << "Send to wake-up socket failed: " << formatWSAError() << LL_ENDL; } llassert_always(len == 1); //SGTODO: handle EAGAIN if needed @@ -1153,7 +1153,7 @@ void AICurlThread::wakeup_thread(bool stop_thread) while(len == -1 && errno == EINTR); if (len == -1) { - llerrs << "write(3) to mWakeUpFd_in: " << strerror(errno) << llendl; + LL_ERRS() << "write(3) to mWakeUpFd_in: " << strerror(errno) << LL_ENDL; } llassert_always(len == 1); #endif @@ -1210,14 +1210,14 @@ void AICurlThread::wakeup(AICurlMultiHandle_wat const& multi_handle_w) } else { - llerrs << "read(3) from mWakeUpFd: " << formatWSAError() << llendl; + LL_ERRS() << "read(3) from mWakeUpFd: " << formatWSAError() << LL_ENDL; return; } } else { // pipe(2) returned 0. - llwarns << "read(3) from mWakeUpFd returned 0, indicating that the pipe on the other end was closed! Shutting down curl thread." << llendl; + LL_WARNS() << "read(3) from mWakeUpFd returned 0, indicating that the pipe on the other end was closed! Shutting down curl thread." << LL_ENDL; closesocket(mWakeUpFd); mWakeUpFd = CURL_SOCKET_BAD; mRunning = false; @@ -1258,14 +1258,14 @@ void AICurlThread::wakeup(AICurlMultiHandle_wat const& multi_handle_w) } else { - llerrs << "read(3) from mWakeUpFd: " << strerror(errno) << llendl; + LL_ERRS() << "read(3) from mWakeUpFd: " << strerror(errno) << LL_ENDL; return; } } else { // pipe(2) returned 0. - llwarns << "read(3) from mWakeUpFd returned 0, indicating that the pipe on the other end was closed! Shutting down curl thread." << llendl; + LL_WARNS() << "read(3) from mWakeUpFd returned 0, indicating that the pipe on the other end was closed! Shutting down curl thread." << LL_ENDL; close(mWakeUpFd); mWakeUpFd = CURL_SOCKET_BAD; mRunning = false; @@ -1459,7 +1459,7 @@ void AICurlThread::run(void) if (mZeroTimeout >= 1000) { if (mZeroTimeout % 10000 == 0) - llwarns << "Detected " << mZeroTimeout << " zero-timeout calls of select() by curl thread (more than 101 seconds)!" << llendl; + LL_WARNS() << "Detected " << mZeroTimeout << " zero-timeout calls of select() by curl thread (more than 101 seconds)!" << LL_ENDL; timeout_ms = 10; } else if (mZeroTimeout >= 100) @@ -1470,7 +1470,7 @@ void AICurlThread::run(void) else { if (LL_UNLIKELY(mZeroTimeout >= 10000)) - llinfos << "Timeout of select() call by curl thread reset (to " << timeout_ms << " ms)." << llendl; + LL_INFOS() << "Timeout of select() call by curl thread reset (to " << timeout_ms << " ms)." << LL_ENDL; mZeroTimeout = 0; } timeout.tv_sec = timeout_ms / 1000; @@ -1524,7 +1524,7 @@ void AICurlThread::run(void) // or -1 when an error occurred. A value of 0 means that a timeout occurred. if (ready == -1) { - llwarns << "select() failed: " << errno << ", " << strerror(errno) << llendl; + LL_WARNS() << "select() failed: " << errno << ", " << strerror(errno) << LL_ENDL; if (errno == EBADF) { // Somewhere (fmodex?) one of our file descriptors was closed. Try to recover by finding out which. @@ -1644,7 +1644,7 @@ MultiHandle::MultiHandle(void) : mTimeout(-1), mReadPollSet(NULL), mWritePollSet MultiHandle::~MultiHandle() { - llinfos << "Destructing MultiHandle with " << mAddedEasyRequests.size() << " active curl easy handles." << llendl; + LL_INFOS() << "Destructing MultiHandle with " << mAddedEasyRequests.size() << " active curl easy handles." << LL_ENDL; // This thread was terminated. // Curl demands that all handles are removed from the multi session handle before calling curl_multi_cleanup. @@ -1906,7 +1906,7 @@ void MultiHandle::check_msg_queue(void) } else if (res == -2) { - llwarns << "Curl easy handle returned by curl_multi_info_read() that is not (anymore) in MultiHandle::mAddedEasyRequests!?!" << llendl; + LL_WARNS() << "Curl easy handle returned by curl_multi_info_read() that is not (anymore) in MultiHandle::mAddedEasyRequests!?!" << LL_ENDL; } // Destruction of easy_request at this point, causes the CurlEasyRequest to be deleted. } @@ -2041,7 +2041,7 @@ void stopCurlThread(void) // main thread) will have destroyed before it REALLY finished. AICurlThread::sInstance->join_thread(); // Wait till it is REALLY done. } - llinfos << "Curl thread" << (curlThreadIsRunning() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << llendl; + LL_INFOS() << "Curl thread" << (curlThreadIsRunning() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << LL_ENDL; } } @@ -2069,7 +2069,7 @@ void BufferedCurlEasyRequest::setStatusAndReason(U32 status, std::string const& // Sanity check. If the server replies with a redirect status then we better have that option turned on! if ((status >= 300 && status < 400) && mResponder && !mResponder->redirect_status_ok()) { - llerrs << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which does not allow redirection!" << llendl; + LL_ERRS() << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which does not allow redirection!" << LL_ENDL; } } @@ -2287,12 +2287,12 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size if (status == 0) { reason = "Header parse error."; - llwarns << "Received broken header line from server: \"" << header << "\"" << llendl; + LL_WARNS() << "Received broken header line from server: \"" << header << "\"" << LL_ENDL; } else { reason = "Unexpected HTTP status."; - llwarns << "Received unexpected status value from server (" << status << "): \"" << header << "\"" << llendl; + LL_WARNS() << "Received unexpected status value from server (" << status << "): \"" << header << "\"" << LL_ENDL; } // Either way, this status value is not understood (or taken into account). // Set it to internal error so that the rest of code treats it as an error. @@ -2348,7 +2348,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size LLStringUtil::trim(header); if (!header.empty()) { - llwarns << "Unable to parse header: " << header << llendl; + LL_WARNS() << "Unable to parse header: " << header << LL_ENDL; } } @@ -2687,7 +2687,7 @@ bool handleCurlMaxTotalConcurrentConnections(LLSD const& newvalue) U32 old = curl_max_total_concurrent_connections; curl_max_total_concurrent_connections = newvalue.asInteger(); AIPerService::incrementMaxPipelinedRequests(curl_max_total_concurrent_connections - old); - llinfos << "CurlMaxTotalConcurrentConnections set to " << curl_max_total_concurrent_connections << llendl; + LL_INFOS() << "CurlMaxTotalConcurrentConnections set to " << curl_max_total_concurrent_connections << LL_ENDL; return true; } @@ -2706,7 +2706,7 @@ bool handleCurlConcurrentConnectionsPerService(LLSD const& newvalue) int increment = new_concurrent_connections - CurlConcurrentConnectionsPerService; CurlConcurrentConnectionsPerService = new_concurrent_connections; AIPerService::adjust_concurrent_connections(increment); - llinfos << "CurlConcurrentConnectionsPerService set to " << CurlConcurrentConnectionsPerService << llendl; + LL_INFOS() << "CurlConcurrentConnectionsPerService set to " << CurlConcurrentConnectionsPerService << LL_ENDL; } return true; } diff --git a/indra/llmessage/aihttptimeout.cpp b/indra/llmessage/aihttptimeout.cpp index c41dc6575..bcc36df23 100644 --- a/indra/llmessage/aihttptimeout.cpp +++ b/indra/llmessage/aihttptimeout.cpp @@ -309,13 +309,13 @@ bool HTTPTimeout::lowspeed(size_t bytes, bool finished) { if (finished) { - llwarns << + LL_WARNS() << #ifdef CWDEBUG (void*)get_lockobj() << ": " #endif "Transfer rate timeout (average transfer rate below " << low_speed_limit << " bytes/s for more than " << low_speed_time << " second" << ((low_speed_time == 1) ? "" : "s") << - ") but we just sent the LAST bytes! Waiting an additional 4 seconds." << llendl; + ") but we just sent the LAST bytes! Waiting an additional 4 seconds." << LL_ENDL; // Lets hope these last bytes will make it and do not time out on transfer speed anymore. // Just give these bytes 4 more seconds to be written to the socket (after which we'll // assume that the 'upload finished' detection failed and we'll wait another ReplyDelay @@ -325,12 +325,12 @@ bool HTTPTimeout::lowspeed(size_t bytes, bool finished) return false; } // The average transfer rate over the passed low_speed_time seconds is too low. Abort the transfer. - llwarns << + LL_WARNS() << #ifdef CWDEBUG (void*)get_lockobj() << ": " #endif "aborting slow connection (average transfer rate below " << low_speed_limit << - " bytes/s for more than " << low_speed_time << " second" << ((low_speed_time == 1) ? "" : "s") << ")." << llendl; + " bytes/s for more than " << low_speed_time << " second" << ((low_speed_time == 1) ? "" : "s") << ")." << LL_ENDL; // This causes curl to exit with CURLE_WRITE_ERROR. return true; } @@ -393,7 +393,7 @@ void HTTPTimeout::done(AICurlEasyRequest_wat const& curlEasyRequest_w, CURLcode if (code == CURLE_COULDNT_RESOLVE_HOST) { // Note that CURLINFO_OS_ERRNO returns 0; we don't know any more than this. - llwarns << "Failed to resolve hostname " << curlEasyRequest_w->getLowercaseHostname() << llendl; + LL_WARNS() << "Failed to resolve hostname " << curlEasyRequest_w->getLowercaseHostname() << LL_ENDL; dns_problem = true; } else if (mNothingReceivedYet) @@ -440,8 +440,8 @@ bool HTTPTimeout::maybe_upload_finished(void) void HTTPTimeout::print_diagnostics(CurlEasyRequest const* curl_easy_request, char const* eff_url) { #ifndef HTTPTIMEOUT_TESTSUITE - llwarns << "Request to \"" << curl_easy_request->getLowercaseServicename() << "\" timed out for " << curl_easy_request->getTimeoutPolicy()->name() << llendl; - llinfos << "Effective URL: \"" << eff_url << "\"." << llendl; + LL_WARNS() << "Request to \"" << curl_easy_request->getLowercaseServicename() << "\" timed out for " << curl_easy_request->getTimeoutPolicy()->name() << LL_ENDL; + LL_INFOS() << "Effective URL: \"" << eff_url << "\"." << LL_ENDL; double namelookup_time, connect_time, appconnect_time, pretransfer_time, starttransfer_time; curl_easy_request->getinfo(CURLINFO_NAMELOOKUP_TIME, &namelookup_time); curl_easy_request->getinfo(CURLINFO_CONNECT_TIME, &connect_time); @@ -455,9 +455,9 @@ void HTTPTimeout::print_diagnostics(CurlEasyRequest const* curl_easy_request, ch ) { #if LOWRESTIMER - llinfos << "Hostname seems to have been still in the DNS cache." << llendl; + LL_INFOS() << "Hostname seems to have been still in the DNS cache." << LL_ENDL; #else - llwarns << "Curl returned CURLE_OPERATION_TIMEDOUT and DNS lookup did not occur according to timings. Apparently the resolve attempt timed out (bad network?)" << llendl; + LL_WARNS() << "Curl returned CURLE_OPERATION_TIMEDOUT and DNS lookup did not occur according to timings. Apparently the resolve attempt timed out (bad network?)" << LL_ENDL; llassert(connect_time == 0); llassert(appconnect_time == 0); llassert(pretransfer_time == 0); @@ -469,14 +469,14 @@ void HTTPTimeout::print_diagnostics(CurlEasyRequest const* curl_easy_request, ch else if (namelookup_time < 500e-6) { #if LOWRESTIMER - llinfos << "Hostname was most likely still in DNS cache (or lookup occured in under ~10ms)." << llendl; + LL_INFOS() << "Hostname was most likely still in DNS cache (or lookup occured in under ~10ms)." << LL_ENDL; #else - llinfos << "Hostname was still in DNS cache." << llendl; + LL_INFOS() << "Hostname was still in DNS cache." << LL_ENDL; #endif } else { - llinfos << "DNS lookup of " << curl_easy_request->getLowercaseHostname() << " took " << namelookup_time << " seconds." << llendl; + LL_INFOS() << "DNS lookup of " << curl_easy_request->getLowercaseHostname() << " took " << namelookup_time << " seconds." << LL_ENDL; } if (connect_time == 0 #if LOWRESTIMER @@ -484,7 +484,7 @@ void HTTPTimeout::print_diagnostics(CurlEasyRequest const* curl_easy_request, ch #endif ) { - llwarns << "Curl returned CURLE_OPERATION_TIMEDOUT and connection did not occur according to timings: apparently the connect attempt timed out (bad network?)" << llendl; + LL_WARNS() << "Curl returned CURLE_OPERATION_TIMEDOUT and connection did not occur according to timings: apparently the connect attempt timed out (bad network?)" << LL_ENDL; llassert(appconnect_time == 0); llassert(pretransfer_time == 0); llassert(starttransfer_time == 0); @@ -494,68 +494,68 @@ void HTTPTimeout::print_diagnostics(CurlEasyRequest const* curl_easy_request, ch if (connect_time - namelookup_time <= 1e-5) { #if LOWRESTIMER // Assuming 10ms resolution. - llinfos << "The socket was most likely already connected (or you connected to a proxy with a connect time of under ~10 ms)." << llendl; + LL_INFOS() << "The socket was most likely already connected (or you connected to a proxy with a connect time of under ~10 ms)." << LL_ENDL; #else - llinfos << "The socket was already connected (to remote or proxy)." << llendl; + LL_INFOS() << "The socket was already connected (to remote or proxy)." << LL_ENDL; #endif // I'm assuming that the SSL/TLS handshake can be measured with a low res timer. if (appconnect_time == 0) { - llwarns << "The SSL/TLS handshake never occurred according to the timings!" << llendl; + LL_WARNS() << "The SSL/TLS handshake never occurred according to the timings!" << LL_ENDL; return; } // If appconnect_time is almost equal to connect_time, then it was just set because this is a connection re-use. if (appconnect_time - connect_time <= 1e-5) { - llinfos << "Connection with HTTP server was already established; this was a re-used connection." << llendl; + LL_INFOS() << "Connection with HTTP server was already established; this was a re-used connection." << LL_ENDL; } else { - llinfos << "SSL/TLS handshake with HTTP server took " << (appconnect_time - connect_time) << " seconds." << llendl; + LL_INFOS() << "SSL/TLS handshake with HTTP server took " << (appconnect_time - connect_time) << " seconds." << LL_ENDL; } } else { - llinfos << "Socket connected to remote host (or proxy) in " << (connect_time - namelookup_time) << " seconds." << llendl; + LL_INFOS() << "Socket connected to remote host (or proxy) in " << (connect_time - namelookup_time) << " seconds." << LL_ENDL; if (appconnect_time == 0) { - llwarns << "The SSL/TLS handshake never occurred according to the timings!" << llendl; + LL_WARNS() << "The SSL/TLS handshake never occurred according to the timings!" << LL_ENDL; return; } - llinfos << "SSL/TLS handshake with HTTP server took " << (appconnect_time - connect_time) << " seconds." << llendl; + LL_INFOS() << "SSL/TLS handshake with HTTP server took " << (appconnect_time - connect_time) << " seconds." << LL_ENDL; } if (pretransfer_time == 0) { - llwarns << "The transfer never happened because there was too much in the pipeline (apparently)." << llendl; + LL_WARNS() << "The transfer never happened because there was too much in the pipeline (apparently)." << LL_ENDL; return; } else if (pretransfer_time - appconnect_time >= 1e-5) { - llinfos << "Apparently there was a delay, due to waits in line for the pipeline, of " << (pretransfer_time - appconnect_time) << " seconds before the transfer began." << llendl; + LL_INFOS() << "Apparently there was a delay, due to waits in line for the pipeline, of " << (pretransfer_time - appconnect_time) << " seconds before the transfer began." << LL_ENDL; } if (starttransfer_time == 0) { - llwarns << "No data was ever received from the server according to the timings." << llendl; + LL_WARNS() << "No data was ever received from the server according to the timings." << LL_ENDL; } else { - llinfos << "The time it took to send the request to the server plus the time it took before the server started to reply was " << (starttransfer_time - pretransfer_time) << " seconds." << llendl; + LL_INFOS() << "The time it took to send the request to the server plus the time it took before the server started to reply was " << (starttransfer_time - pretransfer_time) << " seconds." << LL_ENDL; } if (mNothingReceivedYet) { - llinfos << "No data at all was actually received from the server." << llendl; + LL_INFOS() << "No data at all was actually received from the server." << LL_ENDL; } if (mUploadFinished) { - llinfos << "The request upload finished successfully." << llendl; + LL_INFOS() << "The request upload finished successfully." << LL_ENDL; } else if (mLastBytesSent) { - llinfos << "All bytes where sent to libcurl for upload." << llendl; + LL_INFOS() << "All bytes where sent to libcurl for upload." << LL_ENDL; } if (mLastSecond > 0 && mLowSpeedOn) { - llinfos << "The " << (mNothingReceivedYet ? "upload" : "download") << " did last " << mLastSecond << " second" << ((mLastSecond == 1) ? "" : "s") << ", before it timed out." << llendl; + LL_INFOS() << "The " << (mNothingReceivedYet ? "upload" : "download") << " did last " << mLastSecond << " second" << ((mLastSecond == 1) ? "" : "s") << ", before it timed out." << LL_ENDL; } #endif // HTTPTIMEOUT_TESTSUITE } diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index 4c71111f5..72678dec0 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -239,41 +239,41 @@ void AIHTTPTimeoutPolicy::base_changed(void) void AIHTTPTimeoutPolicy::setDefaultCurlTimeout(AIHTTPTimeoutPolicy const& timeout) { sDebugSettingsCurlTimeout = timeout; - llinfos << "CurlTimeout Debug Settings now" + LL_INFOS() << "CurlTimeout Debug Settings now" ": DNSLookup: " << sDebugSettingsCurlTimeout.mDNSLookupGrace << "; Connect: " << sDebugSettingsCurlTimeout.mMaximumConnectTime << "; ReplyDelay: " << sDebugSettingsCurlTimeout.mMaximumReplyDelay << "; LowSpeedTime: " << sDebugSettingsCurlTimeout.mLowSpeedTime << "; LowSpeedLimit: " << sDebugSettingsCurlTimeout.mLowSpeedLimit << "; MaxTransaction: " << sDebugSettingsCurlTimeout.mMaximumCurlTransaction << - "; MaxTotalDelay: " << sDebugSettingsCurlTimeout.mMaximumTotalDelay << llendl; + "; MaxTotalDelay: " << sDebugSettingsCurlTimeout.mMaximumTotalDelay << LL_ENDL; if (sDebugSettingsCurlTimeout.mDNSLookupGrace < AITP_default_DNS_lookup_grace) { - llwarns << "CurlTimeoutDNSLookup (" << sDebugSettingsCurlTimeout.mDNSLookupGrace << ") is lower than the built-in default value (" << AITP_default_DNS_lookup_grace << ")." << llendl; + LL_WARNS() << "CurlTimeoutDNSLookup (" << sDebugSettingsCurlTimeout.mDNSLookupGrace << ") is lower than the built-in default value (" << AITP_default_DNS_lookup_grace << ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mMaximumConnectTime < AITP_default_maximum_connect_time) { - llwarns << "CurlTimeoutConnect (" << sDebugSettingsCurlTimeout.mMaximumConnectTime << ") is lower than the built-in default value (" << AITP_default_maximum_connect_time << ")." << llendl; + LL_WARNS() << "CurlTimeoutConnect (" << sDebugSettingsCurlTimeout.mMaximumConnectTime << ") is lower than the built-in default value (" << AITP_default_maximum_connect_time << ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mMaximumReplyDelay < AITP_default_maximum_reply_delay) { - llwarns << "CurlTimeoutReplyDelay (" << sDebugSettingsCurlTimeout.mMaximumReplyDelay << ") is lower than the built-in default value (" << AITP_default_maximum_reply_delay << ")." << llendl; + LL_WARNS() << "CurlTimeoutReplyDelay (" << sDebugSettingsCurlTimeout.mMaximumReplyDelay << ") is lower than the built-in default value (" << AITP_default_maximum_reply_delay << ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mLowSpeedTime < AITP_default_low_speed_time) { - llwarns << "CurlTimeoutLowSpeedTime (" << sDebugSettingsCurlTimeout.mLowSpeedTime << ") is lower than the built-in default value (" << AITP_default_low_speed_time << ")." << llendl; + LL_WARNS() << "CurlTimeoutLowSpeedTime (" << sDebugSettingsCurlTimeout.mLowSpeedTime << ") is lower than the built-in default value (" << AITP_default_low_speed_time << ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mLowSpeedLimit > AITP_default_low_speed_limit) { - llwarns << "CurlTimeoutLowSpeedLimit (" << sDebugSettingsCurlTimeout.mLowSpeedLimit << ") is higher than the built-in default value (" << AITP_default_low_speed_limit << ")." << llendl; + LL_WARNS() << "CurlTimeoutLowSpeedLimit (" << sDebugSettingsCurlTimeout.mLowSpeedLimit << ") is higher than the built-in default value (" << AITP_default_low_speed_limit << ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mMaximumCurlTransaction < AITP_default_maximum_curl_transaction) { - llwarns << "CurlTimeoutMaxTransaction (" << sDebugSettingsCurlTimeout.mMaximumCurlTransaction << ") is lower than the built-in default value (" << AITP_default_maximum_curl_transaction<< ")." << llendl; + LL_WARNS() << "CurlTimeoutMaxTransaction (" << sDebugSettingsCurlTimeout.mMaximumCurlTransaction << ") is lower than the built-in default value (" << AITP_default_maximum_curl_transaction<< ")." << LL_ENDL; } if (sDebugSettingsCurlTimeout.mMaximumTotalDelay < AITP_default_maximum_total_delay) { - llwarns << "CurlTimeoutMaxTotalDelay (" << sDebugSettingsCurlTimeout.mMaximumTotalDelay << ") is lower than the built-in default value (" << AITP_default_maximum_total_delay << ")." << llendl; + LL_WARNS() << "CurlTimeoutMaxTotalDelay (" << sDebugSettingsCurlTimeout.mMaximumTotalDelay << ") is lower than the built-in default value (" << AITP_default_maximum_total_delay << ")." << LL_ENDL; } } @@ -887,7 +887,7 @@ AIHTTPTimeoutPolicy const* AIHTTPTimeoutPolicy::getTimeoutPolicyByName(std::stri { if (!name.empty()) { - llwarns << "Cannot find AIHTTPTimeoutPolicy with name \"" << name << "\"." << llendl; + LL_WARNS() << "Cannot find AIHTTPTimeoutPolicy with name \"" << name << "\"." << LL_ENDL; } return &sDebugSettingsCurlTimeout; } diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp index 91d13dac3..029bcc124 100644 --- a/indra/llmessage/llares.cpp +++ b/indra/llmessage/llares.cpp @@ -56,13 +56,13 @@ LLAres::HostResponder::~HostResponder() void LLAres::HostResponder::hostResult(const hostent *ent) { - llinfos << "LLAres::HostResponder::hostResult not implemented" << llendl; + LL_INFOS() << "LLAres::HostResponder::hostResult not implemented" << LL_ENDL; } void LLAres::HostResponder::hostError(int code) { - llinfos << "LLAres::HostResponder::hostError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::HostResponder::hostError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::NameInfoResponder::~NameInfoResponder() @@ -72,14 +72,14 @@ LLAres::NameInfoResponder::~NameInfoResponder() void LLAres::NameInfoResponder::nameInfoResult(const char *node, const char *service) { - llinfos << "LLAres::NameInfoResponder::nameInfoResult not implemented" - << llendl; + LL_INFOS() << "LLAres::NameInfoResponder::nameInfoResult not implemented" + << LL_ENDL; } void LLAres::NameInfoResponder::nameInfoError(int code) { - llinfos << "LLAres::NameInfoResponder::nameInfoError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::NameInfoResponder::nameInfoError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::QueryResponder::~QueryResponder() @@ -88,14 +88,14 @@ LLAres::QueryResponder::~QueryResponder() void LLAres::QueryResponder::queryResult(const char *buf, size_t len) { - llinfos << "LLAres::QueryResponder::queryResult not implemented" - << llendl; + LL_INFOS() << "LLAres::QueryResponder::queryResult not implemented" + << LL_ENDL; } void LLAres::QueryResponder::queryError(int code) { - llinfos << "LLAres::QueryResponder::queryError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::QueryResponder::queryError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::LLAres() : @@ -106,7 +106,7 @@ LLAres::LLAres() : if (ares_library_init( ARES_LIB_INIT_ALL ) != ARES_SUCCESS || ares_init(&chan_) != ARES_SUCCESS) { - llwarns << "Could not succesfully initialize ares!" << llendl; + LL_WARNS() << "Could not succesfully initialize ares!" << LL_ENDL; return; } @@ -163,7 +163,7 @@ void LLAres::getSrvRecords(const std::string &name, SrvResponder *resp) void LLAres::rewriteURI(const std::string &uri, UriRewriteResponder *resp) { - llinfos << "Rewriting " << uri << llendl; + LL_INFOS() << "Rewriting " << uri << LL_ENDL; resp->mUri = LLURI(uri); search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), @@ -237,8 +237,8 @@ int LLQueryResponder::parseRR(const char *buf, size_t len, const char *&pos, r = new LLSrvRecord(rrname, rrttl); break; default: - llinfos << "LLQueryResponder::parseRR got unknown RR type " << rrtype - << llendl; + LL_INFOS() << "LLQueryResponder::parseRR got unknown RR type " << rrtype + << LL_ENDL; return ARES_EBADRESP; } @@ -319,7 +319,7 @@ void LLQueryResponder::queryResult(const char *buf, size_t len) mType = (LLResType) t; break; default: - llinfos << "Cannot grok query type " << t << llendl; + LL_INFOS() << "Cannot grok query type " << t << LL_ENDL; ret = ARES_EBADQUERY; goto bail; } @@ -359,7 +359,7 @@ bail: void LLQueryResponder::querySuccess() { - llinfos << "LLQueryResponder::queryResult not implemented" << llendl; + LL_INFOS() << "LLQueryResponder::queryResult not implemented" << LL_ENDL; } void LLAres::SrvResponder::querySuccess() @@ -379,23 +379,23 @@ void LLAres::SrvResponder::queryError(int code) void LLAres::SrvResponder::srvResult(const dns_rrs_t &ents) { - llinfos << "LLAres::SrvResponder::srvResult not implemented" << llendl; + LL_INFOS() << "LLAres::SrvResponder::srvResult not implemented" << LL_ENDL; for (size_t i = 0; i < ents.size(); i++) { const LLSrvRecord *s = (const LLSrvRecord *) ents[i].get(); - llinfos << "[" << i << "] " << s->host() << ":" << s->port() + LL_INFOS() << "[" << i << "] " << s->host() << ":" << s->port() << " priority " << s->priority() << " weight " << s->weight() - << llendl; + << LL_ENDL; } } void LLAres::SrvResponder::srvError(int code) { - llinfos << "LLAres::SrvResponder::srvError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::SrvResponder::srvError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } static void nameinfo_callback_1_5(void *arg, int status, int timeouts, @@ -797,11 +797,11 @@ done: void LLAres::UriRewriteResponder::rewriteResult( const std::vector &uris) { - llinfos << "LLAres::UriRewriteResponder::rewriteResult not implemented" - << llendl; + LL_INFOS() << "LLAres::UriRewriteResponder::rewriteResult not implemented" + << LL_ENDL; for (size_t i = 0; i < uris.size(); i++) { - llinfos << "[" << i << "] " << uris[i] << llendl; + LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL; } } diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index fd30f9249..09216e5ad 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -149,8 +149,8 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv ) setName( buf ); buf.assign( str, pos2, std::string::npos ); setDescription( buf ); - LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << llendl; - LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << llendl; + LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << LL_ENDL; + LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << LL_ENDL; } ///---------------------------------------------------------------------------- @@ -356,10 +356,10 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) || ((RT_DOWNLOAD == rt) && LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime))) { - llwarns << "Asset " << getRequestName((ERequestType)rt) << " request " + LL_WARNS() << "Asset " << getRequestName((ERequestType)rt) << " request " << (all ? "aborted" : "timed out") << " for " << tmp->getUUID() << "." - << LLAssetType::lookup(tmp->getType()) << llendl; + << LLAssetType::lookup(tmp->getType()) << LL_ENDL; timed_out.push_front(tmp); iter = requests->erase(curiter); @@ -420,8 +420,8 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse } else { - llwarns << "Asset vfile " << uuid << ":" << type - << " found in static cache with bad size " << file.getSize() << ", ignoring" << llendl; + LL_WARNS() << "Asset vfile " << uuid << ":" << type + << " found in static cache with bad size " << file.getSize() << ", ignoring" << LL_ENDL; } } return false; @@ -434,9 +434,9 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse // IW - uuid is passed by value to avoid side effects, please don't re-add & void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl; + LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << LL_ENDL; - LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << LL_ENDL; if (user_data) { @@ -446,7 +446,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL if (mShutDown) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << LL_ENDL; if (callback) { @@ -468,7 +468,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL /* */ if(std::find(mBlackListedAsset.begin(),mBlackListedAsset.end(),uuid) != mBlackListedAsset.end()) { - llinfos << "Blacklisted asset " << uuid.asString() << " was trying to be accessed!!!!!!" << llendl; + LL_INFOS() << "Blacklisted asset " << uuid.asString() << " was trying to be accessed!!!!!!" << LL_ENDL; if (callback) { callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID); @@ -480,7 +480,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL // Try static VFS first. if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data)) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << LL_ENDL; return; } @@ -498,13 +498,13 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED); } - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << LL_ENDL; } else { if (exists) { - llwarns << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -520,8 +520,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL if (callback == tmp->mDownCallback && user_data == tmp->mUserData) { // this is a duplicate from the same subsystem - throw it away - llwarns << "Discarding duplicate request for asset " << uuid - << "." << LLAssetType::lookup(type) << llendl; + LL_WARNS() << "Discarding duplicate request for asset " << uuid + << "." << LLAssetType::lookup(type) << LL_ENDL; return; } @@ -533,7 +533,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL if (duplicate) { LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid - << "." << LLAssetType::lookup(type) << llendl; + << "." << LLAssetType::lookup(type) << LL_ENDL; } // This can be overridden by subclasses @@ -573,7 +573,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at tpvf.setAsset(uuid, atype); tpvf.setCallback(downloadCompleteCallback, req); - //llinfos << "Starting transfer for " << uuid << llendl; + //LL_INFOS() << "Starting transfer for " << uuid << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } @@ -581,7 +581,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); @@ -596,20 +596,20 @@ void LLAssetStorage::downloadCompleteCallback( LLAssetType::EType file_type, void* user_data, LLExtStat ext_status) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << LL_ENDL; LL_DEBUGS("AssetStorage") << "LLAssetStorage::downloadCompleteCallback() for " << file_id - << "," << LLAssetType::lookup(file_type) << llendl; + << "," << LLAssetType::lookup(file_type) << LL_ENDL; LLAssetRequest* req = (LLAssetRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without" - "a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without" + "a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL; return; } @@ -632,7 +632,7 @@ void LLAssetStorage::downloadCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); @@ -671,7 +671,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen const LLUUID &asset_id, LLAssetType::EType atype, EstateAssetType etype, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - lldebugs << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << llendl; + LL_DEBUGS() << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << LL_ENDL; // // Probably will get rid of this early out? @@ -710,7 +710,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen { if (exists) { - llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -743,14 +743,14 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen tpvf.setAsset(asset_id, atype); tpvf.setCallback(downloadEstateAssetCompleteCallback, req); - LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << llendl; + LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET); ttcp->requestTransfer(spe, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); @@ -769,14 +769,14 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without any asset system, aborting!" << LL_ENDL; return; } @@ -788,7 +788,7 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getAType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); @@ -803,7 +803,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age const LLUUID &asset_id, LLAssetType::EType atype, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - lldebugs << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << llendl; + LL_DEBUGS() << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << LL_ENDL; // // Probably will get rid of this early out? @@ -834,7 +834,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age size = exists ? file.getSize() : 0; if(exists && size < 1) { - llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -885,14 +885,14 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age LL_DEBUGS("AssetStorage") << "Starting transfer for inventory asset " << item_id << " owned by " << owner_id << "," << task_id - << llendl; + << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET); ttcp->requestTransfer(spi, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); @@ -912,13 +912,13 @@ void LLAssetStorage::downloadInvItemCompleteCallback( LLInvItemRequest *req = (LLInvItemRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL; return; } @@ -930,7 +930,7 @@ void LLAssetStorage::downloadInvItemCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); @@ -949,7 +949,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, { if (!gAssetStorage) { - llwarns << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << llendl; + LL_WARNS() << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << LL_ENDL; return; } LLAssetRequest *req = (LLAssetRequest *)user_data; @@ -957,7 +957,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, if (result) { - llwarns << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << llendl; + LL_WARNS() << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << LL_ENDL; success = FALSE; } @@ -1039,7 +1039,7 @@ LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::E case RT_LOCALUPLOAD: return &mPendingLocalUploads; default: - llwarns << "Unable to find request list for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; return NULL; } } @@ -1055,7 +1055,7 @@ const LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStor case RT_LOCALUPLOAD: return &mPendingLocalUploads; default: - llwarns << "Unable to find request list for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; return NULL; } } @@ -1072,7 +1072,7 @@ std::string LLAssetStorage::getRequestName(LLAssetStorage::ERequestType rt) case RT_LOCALUPLOAD: return "localupload"; default: - llwarns << "Unable to find request name for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request name for request type '" << rt << "'" << LL_ENDL; return ""; } } @@ -1225,7 +1225,7 @@ bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, { LL_DEBUGS("AssetStorage") << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) - << " removed from pending queue." << llendl; + << " removed from pending queue." << LL_ENDL; return true; } return false; @@ -1319,7 +1319,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo user_data == ((LLLegacyAssetRequest *)tmp->mUserData)->mUserData) { // this is a duplicate from the same subsystem - throw it away - LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << llendl; + LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << LL_ENDL; return; } } @@ -1392,7 +1392,7 @@ void LLAssetStorage::storeAssetData( bool user_waiting, F64 timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 1" ); } @@ -1411,7 +1411,7 @@ void LLAssetStorage::storeAssetData( bool user_waiting, F64 timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( asset_id, asset_type, LLStringUtil::null, requesting_agent_id, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 2" ); } @@ -1429,7 +1429,7 @@ void LLAssetStorage::storeAssetData( bool user_waiting, F64 timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 3" ); } @@ -1447,7 +1447,7 @@ void LLAssetStorage::storeAssetData( bool user_waiting, F64 timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 4" ); } @@ -1502,7 +1502,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET { if( !metric_recipient ) { - LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl; + LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << LL_ENDL; return; } diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 7129e2f03..755d0a207 100644 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -51,6 +51,14 @@ class LLSD; // HTTP Uploads also timeout if they take longer than this. const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f; +// Specific error codes +const int LL_ERR_ASSET_REQUEST_FAILED = -1; +//const int LL_ERR_ASSET_REQUEST_INVALID = -2; +const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3; +const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4; +const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5; +const int LL_ERR_PRICE_MISMATCH = -23018; + class LLAssetInfo { protected: diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp index 88aaf7c52..0b5025a42 100644 --- a/indra/llmessage/llblowfishcipher.cpp +++ b/indra/llmessage/llblowfishcipher.cpp @@ -70,10 +70,10 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) int blocksize = EVP_CIPHER_CTX_block_size(&context); int keylen = EVP_CIPHER_CTX_key_length(&context); int iv_length = EVP_CIPHER_CTX_iv_length(&context); - lldebugs << "LLBlowfishCipher blocksize " << blocksize + LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize << " keylen " << keylen << " iv_len " << iv_length - << llendl; + << LL_ENDL; int output_len = 0; int temp_len = 0; @@ -83,7 +83,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) src, src_len)) { - llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl; + LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL; goto ERROR; } @@ -91,7 +91,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) // not an exact multiple of the block size. if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len)) { - llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl; + LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL; goto ERROR; } output_len += temp_len; @@ -107,7 +107,7 @@ ERROR: // virtual U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) { - llerrs << "LLBlowfishCipher decrypt unsupported" << llendl; + LL_ERRS() << "LLBlowfishCipher decrypt unsupported" << LL_ENDL; return 0; } diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp index 41db8be23..7d9903152 100644 --- a/indra/llmessage/llbuffer.cpp +++ b/indra/llmessage/llbuffer.cpp @@ -180,8 +180,8 @@ bool LLHeapBuffer::reclaimSegment(const LLSegment& segment) } else if(mReclaimedBytes > mSize) { - llwarns << "LLHeapBuffer reclaimed more memory than allocated." - << " This is probably programmer error." << llendl; + LL_WARNS() << "LLHeapBuffer reclaimed more memory than allocated." + << " This is probably programmer error." << LL_ENDL; } return true; } diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index a51a48edc..ff1c9993c 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -53,7 +53,7 @@ LLBufferStreamBuf::~LLBufferStreamBuf() // virtual int LLBufferStreamBuf::underflow() { - //lldebugs << "LLBufferStreamBuf::underflow()" << llendl; + //LL_DEBUGS() << "LLBufferStreamBuf::underflow()" << LL_ENDL; if(!mBuffer) { return EOF; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 180db3a4b..eafb0ea97 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -344,7 +344,7 @@ bool LLCacheName::importFile(std::istream& istr) ++count; } - llinfos << "LLCacheName loaded " << count << " agent names" << llendl; + LL_INFOS() << "LLCacheName loaded " << count << " agent names" << LL_ENDL; count = 0; LLSD groups = data[GROUPS]; @@ -365,7 +365,7 @@ bool LLCacheName::importFile(std::istream& istr) impl.mReverseCache[entry->mGroupName] = id; ++count; } - llinfos << "LLCacheName loaded " << count << " group names" << llendl; + LL_INFOS() << "LLCacheName loaded " << count << " group names" << LL_ENDL; return true; } @@ -441,7 +441,7 @@ void LLCacheName::localizeCacheName(std::string key, std::string value) if (key!="" && value!= "" ) sCacheName[key]=value; else - llwarns<< " Error localizing cache key " << key << " To "<< value< we must ask for it - lldebugs << "LLCacheName queuing HACK group request: " << id << llendl; + LL_DEBUGS() << "LLCacheName queuing HACK group request: " << id << LL_ENDL; entry = NULL; } @@ -696,7 +696,7 @@ void LLCacheName::processPending() if(!impl.mUpstreamHost.isOk()) { - lldebugs << "LLCacheName::processPending() - bad upstream host." + LL_DEBUGS() << "LLCacheName::processPending() - bad upstream host." << LL_ENDL; return; } @@ -744,7 +744,7 @@ void LLCacheName::dump() LLCacheNameEntry* entry = iter->second; if (entry->mIsGroup) { - llinfos + LL_INFOS() << iter->first << " = (group) " << entry->mGroupName << " @ " << entry->mCreateTime @@ -752,7 +752,7 @@ void LLCacheName::dump() } else { - llinfos + LL_INFOS() << iter->first << " = " << buildFullName(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime @@ -763,7 +763,7 @@ void LLCacheName::dump() void LLCacheName::dumpStats() { - llinfos << "Queue sizes: " + LL_INFOS() << "Queue sizes: " << " Cache=" << impl.mCache.size() << " AskName=" << impl.mAskNameQueue.size() << " AskGroup=" << impl.mAskGroupQueue.size() @@ -906,7 +906,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) // level, hence having an upstream provider. if (!mUpstreamHost.isOk()) { - llwarns << "LLCacheName - got UUID name/group request, but no upstream provider!" << llendl; + LL_WARNS() << "LLCacheName - got UUID name/group request, but no upstream provider!" << LL_ENDL; return; } @@ -923,7 +923,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) { if (isGroup != entry->mIsGroup) { - llwarns << "LLCacheName - Asked for " + LL_WARNS() << "LLCacheName - Asked for " << (isGroup ? "group" : "user") << " name, " << "but found " << (entry->mIsGroup ? "group" : "user") diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 6bb435f53..ada598a16 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -184,7 +184,7 @@ LLCircuitData::~LLCircuitData() std::ostream_iterator append(str, " "); str << "MSG: -> " << mHost << "\tABORTING RELIABLE:\t"; std::copy(doomed.begin(), doomed.end(), append); - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } } @@ -204,7 +204,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) std::ostringstream str; str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) { @@ -232,13 +232,13 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) if (iter != mFinalRetryPackets.end()) { packetp = iter->second; - // llinfos << "Packet " << packet_num << " removed from the pending list" << llendl; + // LL_INFOS() << "Packet " << packet_num << " removed from the pending list" << LL_ENDL; if(gMessageSystem->mVerboseLog) { std::ostringstream str; str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) { @@ -321,8 +321,8 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) if (mUnackedPacketBytes > 256000 && !(getPacketsOut() % 1024)) { // Warn if we've got a lot of resends waiting. - llwarns << mHost << " has " << mUnackedPacketBytes - << " bytes of reliable messages waiting" << llendl; + LL_WARNS() << mHost << " has " << mUnackedPacketBytes + << " bytes of reliable messages waiting" << LL_ENDL; } // Stop resending. There are less than 512000 unacked packets. break; @@ -342,7 +342,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) std::ostringstream str; str << "MSG: -> " << packetp->mHost << "\tRESENDING RELIABLE:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } packetp->mBuffer[0] |= LL_RESENT_FLAG; // tag packet id as being a resend @@ -391,10 +391,10 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) if (now > packetp->mExpirationTime) { // fail (too many retries) - //llinfos << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << llendl; + //LL_INFOS() << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << LL_ENDL; //if (packetp->mMessageName) //{ - // llinfos << "Packet name " << packetp->mMessageName << llendl; + // LL_INFOS() << "Packet name " << packetp->mMessageName << LL_ENDL; //} gMessageSystem->mFailedResendPackets++; @@ -403,7 +403,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) std::ostringstream str; str << "MSG: -> " << packetp->mHost << "\tABORTING RELIABLE:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) @@ -446,7 +446,7 @@ LLCircuit::~LLCircuit() LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id) { // This should really validate if one already exists - llinfos << "LLCircuit::addCircuitData for " << host << llendl; + LL_INFOS() << "LLCircuit::addCircuitData for " << host << LL_ENDL; LLCircuitData *tempp = new LLCircuitData(host, in_id, mHeartbeatInterval, mHeartbeatTimeout); mCircuitData.insert(circuit_data_map::value_type(host, tempp)); mPingSet.insert(tempp); @@ -457,7 +457,7 @@ LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id) void LLCircuit::removeCircuitData(const LLHost &host) { - llinfos << "LLCircuit::removeCircuitData for " << host << llendl; + LL_INFOS() << "LLCircuit::removeCircuitData for " << host << LL_ENDL; mLastCircuit = NULL; circuit_data_map::iterator it = mCircuitData.find(host); if(it != mCircuitData.end()) @@ -472,7 +472,7 @@ void LLCircuit::removeCircuitData(const LLHost &host) } else { - llwarns << "Couldn't find entry for next ping in ping set!" << llendl; + LL_WARNS() << "Couldn't find entry for next ping in ping set!" << LL_ENDL; } // Clean up from optimization maps @@ -720,9 +720,9 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) { std::ostringstream str; str << "MSG: <- " << mHost << "\tRECOVERING LOST:\t" << id; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } - // llinfos << "removing potential lost: " << id << llendl; + // LL_INFOS() << "removing potential lost: " << id << LL_ENDL; mPotentialLostPackets.erase(id); } else if (!receive_resent) // don't freak out over out-of-order reliable resends @@ -739,10 +739,10 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) std::ostringstream str; str << "MSG: <- " << mHost << "\tPACKET GAP:\t" << index; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } -// llinfos << "adding potential lost: " << index << llendl; +// LL_INFOS() << "adding potential lost: " << index << LL_ENDL; mPotentialLostPackets[index] = time; index++; index = index % LL_MAX_OUT_PACKET_ID; @@ -751,13 +751,13 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) } else { - llinfos << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << llendl; + LL_INFOS() << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << LL_ENDL; if(gMessageSystem->mVerboseLog) { std::ostringstream str; str << "MSG: <- " << mHost << "\tPACKET GAP:\t" << id << " expected " << index; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } } @@ -766,11 +766,11 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) if (gap_count > 128) { - llwarns << "Packet loss gap filler running amok!" << llendl; + LL_WARNS() << "Packet loss gap filler running amok!" << LL_ENDL; } else if (gap_count > 16) { - llwarns << "Sustaining large amounts of packet loss!" << llendl; + LL_WARNS() << "Sustaining large amounts of packet loss!" << LL_ENDL; } } @@ -890,8 +890,8 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) wrapped_final = TRUE; } - //llinfos << mHost << " - unacked count " << mUnackedPackets.size() << llendl; - //llinfos << mHost << " - final count " << mFinalRetryPackets.size() << llendl; + //LL_INFOS() << mHost << " - unacked count " << mUnackedPackets.size() << LL_ENDL; + //LL_INFOS() << mHost << " - final count " << mFinalRetryPackets.size() << LL_ENDL; if (wrapped != wrapped_final) { // One of the "unacked" or "final" lists hasn't wrapped. Whichever one @@ -901,12 +901,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Hasn't wrapped, so the one on the // unacked packet list is older packet_id = iter->first; - //llinfos << mHost << ": nowrapped unacked" << llendl; + //LL_INFOS() << mHost << ": nowrapped unacked" << LL_ENDL; } else { packet_id = iter_final->first; - //llinfos << mHost << ": nowrapped final" << llendl; + //LL_INFOS() << mHost << ": nowrapped final" << LL_ENDL; } } else @@ -918,7 +918,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Send the ID of the last packet we sent out. // This will flush all of the destination's // unacked packets, theoretically. - //llinfos << mHost << ": No unacked!" << llendl; + //LL_INFOS() << mHost << ": No unacked!" << LL_ENDL; packet_id = getPacketOutID(); } else @@ -929,7 +929,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Unacked list has the lowest so far packet_id = iter->first; had_unacked = TRUE; - //llinfos << mHost << ": Unacked" << llendl; + //LL_INFOS() << mHost << ": Unacked" << LL_ENDL; } if (iter_final != mFinalRetryPackets.end()) @@ -939,13 +939,13 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) { // Both had a packet, use the lowest. packet_id = llmin(packet_id, iter_final->first); - //llinfos << mHost << ": Min of unacked/final" << llendl; + //LL_INFOS() << mHost << ": Min of unacked/final" << LL_ENDL; } else { // Only the final had a packet, use it. packet_id = iter_final->first; - //llinfos << mHost << ": Final!" << llendl; + //LL_INFOS() << mHost << ": Final!" << LL_ENDL; } } } @@ -980,7 +980,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) std::ostringstream str; str << "MSG: <- " << mHost << "\tLOST PACKET:\t" << (*it).first; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } mPotentialLostPackets.erase(it++); } @@ -1000,8 +1000,8 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) // we want to KEEP all x where oldest_id <= x <= last incoming packet, and delete everything else. - //llinfos << mHost << ": clearing before oldest " << oldest_id << llendl; - //llinfos << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << llendl; + //LL_INFOS() << mHost << ": clearing before oldest " << oldest_id << LL_ENDL; + //LL_INFOS() << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL; if (oldest_id < mHighestPacketID) { // Clean up everything with a packet ID less than oldest_id. @@ -1024,14 +1024,14 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) // Validate that the packet ID seems far enough away if ((pit->first - mHighestPacketID) < 100) { - llwarns << "Probably incorrectly timing out non-wrapped packets!" << llendl; + LL_WARNS() << "Probably incorrectly timing out non-wrapped packets!" << LL_ENDL; } U64 delta_t_usec = mt_usec - (*pit).second; F64 delta_t_sec = delta_t_usec * SEC_PER_USEC; if (delta_t_sec > LL_DUPLICATE_SUPPRESSION_TIMEOUT) { // enough time has elapsed we're not likely to get a duplicate on this one - llinfos << "Clearing " << pit->first << " from recent list" << llendl; + LL_INFOS() << "Clearing " << pit->first << " from recent list" << LL_ENDL; mRecentlyReceivedReliablePackets.erase(pit++); } else @@ -1039,7 +1039,7 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) ++pit; } } - //llinfos << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << llendl; + //LL_INFOS() << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL; } BOOL LLCircuitData::checkCircuitTimeout() @@ -1049,17 +1049,17 @@ BOOL LLCircuitData::checkCircuitTimeout() // Nota Bene: This needs to be turned off if you are debugging multiple simulators if (time_since_last_ping > mHeartbeatTimeout) { - llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." < " << cd->mHost << "\tPACKET ACKS:\t"; std::ostream_iterator append(str, " "); std::copy(cd->mAcks.begin(), cd->mAcks.end(), append); - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } // empty out the acks list @@ -1189,7 +1189,7 @@ void LLCircuitData::dumpResendCountAndReset() { if (mCurrentResendCount) { - llinfos << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << llendl; + LL_INFOS() << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << LL_ENDL; mCurrentResendCount = 0; } } diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h index 13b0e9e49..ab9ebc2d8 100644 --- a/indra/llmessage/llcircuit.h +++ b/indra/llmessage/llcircuit.h @@ -51,6 +51,8 @@ const F32 LL_AVERAGED_PING_MIN = 100; // msec // IW: increased to avoid ret const U32 INITIAL_PING_VALUE_MSEC = 1000; // initial value for the ping delay, or for ping delay for an unknown circuit const TPACKETID LL_MAX_OUT_PACKET_ID = 0x01000000; +const int LL_ERR_CIRCUIT_GONE = -23017; +const int LL_ERR_TCP_TIMEOUT = -23016; // 0 - flags // [1,4] - packetid diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 3385d7c2e..3510f9380 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -52,13 +52,13 @@ LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE) //virtual void LLDataPacker::reset() { - llerrs << "Using unimplemented datapacker reset!" << llendl; + LL_ERRS() << "Using unimplemented datapacker reset!" << LL_ENDL; } //virtual void LLDataPacker::dumpBufferToLog() { - llerrs << "dumpBufferToLog not implemented for this type!" << llendl; + LL_ERRS() << "dumpBufferToLog not implemented for this type!" << LL_ENDL; } BOOL LLDataPacker::packFixed(const F32 value, const char *name, @@ -108,7 +108,7 @@ BOOL LLDataPacker::packFixed(const F32 value, const char *name, } else { - llerrs << "Using fixed-point packing of " << total_bits << " bits, why?!" << llendl; + LL_ERRS() << "Using fixed-point packing of " << total_bits << " bits, why?!" << LL_ENDL; } return success; } @@ -117,7 +117,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, const BOOL is_signed, const U32 int_bits, const U32 frac_bits) { //BOOL success = TRUE; - //llinfos << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << llendl; + //LL_INFOS() << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << LL_ENDL; BOOL ok = FALSE; S32 unsigned_bits = int_bits + frac_bits; S32 total_bits = unsigned_bits; @@ -158,10 +158,10 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, else { fixed_val = 0; - llerrs << "Bad bit count: " << total_bits << llendl; + LL_ERRS() << "Bad bit count: " << total_bits << LL_ENDL; } - //llinfos << "Fixed_val:" << fixed_val << llendl; + //LL_INFOS() << "Fixed_val:" << fixed_val << LL_ENDL; fixed_val /= (F32)(1 << frac_bits); if (is_signed) @@ -169,7 +169,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, fixed_val -= max_val; } value = fixed_val; - //llinfos << "Value: " << value << llendl; + //LL_INFOS() << "Value: " << value << LL_ENDL; return ok; } @@ -239,7 +239,7 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char } else { - llwarns << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << llendl; + LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL; success = FALSE; } return success; @@ -550,7 +550,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData if (a.getBufferSize() > getBufferSize()) { // We've got problems, ack! - llerrs << "Trying to do an assignment with not enough room in the target." << llendl; + LL_ERRS() << "Trying to do an assignment with not enough room in the target." << LL_ENDL; } memcpy(mBufferp, a.mBufferp, a.getBufferSize()); /*Flawfinder: ignore*/ return *this; @@ -558,7 +558,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData void LLDataPackerBinaryBuffer::dumpBufferToLog() { - llwarns << "Binary Buffer Dump, size: " << mBufferSize << llendl; + LL_WARNS() << "Binary Buffer Dump, size: " << mBufferSize << LL_ENDL; char line_buffer[256]; /*Flawfinder: ignore*/ S32 i; S32 cur_line_pos = 0; @@ -571,13 +571,13 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog() if (cur_line_pos >= 16) { cur_line_pos = 0; - llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl; + LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL; cur_line++; } } if (cur_line_pos) { - llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl; + LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL; } } @@ -608,7 +608,7 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n { // *NOTE: I believe we need to mark a failure bit at this point. numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << LL_ENDL; } mCurBufferp += numCopied; return success; @@ -647,7 +647,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << LL_ENDL; } mCurBufferp += numCopied; @@ -660,7 +660,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << LL_ENDL; bBufferFull = TRUE; } mCurBufferp += numCopied; @@ -672,7 +672,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << LL_ENDL; } mCurBufferp += numCopied; } @@ -734,7 +734,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << LL_ENDL; bBufferFull = TRUE; } mCurBufferp += numCopied; @@ -746,7 +746,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -813,7 +813,7 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU8: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU8: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -860,7 +860,7 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU16: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU16: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -907,7 +907,7 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -951,7 +951,7 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packS32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packS32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -995,7 +995,7 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packF32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packF32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1039,7 +1039,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packColor4: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1082,7 +1082,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1132,7 +1132,7 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector2: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector2: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1176,7 +1176,7 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector3: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector3: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1219,7 +1219,7 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector4: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector4: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1266,7 +1266,7 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packUUID: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packUUID: truncated: " << LL_ENDL; success = FALSE; } mCurBufferp += numCopied; @@ -1292,7 +1292,7 @@ BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name) void LLDataPackerAsciiBuffer::dump() { - llinfos << "Buffer: " << mBufferp << llendl; + LL_INFOS() << "Buffer: " << mBufferp << LL_ENDL; } void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) @@ -1318,7 +1318,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1347,7 +1347,7 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; return FALSE; } } @@ -1904,7 +1904,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v fpos_t last_pos; if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos { - llwarns << "Data packer failed to fgetpos" << llendl; + LL_WARNS() << "Data packer failed to fgetpos" << LL_ENDL; return FALSE; } @@ -1917,13 +1917,13 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v if (!keyword[0]) { - llwarns << "Data packer could not get the keyword!" << llendl; + LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; fsetpos(mFP, &last_pos); return FALSE; } if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; fsetpos(mFP, &last_pos); return FALSE; } @@ -1941,12 +1941,12 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */ if (!keyword[0]) { - llwarns << "Data packer could not get the keyword!" << llendl; + LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; return FALSE; } if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index 2b6e57484..0237e7833 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -170,6 +170,7 @@ public: S32 getBufferSize() const { return mBufferSize; } const U8* getBuffer() const { return mBufferp; } void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } + void shift(S32 offset) { reset(); mCurBufferp += offset;} void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } void assignBuffer(U8 *bufferp, S32 size) { @@ -201,8 +202,8 @@ inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const ch { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - llwarns << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << llendl; - llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; + LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL; + LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; return FALSE; } @@ -322,8 +323,8 @@ inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const cha { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - llwarns << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << llendl; - llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; + LL_WARNS() << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << LL_ENDL; + LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp index b2dc414a6..6f740346e 100644 --- a/indra/llmessage/lldispatcher.cpp +++ b/indra/llmessage/lldispatcher.cpp @@ -75,7 +75,7 @@ bool LLDispatcher::dispatch( LLDispatchHandler* func = (*it).second; return (*func)(this, name, invoice, strings); } - llwarns << "Unable to find handler for Generic message: " << name << llendl; + LL_WARNS() << "Unable to find handler for Generic message: " << name << LL_ENDL; return false; } diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp index 9828a3e30..f8ef744ca 100644 --- a/indra/llmessage/llfiltersd2xmlrpc.cpp +++ b/indra/llmessage/llfiltersd2xmlrpc.cpp @@ -163,12 +163,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeMap: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(map) BEGIN" << llendl; + LL_INFOS() << "streamOut(map) BEGIN" << LL_ENDL; #endif ostr << ""; if(ostr.fail()) { - llinfos << "STREAM FAILURE writing struct" << llendl; + LL_INFOS() << "STREAM FAILURE writing struct" << LL_ENDL; } LLSD::map_const_iterator it = sd.beginMap(); LLSD::map_const_iterator end = sd.endMap(); @@ -179,21 +179,21 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) streamOut(ostr, (*it).second); if(ostr.fail()) { - llinfos << "STREAM FAILURE writing '" << (*it).first - << "' with sd type " << (*it).second.type() << llendl; + LL_INFOS() << "STREAM FAILURE writing '" << (*it).first + << "' with sd type " << (*it).second.type() << LL_ENDL; } ostr << ""; } ostr << ""; #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(map) END" << llendl; + LL_INFOS() << "streamOut(map) END" << LL_ENDL; #endif break; } case LLSD::TypeArray: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(array) BEGIN" << llendl; + LL_INFOS() << "streamOut(array) BEGIN" << LL_ENDL; #endif ostr << ""; LLSD::array_const_iterator it = sd.beginArray(); @@ -203,12 +203,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) streamOut(ostr, *it); if(ostr.fail()) { - llinfos << "STREAM FAILURE writing array element sd type " - << (*it).type() << llendl; + LL_INFOS() << "STREAM FAILURE writing array element sd type " + << (*it).type() << LL_ENDL; } } #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(array) END" << llendl; + LL_INFOS() << "streamOut(array) END" << LL_ENDL; #endif ostr << ""; break; @@ -217,31 +217,31 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) // treat undefined as a bool with a false value. case LLSD::TypeBoolean: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(bool)" << llendl; + LL_INFOS() << "streamOut(bool)" << LL_ENDL; #endif ostr << "" << (sd.asBoolean() ? "1" : "0") << ""; break; case LLSD::TypeInteger: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(int)" << llendl; + LL_INFOS() << "streamOut(int)" << LL_ENDL; #endif ostr << "" << sd.asInteger() << ""; break; case LLSD::TypeReal: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(real)" << llendl; + LL_INFOS() << "streamOut(real)" << LL_ENDL; #endif ostr << "" << sd.asReal() << ""; break; case LLSD::TypeString: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(string)" << llendl; + LL_INFOS() << "streamOut(string)" << LL_ENDL; #endif ostr << "" << xml_escape_string(sd.asString()) << ""; break; case LLSD::TypeUUID: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(uuid)" << llendl; + LL_INFOS() << "streamOut(uuid)" << LL_ENDL; #endif // serialize it as a string ostr << "" << sd.asString() << ""; @@ -249,7 +249,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeURI: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(uri)" << llendl; + LL_INFOS() << "streamOut(uri)" << LL_ENDL; #endif // serialize it as a string ostr << "" << xml_escape_string(sd.asString()) << ""; @@ -258,7 +258,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeBinary: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(binary)" << llendl; + LL_INFOS() << "streamOut(binary)" << LL_ENDL; #endif // this is pretty inefficient, but we'll deal with that // problem when it becomes one. @@ -281,15 +281,15 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) } case LLSD::TypeDate: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(date)" << llendl; + LL_INFOS() << "streamOut(date)" << LL_ENDL; #endif // no need to escape this since it will be alpha-numeric. ostr << "" << sd.asString() << ""; break; default: // unhandled type - llwarns << "Unhandled structured data type: " << sd.type() - << llendl; + LL_WARNS() << "Unhandled structured data type: " << sd.type() + << LL_ENDL; break; } ostr << ""; @@ -360,7 +360,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( } else { - llwarns << "Unable to determine the type of LLSD response." << llendl; + LL_WARNS() << "Unable to determine the type of LLSD response." << LL_ENDL; } PUMP_DEBUG; return rv; @@ -402,7 +402,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( PUMP_DEBUG; if(!eos) { - llinfos << "!eos" << llendl; + LL_INFOS() << "!eos" << LL_ENDL; return STATUS_BREAK; } @@ -412,7 +412,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( LLSDSerialize::fromNotation(sd, stream, buffer->count(channels.in())); if(stream.fail()) { - llinfos << "STREAM FAILURE reading structure data." << llendl; + LL_INFOS() << "STREAM FAILURE reading structure data." << LL_ENDL; } PUMP_DEBUG; @@ -434,7 +434,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( } if(method.empty()) { - llwarns << "SD -> XML Request no method found." << llendl; + LL_WARNS() << "SD -> XML Request no method found." << LL_ENDL; return STATUS_ERROR; } @@ -445,13 +445,13 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( ostream.precision(DEFAULT_PRECISION); if(ostream.fail()) { - llinfos << "STREAM FAILURE setting precision" << llendl; + LL_INFOS() << "STREAM FAILURE setting precision" << LL_ENDL; } ostream << XML_HEADER << XMLRPC_REQUEST_HEADER_1 << xml_escape_string(method) << XMLRPC_REQUEST_HEADER_2; if(ostream.fail()) { - llinfos << "STREAM FAILURE writing method headers" << llendl; + LL_INFOS() << "STREAM FAILURE writing method headers" << LL_ENDL; } switch(param_sd.type()) { @@ -518,7 +518,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) break; } case xmlrpc_type_boolean: - //lldebugs << "stream_out() bool" << llendl; + //LL_DEBUGS() << "stream_out() bool" << LL_ENDL; ostr << " " << (XMLRPC_GetValueBoolean(value) ? "true" : "false"); break; case xmlrpc_type_datetime: @@ -526,23 +526,23 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) break; case xmlrpc_type_double: ostr << " r" << XMLRPC_GetValueDouble(value); - //lldebugs << "stream_out() double" << XMLRPC_GetValueDouble(value) - // << llendl; + //LL_DEBUGS() << "stream_out() double" << XMLRPC_GetValueDouble(value) + // << LL_ENDL; break; case xmlrpc_type_int: ostr << " i" << XMLRPC_GetValueInt(value); - //lldebugs << "stream_out() integer:" << XMLRPC_GetValueInt(value) - // << llendl; + //LL_DEBUGS() << "stream_out() integer:" << XMLRPC_GetValueInt(value) + // << LL_ENDL; break; case xmlrpc_type_string: - //lldebugs << "stream_out() string: " << str << llendl; + //LL_DEBUGS() << "stream_out() string: " << str << LL_ENDL; ostr << " s(" << XMLRPC_GetValueStringLen(value) << ")'" << XMLRPC_GetValueString(value) << "'"; break; case xmlrpc_type_array: // vector case xmlrpc_type_mixed: // vector { - //lldebugs << "stream_out() array" << llendl; + //LL_DEBUGS() << "stream_out() array" << LL_ENDL; ostr << " ["; U32 needs_comma = 0; XMLRPC_VALUE current = XMLRPC_VectorRewind(value); @@ -557,7 +557,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) } case xmlrpc_type_struct: // still vector { - //lldebugs << "stream_out() struct" << llendl; + //LL_DEBUGS() << "stream_out() struct" << LL_ENDL; ostr << " {"; std::string name; U32 needs_comma = 0; @@ -577,7 +577,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) case xmlrpc_type_none: default: status = LLIOPipe::STATUS_ERROR; - llwarns << "Found an empty xmlrpc type.." << llendl; + LL_WARNS() << "Found an empty xmlrpc type.." << LL_ENDL; // not much we can do here... break; }; @@ -617,7 +617,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( buf[bytes] = '\0'; buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); - //lldebugs << "xmlrpc response: " << buf << llendl; + //LL_DEBUGS() << "xmlrpc response: " << buf << LL_ENDL; PUMP_DEBUG; XMLRPC_REQUEST response = XMLRPC_REQUEST_FromXML( @@ -626,7 +626,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( NULL); if(!response) { - llwarns << "XML -> SD Response unable to parse xml." << llendl; + LL_WARNS() << "XML -> SD Response unable to parse xml." << LL_ENDL; delete[] buf; return STATUS_ERROR; } @@ -701,7 +701,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( buf[bytes] = '\0'; buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); - //lldebugs << "xmlrpc request: " << buf << llendl; + //LL_DEBUGS() << "xmlrpc request: " << buf << LL_ENDL; // Check the value in the buffer. XMLRPC_REQUEST_FromXML will report a error code 4 if // values that are less than 0x20 are passed to it, except @@ -728,7 +728,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( NULL); if(!request) { - llwarns << "XML -> SD Request process parse error." << llendl; + LL_WARNS() << "XML -> SD Request process parse error." << LL_ENDL; delete[] buf; return STATUS_ERROR; } diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index 9bf94ef3f..3ded1a56d 100644 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -85,13 +85,13 @@ std::string LLHost::getHostName() const hostent* he; if (INVALID_HOST_IP_ADDRESS == mIP) { - llwarns << "LLHost::getHostName() : Invalid IP address" << llendl; + LL_WARNS() << "LLHost::getHostName() : Invalid IP address" << LL_ENDL; return std::string(); } if (mHostNotFound) { // We already checked this... avoid freezing the viewer 5 seconds again and again. - llwarns << "LLHost::getHostName() : Returning cached HOST_NOT_FOUND." << llendl; + LL_WARNS() << "LLHost::getHostName() : Returning cached HOST_NOT_FOUND." << LL_ENDL; return std::string(); } he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET); @@ -104,7 +104,7 @@ std::string LLHost::getHostName() const int err = h_errno; int err_host_not_found = HOST_NOT_FOUND; #endif - llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " << err << llendl; + LL_WARNS() << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " << err << LL_ENDL; if (err == err_host_not_found) { mHostNotFound = 1; @@ -149,17 +149,17 @@ BOOL LLHost::setHostByName(const std::string& hostname) switch(error_number) { case TRY_AGAIN: // XXX how to handle this case? - llwarns << "LLHost::setAddress(): try again" << llendl; + LL_WARNS() << "LLHost::setAddress(): try again" << LL_ENDL; break; case HOST_NOT_FOUND: case NO_ADDRESS: // NO_DATA - llwarns << "LLHost::setAddress(): host not found" << llendl; + LL_WARNS() << "LLHost::setAddress(): host not found" << LL_ENDL; break; case NO_RECOVERY: - llwarns << "LLHost::setAddress(): unrecoverable error" << llendl; + LL_WARNS() << "LLHost::setAddress(): unrecoverable error" << LL_ENDL; break; default: - llwarns << "LLHost::setAddress(): unknown error - " << error_number << llendl; + LL_WARNS() << "LLHost::setAddress(): unknown error - " << error_number << LL_ENDL; break; } return FALSE; diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 6db165125..2878ca456 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -229,7 +229,7 @@ void LLHTTPClient::request( } catch(AICurlNoEasyHandle& error) { - llwarns << "Failed to create LLURLRequest: " << error.what() << llendl; + LL_WARNS() << "Failed to create LLURLRequest: " << error.what() << LL_ENDL; // This is what the old LL code did: no recovery whatsoever (but also no leaks or crash). return ; } @@ -332,7 +332,7 @@ void LLHTTPClient::ResponderBase::decode_llsd_body(LLChannelDescriptors const& c // Unfortunately we can't show the body of the message... I think this is a pretty serious error // though, so if this ever happens it has to be investigated by making a copy of the buffer // before serializing it, as is done below. - llwarns << "Failed to deserialize LLSD. " << mURL << " [" << mStatus << "]: " << mReason << llendl; + LL_WARNS() << "Failed to deserialize LLSD. " << mURL << " [" << mStatus << "]: " << mReason << LL_ENDL; AICurlInterface::Stats::llsd_body_parse_error++; } // LLSDSerialize::fromXML destructed buffer, we can't initialize mContent now. @@ -357,7 +357,7 @@ void LLHTTPClient::ResponderBase::decode_llsd_body(LLChannelDescriptors const& c LLSDSerialize::fromXML(dummy, ss) > 0; if (server_sent_llsd_with_http_error) { - llwarns << "The server sent us a response with http status " << mStatus << " and LLSD(!) body: \"" << ss.str() << "\"!" << llendl; + LL_WARNS() << "The server sent us a response with http status " << mStatus << " and LLSD(!) body: \"" << ss.str() << "\"!" << LL_ENDL; } // This is not really an error, and it has been known to happen before. It just normally never happens (at the moment) // and therefore warrants an investigation. Linden Lab (or other grids) might start to send error messages @@ -479,7 +479,7 @@ void LLHTTPClient::ResponderWithResult::finished(CURLcode code, U32 http_status, // virtual void LLHTTPClient::ResponderWithResult::httpFailure(void) { - llinfos << mURL << " [" << mStatus << "]: " << mReason << llendl; + LL_INFOS() << mURL << " [" << mStatus << "]: " << mReason << LL_ENDL; } // Friend functions. @@ -622,7 +622,7 @@ static LLSD blocking_request( LLSD const& body/*,*/ // Only used for HTTP_LLSD_POST DEBUG_CURLIO_PARAM(EDebugCurl debug)) { - lldebugs << "blockingRequest of " << url << llendl; + LL_DEBUGS() << "blockingRequest of " << url << LL_ENDL; AIHTTPHeaders headers; boost::intrusive_ptr responder; @@ -665,21 +665,21 @@ static LLSD blocking_request( // We expect 404s, don't spam for them. if (http_status != 404) { - llwarns << "CURL REQ URL: " << url << llendl; - llwarns << "CURL REQ METHOD TYPE: " << method << llendl; - llwarns << "CURL REQ HEADERS: " << headers << llendl; + LL_WARNS() << "CURL REQ URL: " << url << LL_ENDL; + LL_WARNS() << "CURL REQ METHOD TYPE: " << method << LL_ENDL; + LL_WARNS() << "CURL REQ HEADERS: " << headers << LL_ENDL; if (method == HTTP_LLSD_POST) { - llwarns << "CURL REQ BODY: " << body.asString() << llendl; + LL_WARNS() << "CURL REQ BODY: " << body.asString() << LL_ENDL; } - llwarns << "CURL HTTP_STATUS: " << http_status << llendl; + LL_WARNS() << "CURL HTTP_STATUS: " << http_status << LL_ENDL; if (method == HTTP_RAW_GET) { - llwarns << "CURL ERROR BODY: " << responder->getRaw() << llendl; + LL_WARNS() << "CURL ERROR BODY: " << responder->getRaw() << LL_ENDL; } else { - llwarns << "CURL ERROR BODY: " << responder->getContent().asString() << llendl; + LL_WARNS() << "CURL ERROR BODY: " << responder->getContent().asString() << LL_ENDL; } } if (method == HTTP_RAW_GET) diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index 5c2f73ecc..dfff84a56 100644 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -172,7 +172,7 @@ LLSD LLHTTPNode::simpleDel(const LLSD&) const // virtual void LLHTTPNode::options(ResponsePtr response, const LLSD& context) const { - //llinfos << "options context: " << context << llendl; + //LL_INFOS() << "options context: " << context << LL_ENDL; // default implementation constructs an url to the documentation. std::string host( @@ -238,10 +238,10 @@ const LLHTTPNode* LLHTTPNode::traverse( LLHTTPNode* child = node->getChild(*iter, context); if(!child) { - lldebugs << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << llendl; + LL_DEBUGS() << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << LL_ENDL; break; } - lldebugs << "LLHTTPNode::traverse: Found '" << *iter << "'" << llendl; + LL_DEBUGS() << "LLHTTPNode::traverse: Found '" << *iter << "'" << LL_ENDL; node = child; } @@ -275,8 +275,8 @@ void LLHTTPNode::addNode(const std::string& path, LLHTTPNode* nodeToAdd) if (iter == end) { - llwarns << "LLHTTPNode::addNode: already a node that handles " - << path << llendl; + LL_WARNS() << "LLHTTPNode::addNode: already a node that handles " + << path << LL_ENDL; return; } diff --git a/indra/llmessage/llhttpsender.cpp b/indra/llmessage/llhttpsender.cpp index c48cbc42a..643735fc1 100644 --- a/indra/llmessage/llhttpsender.cpp +++ b/indra/llmessage/llhttpsender.cpp @@ -54,14 +54,14 @@ void LLHTTPSender::send(const LLHost& host, const std::string& name, // Default implementation inserts sender, message and sends HTTP POST std::ostringstream stream; stream << "http://" << host << "/trusted-message/" << name; - llinfos << "LLHTTPSender::send: POST to " << stream.str() << llendl; + LL_INFOS() << "LLHTTPSender::send: POST to " << stream.str() << LL_ENDL; LLHTTPClient::post(stream.str(), body, response); } //static void LLHTTPSender::setSender(const LLHost& host, LLHTTPSender* sender) { - llinfos << "LLHTTPSender::setSender " << host << llendl; + LL_INFOS() << "LLHTTPSender::setSender " << host << LL_ENDL; senderMap[host] = sender; } diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index d68e0c423..6036c6ccc 100644 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -123,7 +123,7 @@ LLIMInfo::~LLIMInfo() void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const { - lldebugs << "LLIMInfo::packInstantMessage()" << llendl; + LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); packMessageBlock(msg); } @@ -173,7 +173,7 @@ void pack_instant_message( const U8* binary_bucket, S32 binary_bucket_size) { - lldebugs << "pack_instant_message()" << llendl; + LL_DEBUGS() << "pack_instant_message()" << LL_ENDL; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); pack_instant_message_block( msg, @@ -240,7 +240,7 @@ void pack_instant_message_block( if (num_written < 0 || num_written >= MTUBYTES) { num_written = MTUBYTES - 1; - llwarns << "pack_instant_message_block: message truncated: " << message << llendl; + LL_WARNS() << "pack_instant_message_block: message truncated: " << message << LL_ENDL; } bytes_left -= num_written; diff --git a/indra/llmessage/lliobuffer.cpp b/indra/llmessage/lliobuffer.cpp index ed00e230a..bbd7b8777 100644 --- a/indra/llmessage/lliobuffer.cpp +++ b/indra/llmessage/lliobuffer.cpp @@ -109,6 +109,6 @@ LLIOPipe::EStatus LLIOBuffer::process_impl( LLPumpIO* pump) { // no-op (I think) - llwarns << "You are using an LLIOBuffer which is deprecated." << llendl; + LL_WARNS() << "You are using an LLIOBuffer which is deprecated." << LL_ENDL; return STATUS_OK; } diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index 8037b005d..dc0f6e928 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -154,7 +154,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( { LLFastTimer t(FTM_PROCESS_HTTP_PIPE); PUMP_DEBUG; - lldebugs << "LLSDHTTPServer::process_impl" << llendl; + LL_DEBUGS() << "LLSDHTTPServer::process_impl" << LL_ENDL; // Once we have all the data, We need to read the sd on // the the in channel, and respond on the out channel @@ -245,15 +245,15 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( // Log all HTTP transactions. // TODO: Add a way to log these to their own file instead of indra.log // It is just too spammy to be in indra.log. - lldebugs << verb << " " << context[CONTEXT_REQUEST]["path"].asString() + LL_DEBUGS() << verb << " " << context[CONTEXT_REQUEST]["path"].asString() << " " << mStatusCode << " " << mStatusMessage << " " << delta - << "s" << llendl; + << "s" << LL_ENDL; // Log Internal Server Errors //if(mStatusCode == 500) //{ - // llwarns << "LLHTTPPipe::process_impl:500:Internal Server Error" - // << llendl; + // LL_WARNS() << "LLHTTPPipe::process_impl:500:Internal Server Error" + // << LL_ENDL; //} } @@ -303,8 +303,8 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( return STATUS_DONE; } default: - llwarns << "LLHTTPPipe::process_impl: unexpected state " - << mState << llendl; + LL_WARNS() << "LLHTTPPipe::process_impl: unexpected state " + << mState << LL_ENDL; return STATUS_BREAK; } @@ -333,7 +333,7 @@ void LLHTTPPipe::Response::result(const LLSD& r) { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::result: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::result: NULL pipe" << LL_ENDL; return; } @@ -349,7 +349,7 @@ void LLHTTPPipe::Response::extendedResult(S32 code, const std::string& body, con { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL; return; } @@ -365,7 +365,7 @@ void LLHTTPPipe::Response::status(S32 code, const std::string& message) { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL; return; } @@ -596,7 +596,7 @@ LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx) : // virtual LLHTTPResponder::~LLHTTPResponder() { - //lldebugs << "destroying LLHTTPResponder" << llendl; + //LL_DEBUGS() << "destroying LLHTTPResponder" << LL_ENDL; } bool LLHTTPResponder::readHeaderLine( @@ -613,7 +613,7 @@ bool LLHTTPResponder::readHeaderLine( { if(len) { - lldebugs << "readLine failed - too long maybe?" << llendl; + LL_DEBUGS() << "readLine failed - too long maybe?" << LL_ENDL; markBad(channels, buffer); } return false; @@ -669,8 +669,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/ buf[(*seg_iter).size()] = '\0'; - llinfos << (*seg_iter).getChannel() << ": " << buf - << llendl; + LL_INFOS() << (*seg_iter).getChannel() << ": " << buf + << LL_ENDL; ++seg_iter; } } @@ -696,10 +696,10 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( header >> mAbsPathAndQuery; header >> mVersion; - lldebugs << "http request: " + LL_DEBUGS() << "http request: " << mVerb << " " << mAbsPathAndQuery - << " " << mVersion << llendl; + << " " << mVersion << LL_ENDL; std::string::size_type delimiter = mAbsPathAndQuery.find('?'); @@ -729,7 +729,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { read_next_line = false; parse_all = false; - lldebugs << "unknown http verb: " << mVerb << llendl; + LL_DEBUGS() << "unknown http verb: " << mVerb << LL_ENDL; markBad(channels, buffer); } } @@ -764,7 +764,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( if(NULL == pos_colon) { keep_parsing = false; - lldebugs << "bad header: " << buf << llendl; + LL_DEBUGS() << "bad header: " << buf << LL_ENDL; markBad(channels, buffer); break; } @@ -775,7 +775,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( LLStringUtil::toLower(name); if("content-length" == name) { - lldebugs << "Content-Length: " << value << llendl; + LL_DEBUGS() << "Content-Length: " << value << LL_ENDL; mContentLength = atoi(value.c_str()); } else @@ -812,8 +812,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( const LLHTTPNode* node = mRootNode.traverse(mPath, context); if(node) { - //llinfos << "LLHTTPResponder::process_impl found node for " - // << mAbsPathAndQuery << llendl; + //LL_INFOS() << "LLHTTPResponder::process_impl found node for " + // << mAbsPathAndQuery << LL_ENDL; // Copy everything after mLast read to the out. LLBufferArray::segment_iterator_t seg_iter; @@ -833,8 +833,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/ buf[(*seg_iter).size()] = '\0'; - llinfos << (*seg_iter).getChannel() << ": " << buf - << llendl; + LL_INFOS() << (*seg_iter).getChannel() << ": " << buf + << LL_ENDL; ++seg_iter; } #endif @@ -860,7 +860,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( = node->getProtocolHandler(); if (protocolHandler) { - lldebugs << "HTTP context: " << context << llendl; + LL_DEBUGS() << "HTTP context: " << context << LL_ENDL; protocolHandler->build(chain, context); } else @@ -919,8 +919,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( } else { - llwarns << "LLHTTPResponder::process_impl didn't find a node for " - << mAbsPathAndQuery << llendl; + LL_WARNS() << "LLHTTPResponder::process_impl didn't find a node for " + << mAbsPathAndQuery << LL_ENDL; LLBufferStream str(channels, buffer.get()); mState = STATE_SHORT_CIRCUIT; str << HTTP_VERSION_STR << " 404 Not Found\r\n\r\n\n" @@ -969,7 +969,7 @@ LLHTTPNode& LLIOHTTPServer::create(LLPumpIO& pump, U16 port) LLSocket::ptr_t socket = LLSocket::create(LLSocket::STREAM_TCP, port); if(!socket) { - llerrs << "Unable to initialize socket" << llendl; + LL_ERRS() << "Unable to initialize socket" << LL_ENDL; } LLHTTPResponseFactory* factory = new LLHTTPResponseFactory; diff --git a/indra/llmessage/lliopipe.cpp b/indra/llmessage/lliopipe.cpp index c8bef05c6..281da066d 100644 --- a/indra/llmessage/lliopipe.cpp +++ b/indra/llmessage/lliopipe.cpp @@ -72,7 +72,7 @@ LLIOPipe::LLIOPipe() : LLIOPipe::~LLIOPipe() { - //lldebugs << "destroying LLIOPipe" << llendl; + //LL_DEBUGS() << "destroying LLIOPipe" << LL_ENDL; } //virtual diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 065f457ee..6b17130c8 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -74,7 +74,7 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) #if LL_DEBUG_SOCKET_FILE_DESCRIPTORS if(!apr_sock) { - lldebugs << "Socket -- " << (msg?msg:"") << ": no socket." << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << ": no socket." << LL_ENDL; return; } // *TODO: Why doesn't this work? @@ -82,13 +82,13 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) int os_sock; if(APR_SUCCESS == apr_os_sock_get(&os_sock, apr_sock)) { - lldebugs << "Socket -- " << (msg?msg:"") << " on fd " << os_sock - << " at " << apr_sock << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " on fd " << os_sock + << " at " << apr_sock << LL_ENDL; } else { - lldebugs << "Socket -- " << (msg?msg:"") << " no fd " - << " at " << apr_sock << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " no fd " + << " at " << apr_sock << LL_ENDL; } #endif } @@ -146,13 +146,13 @@ LLSocket::ptr_t LLSocket::create(EType type, U16 port) rv.reset(); return rv; } - lldebugs << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp") - << " socket to port: " << sa->port << llendl; + LL_DEBUGS() << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp") + << " socket to port: " << sa->port << LL_ENDL; if(STREAM_TCP == type) { // If it's a stream based socket, we need to tell the OS // to keep a queue of incoming connections for ACCEPT. - lldebugs << "Setting listen state for socket." << llendl; + LL_DEBUGS() << "Setting listen state for socket." << LL_ENDL; status = apr_socket_listen( rv->mSocket, LL_DEFAULT_LISTEN_BACKLOG); @@ -183,7 +183,7 @@ LLSocket::ptr_t LLSocket::create(apr_status_t& status, LLSocket::ptr_t& listen_s return LLSocket::ptr_t(); } LLSocket::ptr_t rv(new LLSocket); - lldebugs << "accepting socket" << llendl; + LL_DEBUGS() << "accepting socket" << LL_ENDL; status = apr_socket_accept(&rv->mSocket, listen_socket->getSocket(), rv->mPool()); if (status != APR_SUCCESS) { @@ -274,7 +274,7 @@ LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) : LLIOSocketReader::~LLIOSocketReader() { - //lldebugs << "Destroying LLIOSocketReader" << llendl; + //LL_DEBUGS() << "Destroying LLIOSocketReader" << LL_ENDL; } static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_READER("Socket Reader"); @@ -299,8 +299,8 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( if(pump) { PUMP_DEBUG; - lldebugs << "Initializing poll descriptor for LLIOSocketReader." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketReader." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -327,7 +327,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( status = apr_socket_recv(mSource->getSocket(), read_buf, &len); buffer->append(channels.out(), (U8*)read_buf, len); } while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len)); - lldebugs << "socket read status: " << status << llendl; + LL_DEBUGS() << "socket read status: " << status << LL_ENDL; LLIOPipe::EStatus rv = STATUS_OK; PUMP_DEBUG; @@ -374,7 +374,7 @@ LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) : LLIOSocketWriter::~LLIOSocketWriter() { - //lldebugs << "Destroying LLIOSocketWriter" << llendl; + //LL_DEBUGS() << "Destroying LLIOSocketWriter" << LL_ENDL; } static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_WRITER("Socket Writer"); @@ -398,8 +398,8 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( if(pump) { PUMP_DEBUG; - lldebugs << "Initializing poll descriptor for LLIOSocketWriter." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketWriter." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -523,7 +523,7 @@ LLIOServerSocket::LLIOServerSocket( LLIOServerSocket::~LLIOServerSocket() { - //lldebugs << "Destroying LLIOServerSocket" << llendl; + //LL_DEBUGS() << "Destroying LLIOServerSocket" << LL_ENDL; } void LLIOServerSocket::setResponseTimeout(F32 timeout_secs) @@ -544,7 +544,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( PUMP_DEBUG; if(!pump) { - llwarns << "Need a pump for server socket." << llendl; + LL_WARNS() << "Need a pump for server socket." << LL_ENDL; return STATUS_ERROR; } if(!mInitialized) @@ -553,8 +553,8 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( // This segment sets up the pump so that we do not call // process again until we have an incoming read, aka connect() // from a remote host. - lldebugs << "Initializing poll descriptor for LLIOServerSocket." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOServerSocket." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -569,7 +569,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( // we are initialized, and told to process, so we must have a // socket waiting for a connection. - lldebugs << "accepting socket" << llendl; + LL_DEBUGS() << "accepting socket" << LL_ENDL; PUMP_DEBUG; apr_status_t status; @@ -598,13 +598,13 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( } else { - llwarns << "Unable to build reactor to socket." << llendl; + LL_WARNS() << "Unable to build reactor to socket." << LL_ENDL; } } else { char buf[256]; - llwarns << "Unable to accept linden socket: " << apr_strerror(status, buf, sizeof(buf)) << llendl; + LL_WARNS() << "Unable to accept linden socket: " << apr_strerror(status, buf, sizeof(buf)) << LL_ENDL; } PUMP_DEBUG; @@ -643,7 +643,7 @@ LLIODataSocket::LLIODataSocket( if(ll_apr_warn_status(status)) return; if(sa->port) { - lldebugs << "Bound datagram socket to port: " << sa->port << llendl; + LL_DEBUGS() << "Bound datagram socket to port: " << sa->port << LL_ENDL; mPort = sa->port; } else diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp index a06261bc8..5543d961b 100644 --- a/indra/llmessage/llmail.cpp +++ b/indra/llmessage/llmail.cpp @@ -199,13 +199,13 @@ std::string LLMail::buildSMTPTransaction( { if(!from_address || !to_address) { - llinfos << "send_mail build_smtp_transaction reject: missing to and/or" + LL_INFOS() << "send_mail build_smtp_transaction reject: missing to and/or" << " from address." << LL_ENDL; return std::string(); } if(!valid_subject_chars(subject)) { - llinfos << "send_mail build_smtp_transaction reject: bad subject header: " + LL_INFOS() << "send_mail build_smtp_transaction reject: bad subject header: " << "to=<" << to_address << ">, from=<" << from_address << ">" << LL_ENDL; @@ -265,7 +265,7 @@ bool LLMail::send( { if(!from_address || !to_address) { - llinfos << "send_mail reject: missing to and/or from address." + LL_INFOS() << "send_mail reject: missing to and/or from address." << LL_ENDL; return false; } @@ -303,7 +303,7 @@ bool LLMail::send( if(!gMailEnabled) { - llinfos << "send_mail reject: mail system is disabled: to=<" + LL_INFOS() << "send_mail reject: mail system is disabled: to=<" << to_address << ">, from=<" << from_address << ">" << LL_ENDL; // Any future interface to SMTP should return this as an @@ -312,7 +312,7 @@ bool LLMail::send( } if(!gSockAddr) { - llwarns << "send_mail reject: mail system not initialized: to=<" + LL_WARNS() << "send_mail reject: mail system not initialized: to=<" << to_address << ">, from=<" << from_address << ">" << LL_ENDL; return false; @@ -320,7 +320,7 @@ bool LLMail::send( if(!connect_smtp()) { - llwarns << "send_mail reject: SMTP connect failure: to=<" + LL_WARNS() << "send_mail reject: SMTP connect failure: to=<" << to_address << ">, from=<" << from_address << ">" << LL_ENDL; return false; @@ -338,7 +338,7 @@ bool LLMail::send( disconnect_smtp(); if(ll_apr_warn_status(status)) { - llwarns << "send_mail socket failure: unable to write " + LL_WARNS() << "send_mail socket failure: unable to write " << "to=<" << to_address << ">, from=<" << from_address << ">" << ", bytes=" << original_size @@ -347,18 +347,18 @@ bool LLMail::send( } if(send_size >= LL_MAX_KNOWN_GOOD_MAIL_SIZE) { - llwarns << "send_mail message has been shown to fail in testing " + LL_WARNS() << "send_mail message has been shown to fail in testing " << "when sending messages larger than " << LL_MAX_KNOWN_GOOD_MAIL_SIZE << " bytes. The next log about success is potentially a lie." << LL_ENDL; } - lldebugs << "send_mail success: " + LL_DEBUGS() << "send_mail success: " << "to=<" << to_address << ">, from=<" << from_address << ">" << ", bytes=" << original_size << ", sent=" << send_size << LL_ENDL; #if LL_LOG_ENTIRE_MAIL_MESSAGE_ON_SEND - llinfos << rfc2822_msg.str() << llendl; + LL_INFOS() << rfc2822_msg.str() << LL_ENDL; #endif return true; } diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp index 539efc65f..f8b2c8f5a 100644 --- a/indra/llmessage/llmessageconfig.cpp +++ b/indra/llmessage/llmessageconfig.cpp @@ -145,9 +145,9 @@ void LLMessageConfigFile::loadMessages(const LLSD& data) std::ostringstream out; LLSDXMLFormatter *formatter = new LLSDXMLFormatter; formatter->format(mMessages, out); - llinfos << "loading ... " << out.str() + LL_INFOS() << "loading ... " << out.str() << " LLMessageConfigFile::loadMessages loaded " - << mMessages.size() << " messages" << llendl; + << mMessages.size() << " messages" << LL_ENDL; #endif } @@ -182,7 +182,7 @@ void LLMessageConfigFile::loadMessageBans(const LLSD& data) bool LLMessageConfigFile::isCapBanned(const std::string& cap_name) const { - lldebugs << "mCapBans is " << LLSDNotationStreamer(mCapBans) << llendl; + LL_DEBUGS() << "mCapBans is " << LLSDNotationStreamer(mCapBans) << LL_ENDL; return mCapBans[cap_name]; } @@ -268,7 +268,7 @@ bool LLMessageConfig::isValidMessage(const std::string& msg_name) { if (sServerName.empty()) { - llerrs << "LLMessageConfig::initClass() not called" << llendl; + LL_ERRS() << "LLMessageConfig::initClass() not called" << LL_ENDL; } LLMessageConfigFile& file = LLMessageConfigFile::instance(); return file.mMessages.has(msg_name); @@ -294,8 +294,8 @@ LLSD LLMessageConfig::getConfigForMessage(const std::string& msg_name) { if (sServerName.empty()) { - llerrs << "LLMessageConfig::isMessageTrusted(name) before" - << " LLMessageConfig::initClass()" << llendl; + LL_ERRS() << "LLMessageConfig::isMessageTrusted(name) before" + << " LLMessageConfig::initClass()" << LL_ENDL; } LLMessageConfigFile& file = LLMessageConfigFile::instance(); // LLSD for the CamelCase message name diff --git a/indra/llmessage/llmessagetemplate.cpp b/indra/llmessage/llmessagetemplate.cpp index d64123ad6..c4c7e6670 100644 --- a/indra/llmessage/llmessagetemplate.cpp +++ b/indra/llmessage/llmessagetemplate.cpp @@ -39,8 +39,8 @@ void LLMsgVarData::addData(const void *data, S32 size, EMsgVariableType type, S3 { if (mType != type) { - llwarns << "Type mismatch in LLMsgVarData::addData for " << mName - << llendl; + LL_WARNS() << "Type mismatch in LLMsgVarData::addData for " << mName + << LL_ENDL; } } if(size) @@ -181,12 +181,12 @@ void LLMessageTemplate::banUdp() }; if (mDeprecation != MD_DEPRECATED) { - llinfos << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << llendl; + LL_INFOS() << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << LL_ENDL; mDeprecation = MD_UDPBLACKLISTED; } else { - llinfos << mName << " is already more deprecated than UDPBlackListed" << llendl; + LL_INFOS() << mName << " is already more deprecated than UDPBlackListed" << LL_ENDL; } } diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index a91a8f775..88ad2667a 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -194,7 +194,7 @@ public: LLMessageVariable** varp = &mMemberVariables[name]; if (*varp != NULL) { - llerrs << name << " has already been used as a variable name!" << llendl; + LL_ERRS() << name << " has already been used as a variable name!" << LL_ENDL; } *varp = new LLMessageVariable(name, type, size); if (((*varp)->getType() != MVT_VARIABLE) @@ -301,8 +301,8 @@ public: LLMessageBlock** member_blockp = &mMemberBlocks[blockp->mName]; if (*member_blockp != NULL) { - llerrs << "Block " << blockp->mName - << "has already been used as a block name!" << llendl; + LL_ERRS() << "Block " << blockp->mName + << "has already been used as a block name!" << LL_ENDL; } *member_blockp = blockp; if ( (mTotalSize != -1) diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp index b0f19df47..1f7c09dbe 100644 --- a/indra/llmessage/llmessagetemplateparser.cpp +++ b/indra/llmessage/llmessagetemplateparser.cpp @@ -165,13 +165,13 @@ BOOL b_check_token(const char *token, const char *regexp) if (current_checker == -1) { - llerrs << "Invalid regular expression value!" << llendl; + LL_ERRS() << "Invalid regular expression value!" << LL_ENDL; return FALSE; } if (current_checker == 9999) { - llerrs << "Regular expression can't start with *!" << llendl; + LL_ERRS() << "Regular expression can't start with *!" << LL_ENDL; return FALSE; } @@ -179,7 +179,7 @@ BOOL b_check_token(const char *token, const char *regexp) { if (current_checker == -1) { - llerrs << "Input exceeds regular expression!\nDid you forget a *?" << llendl; + LL_ERRS() << "Input exceeds regular expression!\nDid you forget a *?" << LL_ENDL; return FALSE; } @@ -204,7 +204,7 @@ BOOL b_variable_ok(const char *token) { if (!b_check_token(token, "fv*")) { - llwarns << "Token '" << token << "' isn't a variable!" << llendl; + LL_WARNS() << "Token '" << token << "' isn't a variable!" << LL_ENDL; return FALSE; } return TRUE; @@ -215,7 +215,7 @@ BOOL b_integer_ok(const char *token) { if (!b_check_token(token, "sd*")) { - llwarns << "Token isn't an integer!" << llendl; + LL_WARNS() << "Token isn't an integer!" << LL_ENDL; return FALSE; } return TRUE; @@ -226,7 +226,7 @@ BOOL b_positive_integer_ok(const char *token) { if (!b_check_token(token, "d*")) { - llwarns << "Token isn't an integer!" << llendl; + LL_WARNS() << "Token isn't an integer!" << LL_ENDL; return FALSE; } return TRUE; @@ -359,13 +359,13 @@ void LLTemplateTokenizer::error(std::string message) const { if(atEOF()) { - llerrs << "Unexpected end of file: " << message << llendl; + LL_ERRS() << "Unexpected end of file: " << message << LL_ENDL; } else { - llerrs << "Problem parsing message template at line " + LL_ERRS() << "Problem parsing message template at line " << line() << ", with token '" << get() << "' : " - << message << llendl; + << message << LL_ENDL; } } @@ -383,12 +383,12 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): std::string vers_string = tokens.next(); mVersion = (F32)atof(vers_string.c_str()); - llinfos << "### Message template version " << mVersion << " ###" << llendl; + LL_INFOS() << "### Message template version " << mVersion << " ###" << LL_ENDL; } else { - llerrs << "Version must be first in the message template, found " - << tokens.next() << llendl; + LL_ERRS() << "Version must be first in the message template, found " + << tokens.next() << LL_ENDL; } while(LLMessageTemplate * templatep = parseMessage(tokens)) @@ -405,8 +405,8 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): if(!tokens.wantEOF()) { - llerrs << "Expected end of template or a message, instead found: " - << tokens.next() << " at " << tokens.line() << llendl; + LL_ERRS() << "Expected end of template or a message, instead found: " + << tokens.next() << " at " << tokens.line() << LL_ENDL; } } @@ -441,7 +441,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) // is name a legit C variable name if (!b_variable_ok(template_name.c_str())) { - llerrs << "Not legit variable name: " << template_name << " at " << tokens.line() << llendl; + LL_ERRS() << "Not legit variable name: " << template_name << " at " << tokens.line() << LL_ENDL; } // ok, now get Frequency ("High", "Medium", or "Low") @@ -461,7 +461,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Expected frequency, got " << freq_string << " at " << tokens.line() << llendl; + LL_ERRS() << "Expected frequency, got " << freq_string << " at " << tokens.line() << LL_ENDL; } // TODO more explicit checking here pls @@ -477,7 +477,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) message_number = (255 << 24) | (255 << 16) | message_number; break; default: - llerrs << "Unknown frequency enum: " << frequency << llendl; + LL_ERRS() << "Unknown frequency enum: " << frequency << LL_ENDL; } templatep = new LLMessageTemplate( @@ -497,7 +497,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Bad trust " << trust << " at " << tokens.line() << llendl; + LL_ERRS() << "Bad trust " << trust << " at " << tokens.line() << LL_ENDL; } // get encoding @@ -512,7 +512,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Bad encoding " << encoding << " at " << tokens.line() << llendl; + LL_ERRS() << "Bad encoding " << encoding << " at " << tokens.line() << LL_ENDL; } // get deprecation @@ -544,8 +544,8 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) if(!tokens.want("}")) { - llerrs << "Expecting closing } for message " << template_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for message " << template_name + << " at " << tokens.line() << LL_ENDL; } return templatep; } @@ -566,8 +566,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) // is name a legit C variable name if (!b_variable_ok(block_name.c_str())) { - llerrs << "not a legal block name: " << block_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal block name: " << block_name + << " at " << tokens.line() << LL_ENDL; } // now, block type ("Single", "Multiple", or "Variable") @@ -586,8 +586,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) // is it a legal integer if (!b_positive_integer_ok(repeats.c_str())) { - llerrs << "not a legal integer for block multiple count: " - << repeats << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal integer for block multiple count: " + << repeats << " at " << tokens.line() << LL_ENDL; } // ok, we can create a block @@ -602,8 +602,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) } else { - llerrs << "bad block type: " << block_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad block type: " << block_type + << " at " << tokens.line() << LL_ENDL; } @@ -617,8 +617,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) if(!tokens.want("}")) { - llerrs << "Expecting closing } for block " << block_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for block " << block_name + << " at " << tokens.line() << LL_ENDL; } return blockp; @@ -637,8 +637,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens if (!b_variable_ok(var_name.c_str())) { - llerrs << "Not a legit variable name: " << var_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Not a legit variable name: " << var_name + << " at " << tokens.line() << LL_ENDL; } std::string var_type = tokens.next(); @@ -721,8 +721,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens if (!b_positive_integer_ok(variable_size.c_str())) { - llerrs << "not a legal integer variable size: " << variable_size - << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal integer variable size: " << variable_size + << " at " << tokens.line() << LL_ENDL; } EMsgVariableType type_enum; @@ -737,8 +737,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens else { type_enum = MVT_FIXED; // removes a warning - llerrs << "bad variable type: " << var_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad variable type: " << var_type + << " at " << tokens.line() << LL_ENDL; } varp = new LLMessageVariable( @@ -748,14 +748,14 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens } else { - llerrs << "bad variable type:" << var_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad variable type:" << var_type + << " at " << tokens.line() << LL_ENDL; } if(!tokens.want("}")) { - llerrs << "Expecting closing } for variable " << var_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for variable " << var_name + << " at " << tokens.line() << LL_ENDL; } return varp; } diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index d79940302..c51883ee3 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -33,7 +33,7 @@ #include "u64.h" #include "llstring.h" -#include "string_table.h" +#include "llstringtable.h" // Anonymous enumeration to provide constants in this file. // *NOTE: These values may be used in sscanf statements below as their @@ -209,7 +209,7 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con } else { - llwarns << "Unknown name value type string " << mStringType << " for " << mName << llendl; + LL_WARNS() << "Unknown name value type string " << mStringType << " for " << mName << LL_ENDL; mType = NVT_NULL; } @@ -261,8 +261,8 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con } else { - llwarns << "LLNameValue::init() - unknown sendto field " - << nvsendto << " for NV " << mName << llendl; + LL_WARNS() << "LLNameValue::init() - unknown sendto field " + << nvsendto << " for NV " << mName << LL_ENDL; mSendto = NVS_NULL; mStringSendto = mNVNameTable->addString("S"); } @@ -332,7 +332,7 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass else { mType = NVT_NULL; - llinfos << "Unknown name-value type " << mStringType << llendl; + LL_INFOS() << "Unknown name-value type " << mStringType << LL_ENDL; } // Nota Bene: Whatever global structure manages this should have these in the name table already! @@ -580,7 +580,7 @@ char *LLNameValue::getString() } else { - llerrs << mName << " not a string!" << llendl; + LL_ERRS() << mName << " not a string!" << LL_ENDL; return NULL; } } @@ -593,7 +593,7 @@ const char *LLNameValue::getAsset() const } else { - llerrs << mName << " not an asset!" << llendl; + LL_ERRS() << mName << " not an asset!" << LL_ENDL; return NULL; } } @@ -606,7 +606,7 @@ F32 *LLNameValue::getF32() } else { - llerrs << mName << " not a F32!" << llendl; + LL_ERRS() << mName << " not a F32!" << LL_ENDL; return NULL; } } @@ -619,7 +619,7 @@ S32 *LLNameValue::getS32() } else { - llerrs << mName << " not a S32!" << llendl; + LL_ERRS() << mName << " not a S32!" << LL_ENDL; return NULL; } } @@ -632,7 +632,7 @@ U32 *LLNameValue::getU32() } else { - llerrs << mName << " not a U32!" << llendl; + LL_ERRS() << mName << " not a U32!" << LL_ENDL; return NULL; } } @@ -645,7 +645,7 @@ U64 *LLNameValue::getU64() } else { - llerrs << mName << " not a U64!" << llendl; + LL_ERRS() << mName << " not a U64!" << LL_ENDL; return NULL; } } @@ -658,7 +658,7 @@ void LLNameValue::getVec3(LLVector3 &vec) } else { - llerrs << mName << " not a Vec3!" << llendl; + LL_ERRS() << mName << " not a Vec3!" << LL_ENDL; } } @@ -670,7 +670,7 @@ LLVector3 *LLNameValue::getVec3() } else { - llerrs << mName << " not a Vec3!" << llendl; + LL_ERRS() << mName << " not a Vec3!" << LL_ENDL; return NULL; } } @@ -726,7 +726,7 @@ LLNameValue &LLNameValue::operator=(const LLNameValue &a) *mNameValueReference.u64 = *a.mNameValueReference.u64; break; default: - llerrs << "Unknown Name value type " << (U32)a.mType << llendl; + LL_ERRS() << "Unknown Name value type " << (U32)a.mType << LL_ENDL; break; } @@ -865,7 +865,7 @@ void LLNameValue::setU32(const U32 a) *mNameValueReference.f32 = (F32)a; break; default: - llerrs << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << llendl; + LL_ERRS() << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << LL_ENDL; break; } return; @@ -883,7 +883,7 @@ void LLNameValue::setVec3(const LLVector3 &a) *mNameValueReference.vec3 = a; break; default: - llerrs << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << llendl; + LL_ERRS() << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << LL_ENDL; break; } return; @@ -895,7 +895,7 @@ std::string LLNameValue::printNameValue() const std::string buffer; buffer = llformat("%s %s %s %s ", mName, mStringType, mStringClass, mStringSendto); buffer += printData(); -// llinfos << "Name Value Length: " << buffer.size() + 1 << llendl; +// LL_INFOS() << "Name Value Length: " << buffer.size() + 1 << LL_ENDL; return buffer; } @@ -928,7 +928,7 @@ std::string LLNameValue::printData() const buffer = llformat( "%f, %f, %f", mNameValueReference.vec3->mV[VX], mNameValueReference.vec3->mV[VY], mNameValueReference.vec3->mV[VZ]); break; default: - llerrs << "Trying to print unknown NameValue type " << mStringType << llendl; + LL_ERRS() << "Trying to print unknown NameValue type " << mStringType << LL_ENDL; break; } return buffer; @@ -962,7 +962,7 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a) s << *(a.mNameValueReference.vec3); break; default: - llerrs << "Trying to print unknown NameValue type " << a.mStringType << llendl; + LL_ERRS() << "Trying to print unknown NameValue type " << a.mStringType << LL_ENDL; break; } return s; diff --git a/indra/llmessage/llnamevalue.h b/indra/llmessage/llnamevalue.h index 273de475f..f8b556b5f 100644 --- a/indra/llmessage/llnamevalue.h +++ b/indra/llmessage/llnamevalue.h @@ -41,7 +41,7 @@ // SitObject STRING // SitPosition VEC3 -#include "string_table.h" +#include "llstringtable.h" #include "llmath.h" #include "v3math.h" #include "lldbstrings.h" diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp index e69631eb3..21cdf1b16 100644 --- a/indra/llmessage/llpacketbuffer.cpp +++ b/indra/llmessage/llpacketbuffer.cpp @@ -41,7 +41,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 if (size > NET_BUFFER_SIZE) { - llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl; + LL_ERRS() << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << LL_ENDL; } else { diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp index d52a9435c..c3ebbaab5 100644 --- a/indra/llmessage/llpacketring.cpp +++ b/indra/llmessage/llpacketring.cpp @@ -200,7 +200,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap) if (mInBufferLength + packetp->getSize() > mMaxBufferLength) { // Toss it. - llwarns << "Throwing away packet, overflowing buffer" << llendl; + LL_WARNS() << "Throwing away packet, overflowing buffer" << LL_ENDL; delete packetp; packetp = NULL; } @@ -332,7 +332,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL { // Nuke this packet, we overflowed the buffer. // Toss it. - llwarns << "Throwing away outbound packet, overflowing buffer" << llendl; + LL_WARNS() << "Throwing away outbound packet, overflowing buffer" << LL_ENDL; } else { @@ -340,7 +340,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL if ((mOutBufferLength > 4192) && queue_timer.getElapsedTimeF32() > 1.f) { // Add it to the queue - llinfos << "Outbound packet queue " << mOutBufferLength << " bytes" << llendl; + LL_INFOS() << "Outbound packet queue " << mOutBufferLength << " bytes" << LL_ENDL; queue_timer.reset(); } packetp = new LLPacketBuffer(host, send_buffer, buf_size); diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index a2b63e8e1..0f9b7c6cd 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -84,7 +84,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) #if LL_DEBUG_POLL_FILE_DESCRIPTORS if(!poll) { - lldebugs << "Poll -- " << (msg?msg:"") << ": no pollfd." << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no pollfd." << LL_ENDL; return; } if(poll->desc.s) @@ -92,13 +92,13 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) apr_os_sock_t os_sock; if(APR_SUCCESS == apr_os_sock_get(&os_sock, poll->desc.s)) { - lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_sock - << " at " << poll->desc.s << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_sock + << " at " << poll->desc.s << LL_ENDL; } else { - lldebugs << "Poll -- " << (msg?msg:"") << " no fd " - << " at " << poll->desc.s << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd " + << " at " << poll->desc.s << LL_ENDL; } } else if(poll->desc.f) @@ -106,18 +106,18 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) apr_os_file_t os_file; if(APR_SUCCESS == apr_os_file_get(&os_file, poll->desc.f)) { - lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_file - << " at " << poll->desc.f << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_file + << " at " << poll->desc.f << LL_ENDL; } else { - lldebugs << "Poll -- " << (msg?msg:"") << " no fd " - << " at " << poll->desc.f << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd " + << " at " << poll->desc.f << LL_ENDL; } } else { - lldebugs << "Poll -- " << (msg?msg:"") << ": no descriptor." << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL; } #endif } @@ -185,7 +185,7 @@ LLPumpIO::~LLPumpIO() { if(mPollset) { -// lldebugs << "cleaning up pollset" << llendl; +// LL_DEBUGS() << "cleaning up pollset" << LL_ENDL; apr_pollset_destroy(mPollset); mPollset = NULL; } @@ -202,10 +202,10 @@ bool LLPumpIO::addChain(chain_t const& chain, F32 timeout) info.mData = LLIOPipe::buffer_ptr_t(new LLBufferArray); LLLinkInfo link; #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "LLPumpIO::addChain() " << chain[0] << " '" - << typeid(*(chain[0])).name() << "'" << llendl; + LL_DEBUGS() << "LLPumpIO::addChain() " << chain[0] << " '" + << typeid(*(chain[0])).name() << "'" << LL_ENDL; #else - lldebugs << "LLPumpIO::addChain() " << chain[0] <reqevents) :"null") + LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null") << ") " #if LL_DEBUG_PIPE_TYPE_IN_PUMP << "on pipe " << typeid(*pipe).name() #endif - << " at " << pipe << llendl; + << " at " << pipe << LL_ENDL; // remove any matching poll file descriptors for this pipe. LLIOPipe::ptr_t pipe_ptr(pipe); @@ -456,7 +456,7 @@ LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t void LLPumpIO::pump(const S32& poll_timeout) { LLFastTimer t1(FTM_PUMP_IO); - //llinfos << "LLPumpIO::pump()" << llendl; + //LL_INFOS() << "LLPumpIO::pump()" << LL_ENDL; // Run any pending runners. mRunner.run(); @@ -484,7 +484,7 @@ void LLPumpIO::pump(const S32& poll_timeout) if(!mPendingChains.empty()) { PUMP_DEBUG; - //lldebugs << "Pushing " << mPendingChains.size() << "." << llendl; + //LL_DEBUGS() << "Pushing " << mPendingChains.size() << "." << LL_ENDL; std::copy( mPendingChains.begin(), mPendingChains.end(), @@ -532,7 +532,7 @@ void LLPumpIO::pump(const S32& poll_timeout) if(mPollset) { PUMP_DEBUG; - //llinfos << "polling" << llendl; + //LL_INFOS() << "polling" << LL_ENDL; S32 count = 0; S32 client_id = 0; { @@ -554,7 +554,7 @@ void LLPumpIO::pump(const S32& poll_timeout) signal_client_t::iterator not_signalled = signalled_client.end(); // Process everything as appropriate - //lldebugs << "Running chain count: " << mRunningChains.size() << llendl; + //LL_DEBUGS() << "Running chain count: " << mRunningChains.size() << LL_ENDL; running_chains_t::iterator run_chain = mRunningChains.begin(); bool process_this_chain = false; while( run_chain != mRunningChains.end() ) @@ -574,9 +574,9 @@ void LLPumpIO::pump(const S32& poll_timeout) && (*run_chain).mTimer.hasExpired()) { PUMP_DEBUG; - llinfos << "Error handler forgot to reset timeout. " + LL_INFOS() << "Error handler forgot to reset timeout. " << "Resetting to " << DEFAULT_CHAIN_EXPIRY_SECS - << " seconds." << llendl; + << " seconds." << LL_ENDL; (*run_chain).setTimeoutSeconds(DEFAULT_CHAIN_EXPIRY_SECS); } } @@ -586,15 +586,15 @@ void LLPumpIO::pump(const S32& poll_timeout) // it timed out and no one handled it, so we need to // retire the chain #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Removing chain " + LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe << " '" << typeid(*((*run_chain).mChainLinks[0].mPipe)).name() - << "' because it timed out." << llendl; + << "' because it timed out." << LL_ENDL; #else -// lldebugs << "Removing chain " +// LL_DEBUGS() << "Removing chain " // << (*run_chain).mChainLinks[0].mPipe -// << " because we reached the end." << llendl; +// << " because we reached the end." << LL_ENDL; #endif run_chain = removeRunningChain(run_chain); continue; @@ -619,12 +619,12 @@ void LLPumpIO::pump(const S32& poll_timeout) { // if there are no conditionals, just process this chain. process_this_chain = true; - //lldebugs << "no conditionals - processing" << llendl; + //LL_DEBUGS() << "no conditionals - processing" << LL_ENDL; } else { PUMP_DEBUG; - //lldebugs << "checking conditionals" << llendl; + //LL_DEBUGS() << "checking conditionals" << LL_ENDL; // Check if this run chain was signalled. If any file // descriptor is ready for something, then go ahead and // process this chian. @@ -664,7 +664,7 @@ void LLPumpIO::pump(const S32& poll_timeout) error_status = LLIOPipe::STATUS_ERROR; if(handleChainError(*run_chain, error_status)) break; ll_debug_poll_fd("Removing pipe", poll); - llwarns << "Removing pipe " + LL_WARNS() << "Removing pipe " << (*run_chain).mChainLinks[0].mPipe << " '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP @@ -673,7 +673,7 @@ void LLPumpIO::pump(const S32& poll_timeout) #endif << "' because: " << events_2_string(poll->rtnevents) - << llendl; + << LL_ENDL; (*run_chain).mHead = (*run_chain).mChainLinks.end(); break; } @@ -701,13 +701,13 @@ void LLPumpIO::pump(const S32& poll_timeout) if((*run_chain).mHead == (*run_chain).mChainLinks.end()) { #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe + LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe << " '" << typeid(*((*run_chain).mChainLinks[0].mPipe)).name() - << "' because we reached the end." << llendl; + << "' because we reached the end." << LL_ENDL; #else -// lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe -// << " because we reached the end." << llendl; +// LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe +// << " because we reached the end." << LL_ENDL; #endif PUMP_DEBUG; @@ -787,7 +787,7 @@ static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain"); void LLPumpIO::callback() { - //llinfos << "LLPumpIO::callback()" << llendl; + //LL_INFOS() << "LLPumpIO::callback()" << LL_ENDL; if(true) { #if LL_THREADS_PUMPIO @@ -844,10 +844,10 @@ LLAPRPool& LLPumpIO::initPool() void LLPumpIO::rebuildPollset() { -// lldebugs << "LLPumpIO::rebuildPollset()" << llendl; +// LL_DEBUGS() << "LLPumpIO::rebuildPollset()" << LL_ENDL; if(mPollset) { - //lldebugs << "destroying pollset" << llendl; + //LL_DEBUGS() << "destroying pollset" << LL_ENDL; apr_pollset_destroy(mPollset); mPollset = NULL; } @@ -858,7 +858,7 @@ void LLPumpIO::rebuildPollset() { size += (*run_it).mDescriptors.size(); } - //lldebugs << "found " << size << " descriptors." << llendl; + //LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL; if(size) { // Recycle the memory pool @@ -903,10 +903,10 @@ void LLPumpIO::processChain(LLChainInfo& chain) { #if LL_DEBUG_PROCESS_LINK #if LL_DEBUG_PIPE_TYPE_IN_PUMP - llinfos << "Processing " << typeid(*((*it).mPipe)).name() << "." - << llendl; + LL_INFOS() << "Processing " << typeid(*((*it).mPipe)).name() << "." + << LL_ENDL; #else - llinfos << "Processing link " << (*it).mPipe << "." << llendl; + LL_INFOS() << "Processing link " << (*it).mPipe << "." << LL_ENDL; #endif #endif #if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN @@ -923,15 +923,15 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "CHANNEL IN(" << (*it).mChannels.in() << "): " - << buf << llendl; + LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in() << "): " + << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)" - << llendl; + LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)" + << LL_ENDL; } } #endif @@ -956,15 +956,15 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): " - << buf << llendl; + LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): " + << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)" - << llendl; + LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)" + << LL_ENDL; } } #endif @@ -974,11 +974,11 @@ void LLPumpIO::processChain(LLChainInfo& chain) // below. if(LLIOPipe::isSuccess(status)) { - llinfos << "Pipe returned: '" + LL_INFOS() << "Pipe returned: '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP << typeid(*((*it).mPipe)).name() << "':'" #endif - << LLIOPipe::lookupStatusString(status) << "'" << llendl; + << LLIOPipe::lookupStatusString(status) << "'" << LL_ENDL; } #endif @@ -1018,12 +1018,12 @@ void LLPumpIO::processChain(LLChainInfo& chain) PUMP_DEBUG; if(LLIOPipe::isError(status)) { - llinfos << "Pump generated pipe err: '" + LL_INFOS() << "Pump generated pipe err: '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP << typeid(*((*it).mPipe)).name() << "':'" #endif << LLIOPipe::lookupStatusString(status) - << "'" << llendl; + << "'" << LL_ENDL; #if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN_ON_ERROR if(chain.mData) { @@ -1040,18 +1040,18 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "Input After Error: " << buf << llendl; + LL_INFOS() << "Input After Error: " << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "Input After Error: (null)" << llendl; + LL_INFOS() << "Input After Error: (null)" << LL_ENDL; } } else { - llinfos << "Input After Error: (null)" << llendl; + LL_INFOS() << "Input After Error: (null)" << LL_ENDL; } #endif keep_going = false; @@ -1063,8 +1063,8 @@ void LLPumpIO::processChain(LLChainInfo& chain) } else { - llinfos << "Unhandled status code: " << status << ":" - << LLIOPipe::lookupStatusString(status) << llendl; + LL_INFOS() << "Unhandled status code: " << status << ":" + << LLIOPipe::lookupStatusString(status) << LL_ENDL; } break; } @@ -1113,8 +1113,8 @@ bool LLPumpIO::handleChainError( do { #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Passing error to " << typeid(*((*rit).mPipe)).name() - << "." << llendl; + LL_DEBUGS() << "Passing error to " << typeid(*((*rit).mPipe)).name() + << "." << LL_ENDL; #endif error = (*rit).mPipe->handleError(error, this); switch(error) @@ -1128,8 +1128,8 @@ bool LLPumpIO::handleChainError( case LLIOPipe::STATUS_BREAK: case LLIOPipe::STATUS_NEED_PROCESS: #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Pipe " << typeid(*((*rit).mPipe)).name() - << " returned code to stop error handler." << llendl; + LL_DEBUGS() << "Pipe " << typeid(*((*rit).mPipe)).name() + << " returned code to stop error handler." << LL_ENDL; #endif keep_going = false; break; @@ -1139,8 +1139,8 @@ bool LLPumpIO::handleChainError( default: if(LLIOPipe::isSuccess(error)) { - llinfos << "Unhandled status code: " << error << ":" - << LLIOPipe::lookupStatusString(error) << llendl; + LL_INFOS() << "Unhandled status code: " << error << ":" + << LLIOPipe::lookupStatusString(error) << LL_ENDL; error = LLIOPipe::STATUS_ERROR; keep_going = false; } diff --git a/indra/llmessage/llsdappservices.cpp b/indra/llmessage/llsdappservices.cpp index 8bab91b0c..4103ece33 100644 --- a/indra/llmessage/llsdappservices.cpp +++ b/indra/llmessage/llsdappservices.cpp @@ -119,8 +119,8 @@ public: virtual bool validate(const std::string& name, LLSD& context) const { - //llinfos << "validate: " << name << ", " - // << LLSDOStreamer(context) << llendl; + //LL_INFOS() << "validate: " << name << ", " + // << LLSDOStreamer(context) << LL_ENDL; if((std::string("PUT") == context["request"]["verb"].asString()) && !name.empty()) { return true; @@ -257,8 +257,8 @@ public: virtual bool validate(const std::string& name, LLSD& context) const { - llinfos << "LLHTTPLiveConfigSingleService::validate(" << name - << ")" << llendl; + LL_INFOS() << "LLHTTPLiveConfigSingleService::validate(" << name + << ")" << LL_ENDL; LLSD option = LLApp::instance()->getOption(name); if(option.isDefined()) return true; else return false; diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp index 615221e0a..49456c71e 100644 --- a/indra/llmessage/llsdmessagebuilder.cpp +++ b/indra/llmessage/llsdmessagebuilder.cpp @@ -91,7 +91,7 @@ void LLSDMessageBuilder::nextBlock(const char* blockname) } else { - llerrs << "existing block not array" << llendl; + LL_ERRS() << "existing block not array" << LL_ENDL; } } @@ -380,7 +380,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) break; default: - llwarns << "Unknown type in conversion of message to LLSD" << llendl; + LL_WARNS() << "Unknown type in conversion of message to LLSD" << LL_ENDL; break; } } @@ -391,7 +391,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) void LLSDMessageBuilder::copyFromLLSD(const LLSD& msg) { mCurrentMessage = msg; - lldebugs << LLSDNotationStreamer(mCurrentMessage) << llendl; + LL_DEBUGS() << LLSDNotationStreamer(mCurrentMessage) << LL_ENDL; } const LLSD& LLSDMessageBuilder::getMessage() const diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index 3d8ca2ad9..a3085cbf5 100644 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -57,12 +57,12 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum // LLTemplateMessageReader::getData behaviour if(NULL == block) { - llerrs << "NULL block name" << llendl; + LL_ERRS() << "NULL block name" << LL_ENDL; return LLSD(); } if(NULL == var) { - llerrs << "NULL var name" << llendl; + LL_ERRS() << "NULL var name" << LL_ENDL; return LLSD(); } if(! input[block].isArray()) @@ -70,7 +70,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum // NOTE: babbage: need to return default for missing blocks to allow // backwards/forwards compatibility - handlers must cope with default // values. - llwarns << "block " << block << " not found" << llendl; + LL_WARNS() << "block " << block << " not found" << LL_ENDL; return LLSD(); } @@ -80,7 +80,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum // NOTE: babbage: need to return default for missing vars to allow // backwards/forwards compatibility - handlers must cope with default // values. - llwarns << "var " << var << " not found" << llendl; + LL_WARNS() << "var " << var << " not found" << LL_ENDL; } return result; } @@ -238,7 +238,7 @@ void LLSDMessageReader::getString(const char *block, const char *var, { if(buffer_size <= 0) { - llwarns << "buffer_size <= 0" << llendl; + LL_WARNS() << "buffer_size <= 0" << LL_ENDL; return; } std::string data = getLLSD(mMessage, block, var, blocknum); diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index 9e8eb4846..8d7c4c028 100644 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -81,7 +81,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name) if (msg_template->getDeprecation() != MD_NOTDEPRECATED) { - llwarns << "Sending deprecated message " << namep << llendl; + LL_WARNS() << "Sending deprecated message " << namep << LL_ENDL; } LLMessageTemplate::message_block_map_t::const_iterator iter; @@ -96,7 +96,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name) } else { - llerrs << "newMessage - Message " << name << " not registered" << llendl; + LL_ERRS() << "newMessage - Message " << name << " not registered" << LL_ENDL; } } @@ -125,7 +125,7 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to setBlock" << llendl; + LL_ERRS() << "newMessage not called prior to setBlock" << LL_ENDL; return; } @@ -133,8 +133,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) const LLMessageBlock* template_data = mCurrentSMessageTemplate->getBlock(bnamep); if (!template_data) { - llerrs << "LLTemplateMessageBuilder::nextBlock " << bnamep - << " not a block in " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock " << bnamep + << " not a block in " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -164,8 +164,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) // if the block is type MBT_SINGLE this is bad! if (template_data->mType == MBT_SINGLE) { - llerrs << "LLTemplateMessageBuilder::nextBlock called multiple times" - << " for " << bnamep << " but is type MBT_SINGLE" << llendl; + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called multiple times" + << " for " << bnamep << " but is type MBT_SINGLE" << LL_ENDL; return; } @@ -175,10 +175,10 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if ( (template_data->mType == MBT_MULTIPLE) &&(mCurrentSDataBlock->mBlockNumber == template_data->mNumber)) { - llerrs << "LLTemplateMessageBuilder::nextBlock called " + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called " << mCurrentSDataBlock->mBlockNumber << " times for " << bnamep << " exceeding " << template_data->mNumber - << " specified in type MBT_MULTIPLE." << llendl; + << " specified in type MBT_MULTIPLE." << LL_ENDL; return; } @@ -191,8 +191,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if (block_data->mBlockNumber > MAX_BLOCKS) { - llerrs << "Trying to pack too many blocks into MBT_VARIABLE type " - << "(limited to " << MAX_BLOCKS << ")" << llendl; + LL_ERRS() << "Trying to pack too many blocks into MBT_VARIABLE type " + << "(limited to " << MAX_BLOCKS << ")" << LL_ENDL; } // create new name @@ -263,11 +263,11 @@ BOOL LLTemplateMessageBuilder::removeLastBlock() if (num_blocks <= 1) { // we just blew away the last one, so return FALSE - llwarns << "not blowing away the only block of message " + LL_WARNS() << "not blowing away the only block of message " << mCurrentSMessageName << ". Block: " << block_name << ". Number: " << num_blocks - << llendl; + << LL_ENDL; return FALSE; } else @@ -290,14 +290,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to addData" << llendl; + LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL; return; } // do we have a current block? if (!mCurrentSDataBlock) { - llerrs << "setBlock not called prior to addData" << llendl; + LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL; return; } @@ -305,7 +305,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep); if (!var_data || !var_data->getName()) { - llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -316,9 +316,9 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM if ((var_data->getSize() == 1) && (size > 255)) { - llwarns << "Field " << varname << " is a Variable 1 but program " + LL_WARNS() << "Field " << varname << " is a Variable 1 but program " << "attempted to stuff more than 255 bytes in " - << "(" << size << "). Clamping size and truncating data." << llendl; + << "(" << size << "). Clamping size and truncating data." << LL_ENDL; size = 255; char *truncate = (char *)data; truncate[254] = 0; // array size is 255 but the last element index is 254 @@ -332,8 +332,8 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM { if (size != var_data->getSize()) { - llerrs << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size " - << var_data->getSize() << llendl; + LL_ERRS() << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size " + << var_data->getSize() << LL_ENDL; return; } // alright, smash it in @@ -350,14 +350,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to addData" << llendl; + LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL; return; } // do we have a current block? if (!mCurrentSDataBlock) { - llerrs << "setBlock not called prior to addData" << llendl; + LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL; return; } @@ -365,7 +365,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep); if (!var_data->getName()) { - llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -373,7 +373,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM if (var_data->getType() == MVT_VARIABLE) { // nope - llerrs << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << llendl; + LL_ERRS() << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << LL_ENDL; return; } else @@ -643,8 +643,8 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat // Just reporting error is likely not enough. Need // to check how to abort or error out gracefully // from this function. XXXTBD - llerrs << "buildBlock failed. Message excedding " - << "sendBuffersize." << llendl; + LL_ERRS() << "buildBlock failed. Message excedding " + << "sendBuffersize." << LL_ENDL; } } else if (template_data->mType == MBT_MULTIPLE) @@ -652,10 +652,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat if (block_count != template_data->mNumber) { // nope! need to fill it in all the way! - llerrs << "Block " << mbci->mName + LL_ERRS() << "Block " << mbci->mName << " is type MBT_MULTIPLE but only has data for " << block_count << " out of its " - << template_data->mNumber << " blocks" << llendl; + << template_data->mNumber << " blocks" << LL_ENDL; } } @@ -669,10 +669,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat if (mvci.getSize() == -1) { // oops, this variable wasn't ever set! - llerrs << "The variable " << mvci.getName() << " in block " + LL_ERRS() << "The variable " << mvci.getName() << " in block " << mbci->mName << " of message " << template_data->mName - << " wasn't set prior to buildMessage call" << llendl; + << " wasn't set prior to buildMessage call" << LL_ENDL; } else { @@ -699,7 +699,7 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat htonmemcpy(&buffer[result], &size, MVT_S32, 4); break; default: - llerrs << "Attempting to build variable field with unknown size of " << size << llendl; + LL_ERRS() << "Attempting to build variable field with unknown size of " << size << LL_ENDL; break; } result += mvci.getDataSize(); @@ -721,11 +721,11 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat // Just reporting error is likely not // enough. Need to check how to abort or error // out gracefully from this function. XXXTBD - llerrs << "buildBlock failed. " + LL_ERRS() << "buildBlock failed. " << "Attempted to pack " << (result + mvci.getSize()) << " bytes into a buffer with size " - << buffer_size << "." << llendl; + << buffer_size << "." << LL_ENDL; } } } @@ -760,7 +760,7 @@ U32 LLTemplateMessageBuilder::buildMessage( // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to buildMessage" << llendl; + LL_ERRS() << "newMessage not called prior to buildMessage" << LL_ENDL; return 0; } @@ -809,7 +809,7 @@ U32 LLTemplateMessageBuilder::buildMessage( } else { - llerrs << "unexpected message frequency in buildMessage" << llendl; + LL_ERRS() << "unexpected message frequency in buildMessage" << LL_ENDL; return 0; } diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 2813cbf7e..6f728ff35 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -68,13 +68,13 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 2!" << llendl; + LL_ERRS() << "No message waiting for decode 2!" << LL_ENDL; return; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentMessageData in getData!" << LL_ENDL; return; } @@ -85,8 +85,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (iter == mCurrentRMessageData->mMemberBlocks.end()) { - llerrs << "Block " << blockname << " #" << blocknum - << " not in message " << mCurrentRMessageData->mName << llendl; + LL_ERRS() << "Block " << blockname << " #" << blocknum + << " not in message " << mCurrentRMessageData->mName << LL_ENDL; return; } @@ -95,8 +95,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (var_data_map.find(vnamep) == var_data_map.end()) { - llerrs << "Variable "<< vnamep << " not in message " - << mCurrentRMessageData->mName<< " block " << bnamep << llendl; + LL_ERRS() << "Variable "<< vnamep << " not in message " + << mCurrentRMessageData->mName<< " block " << bnamep << LL_ENDL; return; } @@ -104,11 +104,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (size && size != vardata.getSize()) { - llerrs << "Msg " << mCurrentRMessageData->mName + LL_ERRS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but copying into buffer of size " << size - << llendl; + << LL_ENDL; return; } @@ -138,11 +138,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname } else { - llwarns << "Msg " << mCurrentRMessageData->mName + LL_WARNS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but truncated to max size of " << max_size - << llendl; + << LL_ENDL; memcpy(datap, vardata.getData(), max_size); } @@ -153,13 +153,13 @@ S32 LLTemplateMessageReader::getNumberOfBlocks(const char *blockname) // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 3!" << llendl; + LL_ERRS() << "No message waiting for decode 3!" << LL_ENDL; return -1; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return -1; } @@ -180,13 +180,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 4!" << llendl; + LL_ERRS() << "No message waiting for decode 4!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -196,8 +196,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -208,15 +208,15 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (!vardata.getName()) { // don't crash - llinfos << "Variable " << varname << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << varname << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } if (mCurrentRMessageTemplate->mMemberBlocks[bnamep]->mType != MBT_SINGLE) { // This is a serious error - crash - llerrs << "Block " << bnamep << " isn't type MBT_SINGLE," - " use getSize with blocknum argument!" << llendl; + LL_ERRS() << "Block " << bnamep << " isn't type MBT_SINGLE," + " use getSize with blocknum argument!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -228,13 +228,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 5!" << llendl; + LL_ERRS() << "No message waiting for decode 5!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -245,8 +245,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -255,8 +255,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (!vardata.getName()) { // don't crash - llinfos << "Variable " << vnamep << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << vnamep << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } @@ -328,8 +328,8 @@ void LLTemplateMessageReader::getF32(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF32Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF32Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -341,8 +341,8 @@ void LLTemplateMessageReader::getF64(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF64Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF64Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -354,8 +354,8 @@ void LLTemplateMessageReader::getVector3(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -367,8 +367,8 @@ void LLTemplateMessageReader::getVector4(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector4Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector4Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -380,8 +380,8 @@ void LLTemplateMessageReader::getVector3d(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3dFast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3dFast " << block << " " + << var << LL_ENDL; v.zeroVec(); } @@ -398,8 +398,8 @@ void LLTemplateMessageReader::getQuat(const char *block, const char *var, } else { - llwarns << "non-finite in getQuatFast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getQuatFast " << block << " " << var + << LL_ENDL; q.loadIdentity(); } } @@ -452,7 +452,7 @@ BOOL LLTemplateMessageReader::decodeTemplate( // is there a message ready to go? if (buffer_size <= 0) { - llwarns << "No message waiting for decode!" << llendl; + LL_WARNS() << "No message waiting for decode!" << LL_ENDL; return(FALSE); } @@ -488,8 +488,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( else // bogus packet received (too short) { if(!custom) - llwarns << "Packet with unusable length received (too short): " - << buffer_size << llendl; + LL_WARNS() << "Packet with unusable length received (too short): " + << buffer_size << LL_ENDL; return(FALSE); } @@ -501,8 +501,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( else { if(!custom) { - llwarns << "Message #" << std::hex << num << std::dec - << " received but not registered!" << llendl; + LL_WARNS() << "Message #" << std::hex << num << std::dec + << " received but not registered!" << LL_ENDL; gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE); } return(FALSE); @@ -514,18 +514,18 @@ BOOL LLTemplateMessageReader::decodeTemplate( void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted ) { // we've run off the end of the packet! - llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName + LL_WARNS() << "Ran off end of packet " << mCurrentRMessageTemplate->mName // << " with id " << mCurrentRecvPacketID << " from " << host << " trying to read " << wanted << " bytes at position " << where << " going past packet end at " << mReceiveSize - << llendl; + << LL_ENDL; if(gMessageSystem->mVerboseLog) { - llinfos << "MSG: -> " << host << "\tREAD PAST END:\t" + LL_INFOS() << "MSG: -> " << host << "\tREAD PAST END:\t" // << mCurrentRecvPacketID << " " - << getMessageName() << llendl; + << getMessageName() << LL_ENDL; } gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET); } @@ -592,7 +592,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, else { if(!custom) - llerrs << "Unknown block type" << llendl; + LL_ERRS() << "Unknown block type" << LL_ENDL; return FALSE; } @@ -660,7 +660,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4); break; default: - llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl; + LL_ERRS() << "Attempting to read variable field with unknown size of " << data_size << LL_ENDL; break; } } @@ -700,7 +700,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, if (mCurrentRMessageData->mMemberBlocks.empty() && !mCurrentRMessageTemplate->mMemberBlocks.empty()) { - lldebugs << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << llendl; + LL_DEBUGS() << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << LL_ENDL; return FALSE; } @@ -717,7 +717,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, LLFastTimer t(FTM_PROCESS_MESSAGES); if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) ) { - llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl; + LL_WARNS() << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << LL_ENDL; } } @@ -747,9 +747,9 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender, if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold()) { - lldebugs << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << + LL_DEBUGS() << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " << - (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << llendl; + (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << LL_ENDL; } } } @@ -767,9 +767,9 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, if(valid && !custom) { mCurrentRMessageTemplate->mReceiveCount++; - //lldebugs << "MessageRecvd:" + //LL_DEBUGS() << "MessageRecvd:" // << mCurrentRMessageTemplate->mName - // << " from " << sender << llendl; + // << " from " << sender << LL_ENDL; } if (valid && isBanned(trusted)) @@ -779,15 +779,15 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, << getMessageName() << " from " << ((trusted) ? "trusted " : "untrusted ") - << sender << llendl; + << sender << LL_ENDL; valid = FALSE; } if(valid && isUdpBanned()) { - llwarns << "Received UDP black listed message " + LL_WARNS() << "Received UDP black listed message " << getMessageName() - << " from " << sender << llendl; + << " from " << sender << LL_ENDL; valid = FALSE; } return valid; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index a46370aed..1cf034534 100644 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -440,8 +440,8 @@ BOOL LLThrottleGroup::dynamicAdjust() //if (total) //{ - // llinfos << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i]; - // llcont << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << llendl; + // LL_INFOS() << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i]; + // LL_CONT << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << LL_ENDL; //} } @@ -482,7 +482,7 @@ BOOL LLThrottleGroup::dynamicAdjust() avail_bps = mCurrentBPS[i] - used_bps; } - //llinfos << i << " avail " << avail_bps << llendl; + //LL_INFOS() << i << " avail " << avail_bps << LL_ENDL; // Historically, a channel could have used more than its current share, // even if it's idle right now. @@ -499,7 +499,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } } - //llinfos << "Pool BPS: " << pool_bps << llendl; + //LL_INFOS() << "Pool BPS: " << pool_bps << LL_ENDL; // Now redistribute the bandwidth to busy channels. F32 unused_bps = 0.f; @@ -508,7 +508,7 @@ BOOL LLThrottleGroup::dynamicAdjust() if (channel_busy[i]) { F32 add_amount = pool_bps * (mNominalBPS[i] / busy_nominal_sum); - //llinfos << "Busy " << i << " gets " << pool_bps << llendl; + //LL_INFOS() << "Busy " << i << " gets " << pool_bps << LL_ENDL; mCurrentBPS[i] += add_amount; // CRO: make sure this doesn't get too huge diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index 034680caf..e647df1c1 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -64,7 +64,7 @@ LLTransferManager::~LLTransferManager() { if (mValid) { - llwarns << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << llendl; + LL_WARNS() << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << LL_ENDL; cleanup(); } } @@ -74,7 +74,7 @@ void LLTransferManager::init() { if (mValid) { - llerrs << "Double initializing LLTransferManager!" << llendl; + LL_ERRS() << "Double initializing LLTransferManager!" << LL_ENDL; } mValid = TRUE; @@ -122,7 +122,7 @@ void LLTransferManager::cleanupConnection(const LLHost &host) { // This can happen legitimately if we've never done a transfer, and we're // cleaning up a circuit. - //llwarns << "Cleaning up nonexistent transfer connection to " << host << llendl; + //LL_WARNS() << "Cleaning up nonexistent transfer connection to " << host << LL_ENDL; return; } LLTransferConnection *connp = iter->second; @@ -203,7 +203,7 @@ LLTransferSource *LLTransferManager::findTransferSource(const LLUUID &transfer_i //static void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferRequest" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferRequest" << LL_ENDL; LLUUID transfer_id; LLTransferSourceType source_type; @@ -219,33 +219,33 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) if (!tscp) { - llwarns << "Source channel not found" << llendl; + LL_WARNS() << "Source channel not found" << LL_ENDL; return; } if (tscp->findTransferSource(transfer_id)) { - llwarns << "Duplicate request for transfer " << transfer_id << ", aborting!" << llendl; + LL_WARNS() << "Duplicate request for transfer " << transfer_id << ", aborting!" << LL_ENDL; return; } S32 size = msgp->getSize("TransferInfo", "Params"); if(size > MAX_PARAMS_SIZE) { - llwarns << "LLTransferManager::processTransferRequest params too big." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest params too big." + << LL_ENDL; return; } - //llinfos << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << llendl; + //LL_INFOS() << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << LL_ENDL; LLTransferSource* tsp = LLTransferSource::createSource( source_type, transfer_id, priority); if(!tsp) { - llwarns << "LLTransferManager::processTransferRequest couldn't create" - << " transfer source!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest couldn't create" + << " transfer source!" << LL_ENDL; return; } U8 tmp[MAX_PARAMS_SIZE]; @@ -258,8 +258,8 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) // This should only happen if the data is corrupt or // incorrectly packed. // *NOTE: We may want to call abortTransfer(). - llwarns << "LLTransferManager::processTransferRequest: bad parameters." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest: bad parameters." + << LL_ENDL; delete tsp; return; } @@ -272,7 +272,7 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferInfo" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferInfo" << LL_ENDL; LLUUID transfer_id; LLTransferTargetType target_type; @@ -286,11 +286,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) msgp->getS32("TransferInfo", "Status", (S32 &)status); msgp->getS32("TransferInfo", "Size", size); - //llinfos << transfer_id << ":" << target_type<< ":" << channel_type << llendl; + //LL_INFOS() << transfer_id << ":" << target_type<< ":" << channel_type << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type); if (!ttcp) { - llwarns << "Target channel not found" << llendl; + LL_WARNS() << "Target channel not found" << LL_ENDL; // Should send a message to abort the transfer. return; } @@ -298,7 +298,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id); if (!ttp) { - llwarns << "TransferInfo for unknown transfer! Not able to handle this yet!" << llendl; + LL_WARNS() << "TransferInfo for unknown transfer! Not able to handle this yet!" << LL_ENDL; // This could happen if we're doing a push transfer, although to avoid confusion, // maybe it should be a different message. return; @@ -306,7 +306,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) if (status != LLTS_OK) { - llwarns << transfer_id << ": Non-ok status, cleaning up" << llendl; + LL_WARNS() << transfer_id << ": Non-ok status, cleaning up" << LL_ENDL; ttp->completionCallback(status); // Clean up the transfer. ttcp->deleteTransfer(ttp); @@ -317,8 +317,8 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) S32 params_size = msgp->getSize("TransferInfo", "Params"); if(params_size > MAX_PARAMS_SIZE) { - llwarns << "LLTransferManager::processTransferInfo params too big." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferInfo params too big." + << LL_ENDL; return; } else if(params_size > 0) @@ -330,15 +330,15 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { // This should only happen if the data is corrupt or // incorrectly packed. - llwarns << "LLTransferManager::processTransferRequest: bad params." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest: bad params." + << LL_ENDL; ttp->abortTransfer(); ttcp->deleteTransfer(ttp); return; } } - //llinfos << "Receiving " << transfer_id << ", size " << size << " bytes" << llendl; + //LL_INFOS() << "Receiving " << transfer_id << ", size " << size << " bytes" << LL_ENDL; ttp->setSize(size); ttp->setGotInfo(TRUE); @@ -358,7 +358,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { // Perhaps this stuff should be inside a method in LLTransferPacket? // I'm too lazy to do it now, though. -// llinfos << "Playing back delayed packet " << packet_id << llendl; +// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL; LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; // This is somewhat inefficient, but avoids us having to duplicate @@ -392,11 +392,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { if (status != LLTS_DONE) { - llwarns << "LLTransferManager::processTransferInfo Error in playback!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferInfo Error in playback!" << LL_ENDL; } else { - llinfos << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << llendl; + LL_INFOS() << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << LL_ENDL; } // This transfer is done, either via error or not. ttp->completionCallback(status); @@ -410,7 +410,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferPacket" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL; LLUUID transfer_id; LLTransferChannelType channel_type; @@ -423,20 +423,20 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) msgp->getS32("TransferData", "Status", (S32 &)status); // Find the transfer associated with this packet. - //llinfos << transfer_id << ":" << channel_type << llendl; + //LL_INFOS() << transfer_id << ":" << channel_type << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type); if (!ttcp) { - llwarns << "Target channel not found" << llendl; + LL_WARNS() << "Target channel not found" << LL_ENDL; return; } LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id); if (!ttp) { - llwarns << "Didn't find matching transfer for " << transfer_id + LL_WARNS() << "Didn't find matching transfer for " << transfer_id << " processing packet " << packet_id - << " from " << msgp->getSender() << llendl; + << " from " << msgp->getSender() << LL_ENDL; return; } @@ -455,7 +455,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) if ((size < 0) || (size > MAX_PACKET_DATA_SIZE)) { - llwarns << "Invalid transfer packet size " << size << llendl; + LL_WARNS() << "Invalid transfer packet size " << size << LL_ENDL; return; } @@ -472,8 +472,8 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) if(!ttp->addDelayedPacket(packet_id, status, tmp_data, size)) { // Whoops - failed to add a delayed packet for some reason. - llwarns << "Too many delayed packets processing transfer " - << transfer_id << " from " << msgp->getSender() << llendl; + LL_WARNS() << "Too many delayed packets processing transfer " + << transfer_id << " from " << msgp->getSender() << LL_ENDL; ttp->abortTransfer(); ttcp->deleteTransfer(ttp); return; @@ -483,15 +483,15 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) const S32 LL_TRANSFER_WARN_GAP = 10; if(!ttp->gotInfo()) { - llwarns << "Got data packet before information in transfer " + LL_WARNS() << "Got data packet before information in transfer " << transfer_id << " from " << msgp->getSender() - << ", got " << packet_id << llendl; + << ", got " << packet_id << LL_ENDL; } else if((packet_id - ttp->getNextPacketID()) > LL_TRANSFER_WARN_GAP) { - llwarns << "Out of order packet in transfer " << transfer_id + LL_WARNS() << "Out of order packet in transfer " << transfer_id << " from " << msgp->getSender() << ", got " << packet_id - << " expecting " << ttp->getNextPacketID() << llendl; + << " expecting " << ttp->getNextPacketID() << LL_ENDL; } #endif return; @@ -516,11 +516,11 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { if (status != LLTS_DONE) { - llwarns << "LLTransferManager::processTransferPacket Error in transfer!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferPacket Error in transfer!" << LL_ENDL; } else { -// llinfos << "LLTransferManager::processTransferPacket done for " << transfer_id << llendl; +// LL_INFOS() << "LLTransferManager::processTransferPacket done for " << transfer_id << LL_ENDL; } // This transfer is done, either via error or not. ttp->completionCallback(status); @@ -534,7 +534,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { // Perhaps this stuff should be inside a method in LLTransferPacket? // I'm too lazy to do it now, though. -// llinfos << "Playing back delayed packet " << packet_id << llendl; +// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL; LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; // This is somewhat inefficient, but avoids us having to duplicate @@ -564,7 +564,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferPacket" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL; LLUUID transfer_id; LLTransferChannelType channel_type; @@ -598,7 +598,7 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) } } - llwarns << "Couldn't find transfer " << transfer_id << " to abort!" << llendl; + LL_WARNS() << "Couldn't find transfer " << transfer_id << " to abort!" << LL_ENDL; } @@ -608,7 +608,7 @@ void LLTransferManager::reliablePacketCallback(void **user_data, S32 result) LLUUID *transfer_idp = (LLUUID *)user_data; if (result) { - llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; + LL_WARNS() << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << LL_ENDL; LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp); if (tsp) { @@ -758,7 +758,7 @@ void LLTransferSourceChannel::updateTransfers() // We DON'T want to send any packets if they're blocked, they'll just end up // piling up on the other end. - //llwarns << "Blocking transfers due to blocked circuit for " << getHost() << llendl; + //LL_WARNS() << "Blocking transfers due to blocked circuit for " << getHost() << LL_ENDL; return; } @@ -776,7 +776,7 @@ void LLTransferSourceChannel::updateTransfers() BOOL done = FALSE; for (iter = mTransferSources.mMap.begin(); (iter != mTransferSources.mMap.end()) && !done;) { - //llinfos << "LLTransferSourceChannel::updateTransfers()" << llendl; + //LL_INFOS() << "LLTransferSourceChannel::updateTransfers()" << LL_ENDL; // Do stuff. next = iter; next++; @@ -848,11 +848,11 @@ void LLTransferSourceChannel::updateTransfers() // We're OK, don't need to do anything. Keep sending data. break; case LLTS_ERROR: - llwarns << "Error in transfer dataCallback!" << llendl; + LL_WARNS() << "Error in transfer dataCallback!" << LL_ENDL; // fall through case LLTS_DONE: // We need to clean up this transfer source. - //llinfos << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << llendl; + //LL_INFOS() << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << LL_ENDL; tsp->completionCallback(status); delete tsp; @@ -860,7 +860,7 @@ void LLTransferSourceChannel::updateTransfers() iter = next; break; default: - llerrs << "Unknown transfer error code!" << llendl; + LL_ERRS() << "Unknown transfer error code!" << LL_ENDL; } // At this point, we should do priority adjustment (since some transfers like @@ -906,7 +906,7 @@ BOOL LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) } } - llerrs << "Unable to find transfer source to delete!" << llendl; + LL_ERRS() << "Unable to find transfer source to delete!" << LL_ENDL; return FALSE; } @@ -947,7 +947,7 @@ void LLTransferTargetChannel::requestTransfer( source_params.getType()); if (!ttp) { - llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl; + LL_WARNS() << "LLTransferManager::requestTransfer aborting due to target creation failure!" << LL_ENDL; return; } @@ -1021,7 +1021,7 @@ BOOL LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) } } - llerrs << "Unable to find transfer target to delete!" << llendl; + LL_ERRS() << "Unable to find transfer target to delete!" << LL_ENDL; return FALSE; } @@ -1083,7 +1083,7 @@ void LLTransferSource::sendTransferStatus(LLTSCode status) void LLTransferSource::abortTransfer() { // Send a message down, call the completion callback - llinfos << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << llendl; + LL_INFOS() << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << LL_ENDL; gMessageSystem->newMessage("TransferAbort"); gMessageSystem->nextBlock("TransferInfo"); gMessageSystem->addUUID("TransferID", getID()); @@ -1101,7 +1101,7 @@ void LLTransferSource::registerSourceType(const LLTransferSourceType stype, LLTr { // Disallow changing what class handles a source type // Unclear when you would want to do this, and whether it would work. - llerrs << "Reregistering source type " << stype << llendl; + LL_ERRS() << "Reregistering source type " << stype << LL_ENDL; } else { @@ -1129,7 +1129,7 @@ LLTransferSource *LLTransferSource::createSource(const LLTransferSourceType styp if (!sSourceCreateMap.count(stype)) { // Use the callback to create the source type if it's not there. - llwarns << "Unknown transfer source type: " << stype << llendl; + LL_WARNS() << "Unknown transfer source type: " << stype << LL_ENDL; return NULL; } return (sSourceCreateMap[stype])(id, priority); @@ -1216,7 +1216,7 @@ LLTransferTarget::~LLTransferTarget() void LLTransferTarget::abortTransfer() { // Send a message up, call the completion callback - llinfos << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << llendl; + LL_INFOS() << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << LL_ENDL; gMessageSystem->newMessage("TransferAbort"); gMessageSystem->nextBlock("TransferInfo"); gMessageSystem->addUUID("TransferID", getID()); @@ -1248,7 +1248,7 @@ bool LLTransferTarget::addDelayedPacket( #ifdef _DEBUG if (mDelayedPacketMap.find(packet_id) != mDelayedPacketMap.end()) { - llerrs << "Packet ALREADY in delayed packet map!" << llendl; + LL_ERRS() << "Packet ALREADY in delayed packet map!" << LL_ENDL; } #endif @@ -1269,7 +1269,7 @@ LLTransferTarget* LLTransferTarget::createTarget( case LLTTT_VFILE: return new LLTransferTargetVFile(id, source_type); default: - llwarns << "Unknown transfer target type: " << type << llendl; + LL_WARNS() << "Unknown transfer target type: " << type << LL_ENDL; return NULL; } } @@ -1304,7 +1304,7 @@ void LLTransferSourceParamsInvItem::setAsset(const LLUUID &asset_id, const LLAss void LLTransferSourceParamsInvItem::packParams(LLDataPacker &dp) const { - lldebugs << "LLTransferSourceParamsInvItem::packParams()" << llendl; + LL_DEBUGS() << "LLTransferSourceParamsInvItem::packParams()" << LL_ENDL; dp.packUUID(mAgentID, "AgentID"); dp.packUUID(mSessionID, "SessionID"); dp.packUUID(mOwnerID, "OwnerID"); diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index 8537773a3..80ed3340c 100644 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -66,18 +66,18 @@ void LLTransferSourceAsset::initTransfer() } else { - llwarns << "Attempted to request blocked asset " + LL_WARNS() << "Attempted to request blocked asset " << mParams.getAssetID() << ":" << LLAssetType::lookupHumanReadable(mParams.getAssetType()) - << llendl; + << LL_ENDL; sendTransferStatus(LLTS_ERROR); } } else { - llwarns << "Attempted to request asset " << mParams.getAssetID() + LL_WARNS() << "Attempted to request asset " << mParams.getAssetID() << ":" << LLAssetType::lookupHumanReadable(mParams.getAssetType()) - << " without an asset system!" << llendl; + << " without an asset system!" << LL_ENDL; sendTransferStatus(LLTS_ERROR); } } @@ -93,7 +93,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, S32 &returned_bytes, BOOL &delete_returned) { - //llinfos << "LLTransferSourceAsset::dataCallback" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::dataCallback" << LL_ENDL; if (!mGotResponse) { return LLTS_SKIP; @@ -109,14 +109,14 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, if (packet_id != mLastPacketID + 1) { - llerrs << "Can't handle out of order file transfer yet!" << llendl; + LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL; } // grab a buffer from the right place in the file if (!vf.seek(mCurPos, 0)) { - llwarns << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << llendl; - llwarns << "While sending " << mParams.getAssetID() << llendl; + LL_WARNS() << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << LL_ENDL; + LL_WARNS() << "While sending " << mParams.getAssetID() << LL_ENDL; return LLTS_ERROR; } @@ -160,13 +160,13 @@ void LLTransferSourceAsset::completionCallback(const LLTSCode status) void LLTransferSourceAsset::packParams(LLDataPacker& dp) const { - //llinfos << "LLTransferSourceAsset::packParams" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::packParams" << LL_ENDL; mParams.packParams(dp); } BOOL LLTransferSourceAsset::unpackParams(LLDataPacker &dp) { - //llinfos << "LLTransferSourceAsset::unpackParams" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::unpackParams" << LL_ENDL; return mParams.unpackParams(dp); } @@ -183,13 +183,13 @@ void LLTransferSourceAsset::responderCallback(LLVFS *vfs, const LLUUID& uuid, LL if (!tsap) { - llinfos << "Aborting transfer " << transfer_id << " callback, transfer source went away" << llendl; + LL_INFOS() << "Aborting transfer " << transfer_id << " callback, transfer source went away" << LL_ENDL; return; } if (result) { - llinfos << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << llendl; + LL_INFOS() << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << LL_ENDL; } LLTSCode status; diff --git a/indra/llmessage/lltransfersourcefile.cpp b/indra/llmessage/lltransfersourcefile.cpp index 43c9448fb..1f284a158 100644 --- a/indra/llmessage/lltransfersourcefile.cpp +++ b/indra/llmessage/lltransfersourcefile.cpp @@ -43,7 +43,7 @@ LLTransferSourceFile::~LLTransferSourceFile() { if (mFP) { - llerrs << "Destructor called without the completion callback being called!" << llendl; + LL_ERRS() << "Destructor called without the completion callback being called!" << LL_ENDL; } } @@ -56,7 +56,7 @@ void LLTransferSourceFile::initTransfer() || (filename == "..") || (filename.find(delimiter[0]) != std::string::npos)) { - llwarns << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << llendl; + LL_WARNS() << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << LL_ENDL; sendTransferStatus(LLTS_ERROR); return; @@ -88,17 +88,17 @@ LLTSCode LLTransferSourceFile::dataCallback(const S32 packet_id, S32 &returned_bytes, BOOL &delete_returned) { - //llinfos << "LLTransferSourceFile::dataCallback" << llendl; + //LL_INFOS() << "LLTransferSourceFile::dataCallback" << LL_ENDL; if (!mFP) { - llerrs << "Data callback without file set!" << llendl; + LL_ERRS() << "Data callback without file set!" << LL_ENDL; return LLTS_ERROR; } if (packet_id != mLastPacketID + 1) { - llerrs << "Can't handle out of order file transfer yet!" << llendl; + LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL; } // Grab up until the max number of bytes from the file. @@ -137,13 +137,13 @@ void LLTransferSourceFile::completionCallback(const LLTSCode status) void LLTransferSourceFile::packParams(LLDataPacker& dp) const { - //llinfos << "LLTransferSourceFile::packParams" << llendl; + //LL_INFOS() << "LLTransferSourceFile::packParams" << LL_ENDL; mParams.packParams(dp); } BOOL LLTransferSourceFile::unpackParams(LLDataPacker &dp) { - //llinfos << "LLTransferSourceFile::unpackParams" << llendl; + //LL_INFOS() << "LLTransferSourceFile::unpackParams" << LL_ENDL; return mParams.unpackParams(dp); } @@ -169,6 +169,6 @@ BOOL LLTransferSourceParamsFile::unpackParams(LLDataPacker &dp) dp.unpackU8(delete_flag, "Delete"); mDeleteOnCompletion = delete_flag; - llinfos << "Unpacked filename: " << mFilename << llendl; + LL_INFOS() << "Unpacked filename: " << mFilename << LL_ENDL; return TRUE; } diff --git a/indra/llmessage/lltransfertargetfile.cpp b/indra/llmessage/lltransfertargetfile.cpp index 560fc8b6e..ca0318a2d 100644 --- a/indra/llmessage/lltransfertargetfile.cpp +++ b/indra/llmessage/lltransfertargetfile.cpp @@ -44,7 +44,7 @@ LLTransferTargetFile::~LLTransferTargetFile() { if (mFP) { - llerrs << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << llendl; + LL_ERRS() << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << LL_ENDL; fclose(mFP); mFP = NULL; } @@ -61,7 +61,7 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams ¶ms) { if (params.getType() != mType) { - llwarns << "Target parameter type doesn't match!" << llendl; + LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL; return; } @@ -70,8 +70,8 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams ¶ms) LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size) { - //llinfos << "LLTransferTargetFile::dataCallback" << llendl; - //llinfos << "Packet: " << packet_id << llendl; + //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL; + //LL_INFOS() << "Packet: " << packet_id << LL_ENDL; if (!mFP) { @@ -79,7 +79,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c if (!mFP) { - llwarns << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << llendl; + LL_WARNS() << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << LL_ENDL; return LLTS_ERROR; } } @@ -91,7 +91,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c S32 count = (S32)fwrite(in_datap, 1, in_size, mFP); if (count != in_size) { - llwarns << "Failure in LLTransferTargetFile::dataCallback!" << llendl; + LL_WARNS() << "Failure in LLTransferTargetFile::dataCallback!" << LL_ENDL; return LLTS_ERROR; } return LLTS_OK; @@ -99,7 +99,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c void LLTransferTargetFile::completionCallback(const LLTSCode status) { - llinfos << "LLTransferTargetFile::completionCallback" << llendl; + LL_INFOS() << "LLTransferTargetFile::completionCallback" << LL_ENDL; if (mFP) { fclose(mFP); @@ -113,7 +113,7 @@ void LLTransferTargetFile::completionCallback(const LLTSCode status) case LLTS_ABORT: case LLTS_ERROR: // We're aborting this transfer, we don't want to keep this file. - llwarns << "Aborting file transfer for " << mParams.mFilename << llendl; + LL_WARNS() << "Aborting file transfer for " << mParams.mFilename << LL_ENDL; if (mFP) { // Only need to remove file if we successfully opened it. diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index c78d9288b..3c234b972 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -115,7 +115,7 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams ¶ms) { if (params.getType() != mType) { - llwarns << "Target parameter type doesn't match!" << llendl; + LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL; return; } @@ -125,8 +125,8 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams ¶ms) LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size) { - //llinfos << "LLTransferTargetFile::dataCallback" << llendl; - //llinfos << "Packet: " << packet_id << llendl; + //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL; + //LL_INFOS() << "Packet: " << packet_id << LL_ENDL; LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND); if (mNeedsCreate) @@ -142,7 +142,7 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, if (!vf.write(in_datap, in_size)) { - llwarns << "Failure in LLTransferTargetVFile::dataCallback!" << llendl; + LL_WARNS() << "Failure in LLTransferTargetVFile::dataCallback!" << LL_ENDL; return LLTS_ERROR; } return LLTS_OK; @@ -151,11 +151,11 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, void LLTransferTargetVFile::completionCallback(const LLTSCode status) { - //llinfos << "LLTransferTargetVFile::completionCallback" << llendl; + //LL_INFOS() << "LLTransferTargetVFile::completionCallback" << LL_ENDL; if (!gAssetStorage) { - llwarns << "Aborting vfile transfer after asset storage shut down!" << llendl; + LL_WARNS() << "Aborting vfile transfer after asset storage shut down!" << LL_ENDL; return; } @@ -169,14 +169,14 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) LLVFile file(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::WRITE); if (!file.rename(mParams.getAssetID(), mParams.getAssetType())) { - llerrs << "LLTransferTargetVFile: rename failed" << llendl; + LL_ERRS() << "LLTransferTargetVFile: rename failed" << LL_ENDL; } } err_code = LL_ERR_NOERR; - lldebugs << "LLTransferTargetVFile::completionCallback for " + LL_DEBUGS() << "LLTransferTargetVFile::completionCallback for " << mParams.getAssetID() << "," << LLAssetType::lookup(mParams.getAssetType()) - << " with temp id " << mTempID << llendl; + << " with temp id " << mTempID << LL_ENDL; break; case LLTS_ERROR: case LLTS_ABORT: @@ -184,7 +184,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) default: { // We're aborting this transfer, we don't want to keep this file. - llwarns << "Aborting vfile transfer for " << mParams.getAssetID() << llendl; + LL_WARNS() << "Aborting vfile transfer for " << mParams.getAssetID() << LL_ENDL; LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND); vf.remove(); } diff --git a/indra/llmessage/lltrustedmessageservice.cpp b/indra/llmessage/lltrustedmessageservice.cpp index fea7fc72c..151d02a15 100644 --- a/indra/llmessage/lltrustedmessageservice.cpp +++ b/indra/llmessage/lltrustedmessageservice.cpp @@ -63,7 +63,7 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response, { LL_WARNS("Messaging") << "trusted message POST to /trusted-message/" << name << " from unknown or untrusted sender " - << sender << llendl; + << sender << LL_ENDL; response->status(403, "Unknown or untrusted sender"); } else @@ -71,13 +71,13 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response, gMessageSystem->receivedMessageFromTrustedSender(); if (input.has("binary-template-data")) { - llinfos << "Dispatching template: " << input << llendl; + LL_INFOS() << "Dispatching template: " << input << LL_ENDL; // try and send this message using udp dispatch LLMessageSystem::dispatchTemplate(name, message_data, response); } else { - llinfos << "Dispatching without template: " << input << llendl; + LL_INFOS() << "Dispatching without template: " << input << LL_ENDL; LLMessageSystem::dispatch(name, message_data, response); } } diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index a112277ad..85b030785 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -132,7 +132,7 @@ void LLURLRequest::initialize_impl(void) } catch (AICurlNoBody const& error) { - llwarns << "Injector::get_body() failed: " << error.what() << llendl; + LL_WARNS() << "Injector::get_body() failed: " << error.what() << LL_ENDL; } if (success) @@ -261,7 +261,7 @@ bool LLURLRequest::configure(AICurlEasyRequest_wat const& curlEasyRequest_w) break; default: - llwarns << "Unhandled URLRequest action: " << mAction << llendl; + LL_WARNS() << "Unhandled URLRequest action: " << mAction << LL_ENDL; break; } if(rv) diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp index a4a68d0c8..c506af19c 100644 --- a/indra/llmessage/lluseroperation.cpp +++ b/indra/llmessage/lluseroperation.cpp @@ -100,7 +100,7 @@ LLUserOperationMgr::~LLUserOperationMgr() { if (mUserOperationList.size() > 0) { - llwarns << "Exiting with user operations pending." << llendl; + LL_WARNS() << "Exiting with user operations pending." << LL_ENDL; } } @@ -109,7 +109,7 @@ void LLUserOperationMgr::addOperation(LLUserOperation* op) { if(!op) { - llwarns << "Tried to add null op" << llendl; + LL_WARNS() << "Tried to add null op" << LL_ENDL; return; } LLUUID id = op->getTransactionID(); @@ -160,7 +160,7 @@ void LLUserOperationMgr::deleteExpiredOperations() op = (*it).second; if(op && op->isExpired()) { - lldebugs << "expiring: " << (*it).first << llendl; + LL_DEBUGS() << "expiring: " << (*it).first << LL_ENDL; op->expire(); mUserOperationList.erase(it++); delete op; diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp index f8c55d52a..4aba5cae7 100644 --- a/indra/llmessage/llxfer.cpp +++ b/indra/llmessage/llxfer.cpp @@ -99,7 +99,7 @@ void LLXfer::cleanup () S32 LLXfer::startSend (U64 xfer_id, const LLHost &remote_host) { - llwarns << "undifferentiated LLXfer::startSend for " << getFileName() << llendl; + LL_WARNS() << "undifferentiated LLXfer::startSend for " << getFileName() << LL_ENDL; return (-1); } @@ -115,8 +115,8 @@ void LLXfer::setXferSize (S32 xfer_size) S32 LLXfer::startDownload() { - llwarns << "undifferentiated LLXfer::startDownload for " << getFileName() - << llendl; + LL_WARNS() << "undifferentiated LLXfer::startDownload for " << getFileName() + << LL_ENDL; return (-1); } @@ -140,7 +140,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size) } else { - llerrs << "NULL data passed in receiveData" << llendl; + LL_ERRS() << "NULL data passed in receiveData" << LL_ENDL; } } @@ -163,7 +163,7 @@ S32 LLXfer::flush() S32 LLXfer::suck(S32 start_position) { - llwarns << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << llendl; + LL_WARNS() << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << LL_ENDL; return (-1); } @@ -196,7 +196,7 @@ void LLXfer::sendPacket(S32 packet_num) if (fdata_size < 0) { - llwarns << "negative data size in xfer send, aborting" << llendl; + LL_WARNS() << "negative data size in xfer send, aborting" << LL_ENDL; abort(LL_ERR_EOF); return; } @@ -289,13 +289,13 @@ S32 LLXfer::processEOF() if (LL_ERR_NOERR == mCallbackResult) { - llinfos << "xfer from " << mRemoteHost << " complete: " << getFileName() - << llendl; + LL_INFOS() << "xfer from " << mRemoteHost << " complete: " << getFileName() + << LL_ENDL; } else { - llinfos << "xfer from " << mRemoteHost << " failed, code " - << mCallbackResult << ": " << getFileName() << llendl; + LL_INFOS() << "xfer from " << mRemoteHost << " failed, code " + << mCallbackResult << ": " << getFileName() << LL_ENDL; } if (mCallback) @@ -323,8 +323,8 @@ void LLXfer::abort (S32 result_code) { mCallbackResult = result_code; - llinfos << "Aborting xfer from " << mRemoteHost << " named " << getFileName() - << " - error: " << result_code << llendl; + LL_INFOS() << "Aborting xfer from " << mRemoteHost << " named " << getFileName() + << " - error: " << result_code << LL_ENDL; gMessageSystem->newMessageFast(_PREHASH_AbortXfer); gMessageSystem->nextBlockFast(_PREHASH_XferID); diff --git a/indra/llmessage/llxfer.h b/indra/llmessage/llxfer.h index f9348eb11..edf5eeb82 100644 --- a/indra/llmessage/llxfer.h +++ b/indra/llmessage/llxfer.h @@ -32,6 +32,10 @@ #include "llextendedstatus.h" const S32 LL_XFER_LARGE_PAYLOAD = 7680; +const S32 LL_ERR_FILE_EMPTY = -44; +const int LL_ERR_FILE_NOT_FOUND = -43; +const int LL_ERR_CANNOT_OPEN_FILE = -42; +const int LL_ERR_EOF = -39; typedef enum ELLXferStatus { e_LL_XFER_UNINITIALIZED, diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp index 9e02af2c3..257a13f27 100644 --- a/indra/llmessage/llxfer_file.cpp +++ b/indra/llmessage/llxfer_file.cpp @@ -102,12 +102,12 @@ void LLXfer_File::cleanup () if (mDeleteLocalOnCompletion) { - lldebugs << "Removing file: " << mLocalFilename << llendl; + LL_DEBUGS() << "Removing file: " << mLocalFilename << LL_ENDL; LLFile::remove(mLocalFilename); } else { - lldebugs << "Keeping local file: " << mLocalFilename << llendl; + LL_DEBUGS() << "Keeping local file: " << mLocalFilename << LL_ENDL; } LLXfer::cleanup(); @@ -139,7 +139,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id, mCallbackDataHandle = user_data; mCallbackResult = LL_ERR_NOERR; - llinfos << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << llendl; + LL_INFOS() << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << LL_ENDL; if (mBuffer) { @@ -182,7 +182,7 @@ S32 LLXfer_File::startDownload() } else { - llwarns << "Couldn't create file to be received!" << llendl; + LL_WARNS() << "Couldn't create file to be received!" << LL_ENDL; retval = -1; } @@ -223,7 +223,7 @@ S32 LLXfer_File::startSend (U64 xfer_id, const LLHost &remote_host) } else { - llinfos << "Warning: " << mLocalFilename << " not found." << llendl; + LL_INFOS() << "Warning: " << mLocalFilename << " not found." << LL_ENDL; return (LL_ERR_FILE_NOT_FOUND); } @@ -279,7 +279,7 @@ S32 LLXfer_File::flush() { if (mFp) { - llerrs << "Overwriting open file pointer!" << llendl; + LL_ERRS() << "Overwriting open file pointer!" << LL_ENDL; } mFp = LLFile::fopen(mTempFilename,"a+b"); /* Flawfinder : ignore */ @@ -287,10 +287,10 @@ S32 LLXfer_File::flush() { if (fwrite(mBuffer,1,mBufferLength,mFp) != mBufferLength) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } -// llinfos << "******* wrote " << mBufferLength << " bytes of file xfer" << llendl; +// LL_INFOS() << "******* wrote " << mBufferLength << " bytes of file xfer" << LL_ENDL; fclose(mFp); mFp = NULL; @@ -298,7 +298,7 @@ S32 LLXfer_File::flush() } else { - llwarns << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << llendl; + LL_WARNS() << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << LL_ENDL; retval = LL_ERR_CANNOT_OPEN_FILE; } } @@ -329,37 +329,37 @@ S32 LLXfer_File::processEOF() { #if !LL_WINDOWS S32 error_number = errno; - llinfos << "Rename failure (" << error_number << ") - " - << mTempFilename << " to " << mLocalFilename << llendl; + LL_INFOS() << "Rename failure (" << error_number << ") - " + << mTempFilename << " to " << mLocalFilename << LL_ENDL; if(EXDEV == error_number) { if(copy_file(mTempFilename, mLocalFilename) == 0) { - llinfos << "Rename across mounts; copying+unlinking the file instead." << llendl; + LL_INFOS() << "Rename across mounts; copying+unlinking the file instead." << LL_ENDL; unlink(mTempFilename.c_str()); } else { - llwarns << "Copy failure - " << mTempFilename << " to " - << mLocalFilename << llendl; + LL_WARNS() << "Copy failure - " << mTempFilename << " to " + << mLocalFilename << LL_ENDL; } } else { //LLFILE* fp = LLFile::fopen(mTempFilename, "r"); - //llwarns << "File " << mTempFilename << " does " - // << (!fp ? "not" : "" ) << " exit." << llendl; + //LL_WARNS() << "File " << mTempFilename << " does " + // << (!fp ? "not" : "" ) << " exit." << LL_ENDL; //if(fp) fclose(fp); //fp = LLFile::fopen(mLocalFilename, "r"); - //llwarns << "File " << mLocalFilename << " does " - // << (!fp ? "not" : "" ) << " exit." << llendl; + //LL_WARNS() << "File " << mLocalFilename << " does " + // << (!fp ? "not" : "" ) << " exit." << LL_ENDL; //if(fp) fclose(fp); - llwarns << "Rename fatally failed, can only handle EXDEV (" - << EXDEV << ")" << llendl; + LL_WARNS() << "Rename fatally failed, can only handle EXDEV (" + << EXDEV << ")" << LL_ENDL; } #else - llwarns << "Rename failure - " << mTempFilename << " to " - << mLocalFilename << llendl; + LL_WARNS() << "Rename failure - " << mTempFilename << " to " + << mLocalFilename << LL_ENDL; #endif } } diff --git a/indra/llmessage/llxfer_mem.cpp b/indra/llmessage/llxfer_mem.cpp index 4c7e83c33..3bea08f2e 100644 --- a/indra/llmessage/llxfer_mem.cpp +++ b/indra/llmessage/llxfer_mem.cpp @@ -130,7 +130,7 @@ S32 LLXfer_Mem::processEOF() mStatus = e_LL_XFER_COMPLETE; - llinfos << "xfer complete: " << getFileName() << llendl; + LL_INFOS() << "xfer complete: " << getFileName() << LL_ENDL; if (mCallback) { @@ -164,7 +164,7 @@ S32 LLXfer_Mem::initializeRequest(U64 xfer_id, mRemotePath = remote_path; mDeleteRemoteOnCompletion = delete_remote_on_completion; - llinfos << "Requesting file: " << remote_filename << llendl; + LL_INFOS() << "Requesting file: " << remote_filename << LL_ENDL; delete [] mBuffer; mBuffer = NULL; diff --git a/indra/llmessage/llxfer_vfile.cpp b/indra/llmessage/llxfer_vfile.cpp index 751a69518..4a378d1d3 100644 --- a/indra/llmessage/llxfer_vfile.cpp +++ b/indra/llmessage/llxfer_vfile.cpp @@ -118,7 +118,7 @@ S32 LLXfer_VFile::initializeRequest(U64 xfer_id, mName = llformat("VFile %s:%s", id_string.c_str(), LLAssetType::lookup(mType)); - llinfos << "Requesting " << mName << llendl; + LL_INFOS() << "Requesting " << mName << LL_ENDL; if (mBuffer) { @@ -236,8 +236,8 @@ S32 LLXfer_VFile::suck(S32 start_position) // grab a buffer from the right place in the file if (! mVFile->seek(start_position, 0)) { - llwarns << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << llendl; - llwarns << "While sending file " << mLocalID << llendl; + LL_WARNS() << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << LL_ENDL; + LL_WARNS() << "While sending file " << mLocalID << LL_ENDL; return -1; } @@ -291,7 +291,7 @@ S32 LLXfer_VFile::processEOF() LLVFile file(mVFS, mTempID, mType, LLVFile::WRITE); if (! file.rename(mLocalID, mType)) { - llinfos << "copy from temp file failed: unable to rename to " << mLocalID << llendl; + LL_INFOS() << "copy from temp file failed: unable to rename to " << mLocalID << LL_ENDL; } } diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index 9dbb77492..1ea3c576e 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -196,13 +196,13 @@ void LLXferManager::printHostStatus() LLHostStatus *host_statusp = NULL; if (!mOutgoingHosts.empty()) { - llinfos << "Outgoing Xfers:" << llendl; + LL_INFOS() << "Outgoing Xfers:" << LL_ENDL; for (status_list_t::iterator iter = mOutgoingHosts.begin(); iter != mOutgoingHosts.end(); ++iter) { host_statusp = *iter; - llinfos << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << llendl; + LL_INFOS() << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << LL_ENDL; } } } @@ -392,7 +392,7 @@ U64 LLXferManager::registerXfer(const void *datap, const S32 length) } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; xfer_id = 0; } @@ -455,7 +455,7 @@ void LLXferManager::requestFile(const std::string& local_filename, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -483,7 +483,7 @@ void LLXferManager::requestFile(const std::string& remote_filename, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -528,7 +528,7 @@ void LLXferManager::requestVFile(const LLUUID& local_id, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -570,7 +570,7 @@ void LLXferManager::requestXfer( } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } @@ -589,7 +589,7 @@ void LLXferManager::requestXfer(U64 xfer_id, const LLHost &remote_host, BOOL del } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } */ @@ -616,9 +616,9 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user if (!xferp) { char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llwarns << "received xfer data from " << mesgsys->getSender() + LL_WARNS() << "received xfer data from " << mesgsys->getSender() << " for non-existent xfer id: " - << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << llendl; + << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << LL_ENDL; return; } @@ -629,11 +629,11 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user // confirm it if it was a resend of the last one, since the confirmation might have gotten dropped if (decodePacketNum(packetnum) == (xferp->mPacketNum - 1)) { - llinfos << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << llendl; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender()); + LL_INFOS() << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << LL_ENDL; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender()); } else { - llinfos << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << llendl; + LL_INFOS() << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << LL_ENDL; } return; } @@ -802,8 +802,8 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user mesgsys->getU64Fast(_PREHASH_XferID, _PREHASH_ID, id); char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llinfos << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) - << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) + << " to " << mesgsys->getSender() << LL_ENDL; mesgsys->getStringFast(_PREHASH_XferID, _PREHASH_Filename, local_filename); @@ -823,16 +823,16 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { if(NULL == LLAssetType::lookup(type)) { - llwarns << "Invalid type for xfer request: " << uuid << ":" - << type_s16 << " to " << mesgsys->getSender() << llendl; + LL_WARNS() << "Invalid type for xfer request: " << uuid << ":" + << type_s16 << " to " << mesgsys->getSender() << LL_ENDL; return; } - llinfos << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << LL_ENDL; if (! mVFS) { - llwarns << "Attempt to send VFile w/o available VFS" << llendl; + LL_WARNS() << "Attempt to send VFile w/o available VFS" << LL_ENDL; return; } @@ -845,7 +845,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } else if (!local_filename.empty()) @@ -868,7 +868,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user case LL_PATH_NONE: if(!validateFileForTransfer(local_filename)) { - llwarns << "SECURITY: Unapproved filename '" << local_filename << llendl; + LL_WARNS() << "SECURITY: Unapproved filename '" << local_filename << LL_ENDL; return; } break; @@ -876,13 +876,13 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user case LL_PATH_CACHE: if(!verify_cache_filename(local_filename)) { - llwarns << "SECURITY: Illegal cache filename '" << local_filename << llendl; + LL_WARNS() << "SECURITY: Illegal cache filename '" << local_filename << LL_ENDL; return; } break; default: - llwarns << "SECURITY: Restricted file dir enum: " << (U32)local_path << llendl; + LL_WARNS() << "SECURITY: Restricted file dir enum: " << (U32)local_path << LL_ENDL; return; } @@ -897,7 +897,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { expanded_filename = local_filename; } - llinfos << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << LL_ENDL; BOOL delete_local_on_completion = FALSE; mesgsys->getBOOL("XferID", "DeleteOnCompletion", delete_local_on_completion); @@ -913,15 +913,15 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } else { char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llinfos << "starting memory transfer: " + LL_INFOS() << "starting memory transfer: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << " to " - << mesgsys->getSender() << llendl; + << mesgsys->getSender() << LL_ENDL; xferp = findXfer(id, mSendList); @@ -931,7 +931,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llinfos << "Warning: " << U64_BUF << " not found." << llendl; + LL_INFOS() << "Warning: " << U64_BUF << " not found." << LL_ENDL; result = LL_ERR_FILE_NOT_FOUND; } } @@ -945,7 +945,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else // can happen with a memory transfer not found { - llinfos << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << llendl; + LL_INFOS() << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << LL_ENDL; mesgsys->newMessageFast(_PREHASH_AbortXfer); mesgsys->nextBlockFast(_PREHASH_XferID); @@ -959,18 +959,18 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { xferp->sendNextPacket(); changeNumActiveXfers(xferp->mRemoteHost,1); -// llinfos << "***STARTING XFER IMMEDIATELY***" << llendl; +// LL_INFOS() << "***STARTING XFER IMMEDIATELY***" << LL_ENDL; } else { if(xferp) { - llinfos << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << llendl; + LL_INFOS() << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << LL_ENDL; } else { - llwarns << "LLXferManager::processFileRequest() - no xfer found!" - << llendl; + LL_WARNS() << "LLXferManager::processFileRequest() - no xfer found!" + << LL_ENDL; } } } @@ -1016,7 +1016,7 @@ void LLXferManager::retransmitUnackedPackets () // if the circuit dies, abort if (! gMessageSystem->mCircuitInfo.isCircuitAlive( xferp->mRemoteHost )) { - llinfos << "Xfer found in progress on dead circuit, aborting" << llendl; + LL_INFOS() << "Xfer found in progress on dead circuit, aborting" << LL_ENDL; xferp->mCallbackResult = LL_ERR_CIRCUIT_GONE; xferp->processEOF(); delp = xferp; @@ -1038,7 +1038,7 @@ void LLXferManager::retransmitUnackedPackets () { if (xferp->mRetries > LL_PACKET_RETRY_LIMIT) { - llinfos << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << llendl; + LL_INFOS() << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << LL_ENDL; xferp->abort(LL_ERR_TCP_TIMEOUT); delp = xferp; xferp = xferp->mNext; @@ -1046,14 +1046,14 @@ void LLXferManager::retransmitUnackedPackets () } else { - llinfos << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << llendl; + LL_INFOS() << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << LL_ENDL; xferp->resendLastPacket(); xferp = xferp->mNext; } } else if ((xferp->mStatus == e_LL_XFER_REGISTERED) && ( (et = xferp->ACKTimer.getElapsedTimeF32()) > LL_XFER_REGISTRATION_TIMEOUT)) { - llinfos << "registered xfer never requested, xfer dropped" << llendl; + LL_INFOS() << "registered xfer never requested, xfer dropped" << LL_ENDL; xferp->abort(LL_ERR_TCP_TIMEOUT); delp = xferp; xferp = xferp->mNext; @@ -1061,17 +1061,17 @@ void LLXferManager::retransmitUnackedPackets () } else if (xferp->mStatus == e_LL_XFER_ABORTED) { - llwarns << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << llendl; + LL_WARNS() << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << LL_ENDL; delp = xferp; xferp = xferp->mNext; removeXfer(delp,&mSendList); } else if (xferp->mStatus == e_LL_XFER_PENDING) { -// llinfos << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << llendl; +// LL_INFOS() << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << LL_ENDL; if (numActiveXfers(xferp->mRemoteHost) < mMaxOutgoingXfersPerCircuit) { -// llinfos << "bumping pending xfer to active" << llendl; +// LL_INFOS() << "bumping pending xfer to active" << LL_ENDL; xferp->sendNextPacket(); changeNumActiveXfers(xferp->mRemoteHost,1); } @@ -1094,10 +1094,10 @@ void LLXferManager::retransmitUnackedPackets () { break; } - //llinfos << "Confirm packet queue length:" << mXferAckQueue.getLength() << llendl; + //LL_INFOS() << "Confirm packet queue length:" << mXferAckQueue.getLength() << LL_ENDL; LLXferAckInfo ack_info; mXferAckQueue.pop(ack_info); - //llinfos << "Sending confirm packet" << llendl; + //LL_INFOS() << "Sending confirm packet" << LL_ENDL; sendConfirmPacket(gMessageSystem, ack_info.mID, ack_info.mPacketNum, ack_info.mRemoteHost); mAckThrottle.throttleOverflow(1000.f*8.f); // Assume 1000 bytes/packet } @@ -1156,9 +1156,9 @@ void LLXferManager::startPendingDownloads() S32 start_count = mMaxIncomingXfers - download_count; - lldebugs << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: " + LL_DEBUGS() << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: " << download_count << " XFER_PENDING: " << pending_count - << " startring " << llmin(start_count, pending_count) << llendl; + << " startring " << llmin(start_count, pending_count) << LL_ENDL; if((start_count > 0) && (pending_count > 0)) { diff --git a/indra/llmessage/machine.cpp b/indra/llmessage/machine.cpp index 8d2f51203..1e9c9c3c9 100644 --- a/indra/llmessage/machine.cpp +++ b/indra/llmessage/machine.cpp @@ -33,7 +33,7 @@ void LLMachine::setMachinePort(S32 port) { if (port < 0) { - llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl; + LL_INFOS() << "Can't assign a negative number to LLMachine::mPort" << LL_ENDL; mHost.setPort(0); } else @@ -46,7 +46,7 @@ void LLMachine::setControlPort( S32 port ) { if (port < 0) { - llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl; + LL_INFOS() << "Can't assign a negative number to LLMachine::mControlPort" << LL_ENDL; mControlPort = 0; } else diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 8b2845ef6..34ff1036c 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -123,7 +123,7 @@ namespace { LL_WARNS("Messaging") << "error status " << mStatus << " for message " << mMessageName - << " reason " << mReason << llendl; + << " reason " << mReason << LL_ENDL; } // TODO: Map mStatus in to useful error code. if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_TCP_TIMEOUT); @@ -161,7 +161,7 @@ void LLMessageHandlerBridge::post(LLHTTPNode::ResponsePtr response, std::string name = context["request"]["wildcard"]["message-name"]; char* namePtr = LLMessageStringTable::getInstance()->getString(name.c_str()); - lldebugs << "Setting mLastSender " << input["sender"].asString() << llendl; + LL_DEBUGS() << "Setting mLastSender " << input["sender"].asString() << LL_ENDL; gMessageSystem->mLastSender = LLHost(input["sender"].asString()); gMessageSystem->mPacketsIn += 1; gMessageSystem->mLLSDMessageReader->setMessage(namePtr, input["body"]); @@ -291,7 +291,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mbError = TRUE; mErrorCode = error; } -// LL_DEBUGS("Messaging") << << "*** port: " << mPort << llendl; +// LL_DEBUGS("Messaging") << << "*** port: " << mPort << LL_ENDL; // // Create the data structure that we can poll on @@ -331,7 +331,7 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure { if(filename.empty()) { - LL_ERRS("Messaging") << "No template filename specified" << llendl; + LL_ERRS("Messaging") << "No template filename specified" << LL_ENDL; mbError = TRUE; return; } @@ -340,9 +340,9 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure if(!_read_file_into_string(template_body, filename)) { if (failure_is_fatal) { - LL_ERRS("Messaging") << "Failed to open template: " << filename << llendl; + LL_ERRS("Messaging") << "Failed to open template: " << filename << LL_ENDL; } else { - LL_WARNS("Messaging") << "Failed to open template: " << filename << llendl; + LL_WARNS("Messaging") << "Failed to open template: " << filename << LL_ENDL; } mbError = TRUE; return; @@ -571,7 +571,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // Ones that are non-zero but below the minimum packet size are worrisome. if (receive_size > 0) { - LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << llendl; + LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << LL_ENDL; callExceptionFunc(MX_PACKET_TOO_SHORT); } // no data in packet receive buffer @@ -597,7 +597,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // the next one LL_WARNS("Messaging") << "Malformed packet received. Packet size " << receive_size << " with invalid no. of acks " << acks - << llendl; + << LL_ENDL; valid_packet = FALSE; continue; } @@ -625,7 +625,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) memcpy(&mem_id, &mTrueReceiveBuffer[true_rcv_size], /* Flawfinder: ignore*/ sizeof(TPACKETID)); packet_id = ntohl(mem_id); - //LL_INFOS("Messaging") << "got ack: " << packet_id << llendl; + //LL_INFOS("Messaging") << "got ack: " << packet_id << LL_ENDL; cdp->ackReliablePacket(packet_id); } if (!cdp->getUnackedPacketCount()) @@ -657,14 +657,14 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // LL_WARNS("Messaging") << "DISCARDED PACKET HOST MISMATCH! HOST: " // << host << " CIRCUIT: " // << mCircuitInfo.mCurrentCircuit->mHost - // << llendl; + // << LL_ENDL; //} // *************************************** //mCircuitInfo.mCurrentCircuit->mAcks.put(mCurrentRecvPacketID); cdp->collectRAck(mCurrentRecvPacketID); } - LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << llendl; + LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << LL_ENDL; if(mVerboseLog) { std::ostringstream str; @@ -676,7 +676,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) << " resent " << ((acks > 0) ? "acks" : "") << " DISCARD DUPLICATE"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } mPacketsIn++; valid_packet = FALSE; @@ -755,7 +755,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) { if (mbProtected && (!cdp)) { - LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << llendl; + LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << LL_ENDL; mOffCircuitPackets++; } else @@ -825,7 +825,7 @@ void LLMessageSystem::processAcks() if (!mDenyTrustedCircuitSet.empty()) { - LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << llendl; + LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << LL_ENDL; for (host_set_t::iterator hostit = mDenyTrustedCircuitSet.begin(); hostit != mDenyTrustedCircuitSet.end(); ++hostit) { reallySendDenyTrustedCircuit(*hostit); @@ -899,7 +899,7 @@ LLSD LLMessageSystem::getBuiltMessageLLSD() const else { // TODO: implement as below? - llerrs << "Message not built as LLSD." << llendl; + LL_ERRS() << "Message not built as LLSD." << LL_ENDL; } return result; } @@ -1152,7 +1152,7 @@ LLFnPtrResponder* LLMessageSystem::createResponder(const std::string& name) // explicitly sent as reliable, so they don't have a callback // LL_WARNS("Messaging") << "LLMessageSystem::sendMessage: Sending unreliable " // << mMessageBuilder->getMessageName() << " message via HTTP" -// << llendl; +// << LL_ENDL; return new LLFnPtrResponder( NULL, NULL, @@ -1188,11 +1188,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) if(mVerboseLog) { LL_INFOS_ONCE("Messaging") << "MSG: -> " << host << "\tUNKNOWN CIRCUIT:\t" - << mMessageBuilder->getMessageName() << llendl; + << mMessageBuilder->getMessageName() << LL_ENDL; } LL_WARNS_ONCE("Messaging") << "sendMessage - Trying to send " << mMessageBuilder->getMessageName() << " on unknown circuit " - << host << llendl; + << host << LL_ENDL; return 0; } else @@ -1211,11 +1211,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) if(mVerboseLog) { LL_INFOS("Messaging") << "MSG: -> " << host << "\tDEAD CIRCUIT\t\t" - << mMessageBuilder->getMessageName() << llendl; + << mMessageBuilder->getMessageName() << LL_ENDL; } LL_WARNS("Messaging") << "sendMessage - Trying to send message " << mMessageBuilder->getMessageName() << " to dead circuit " - << host << llendl; + << host << LL_ENDL; return 0; } } @@ -1260,7 +1260,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) LL_WARNS("Messaging") << "sendMessage - Trying to send " << ((buffer_length > 4000) ? "EXTRA " : "") << "BIG message " << mMessageBuilder->getMessageName() << " - " - << buffer_length << llendl; + << buffer_length << LL_ENDL; } } if (mSendReliable) @@ -1322,7 +1322,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) // append_acout_count is incorrect or that // MAX_BUFFER_SIZE has fallen below MTU which is bad // and probably programmer error. - LL_ERRS("Messaging") << "Buffer packing failed due to size.." << llendl; + LL_ERRS("Messaging") << "Buffer packing failed due to size.." << LL_ENDL; } } @@ -1363,7 +1363,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) std::ostream_iterator append(str, " "); std::copy(acks.begin(), acks.end(), append); } - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } @@ -1387,7 +1387,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re << nullToEmpty(mMessageReader->getMessageName()) << (recv_reliable ? " reliable" : "") << " REJECTED"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } // nope! // cout << "Rejecting unexpected message " << mCurrentMessageTemplate->mName << " from " << hex << ip << " , " << dec << port << endl; @@ -1395,7 +1395,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re // Keep track of rejected messages as well if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { - LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; + LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL; } else { @@ -1414,7 +1414,7 @@ S32 LLMessageSystem::sendMessage( { if (!(host.isOk())) { - LL_WARNS("Messaging") << "trying to send message to invalid host" << llendl; + LL_WARNS("Messaging") << "trying to send message to invalid host" << LL_ENDL; return 0; } @@ -1432,14 +1432,14 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host ) LL_WARNS("Messaging") << "Received trusted message on untrusted circuit. " << "Will reply with deny. " << "Message: " << nullToEmpty(mMessageReader->getMessageName()) - << " Host: " << host << llendl; + << " Host: " << host << LL_ENDL; } if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { LL_WARNS("Messaging") << "got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" - << llendl; + << LL_ENDL; } else { @@ -1457,7 +1457,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r { if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { - LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; + LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL; } else { @@ -1486,7 +1486,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r << (recv_reliable ? " reliable" : "") << (recv_resent ? " resent" : "") << (recv_acks ? " acks" : ""); - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } } @@ -1496,54 +1496,54 @@ void LLMessageSystem::sanityCheck() // if (!mCurrentRMessageData) // { -// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << LL_ENDL; // } // if (!mCurrentRMessageTemplate) // { -// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << LL_ENDL; // } // if (!mCurrentRTemplateBlock) // { -// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << LL_ENDL; // } // if (!mCurrentRDataBlock) // { -// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << LL_ENDL; // } // if (!mCurrentSMessageData) // { -// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << LL_ENDL; // } // if (!mCurrentSMessageTemplate) // { -// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << LL_ENDL; // } // if (!mCurrentSTemplateBlock) // { -// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << LL_ENDL; // } // if (!mCurrentSDataBlock) // { -// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << LL_ENDL; // } } void LLMessageSystem::showCircuitInfo() { - LL_INFOS("Messaging") << mCircuitInfo << llendl; + LL_INFOS("Messaging") << mCircuitInfo << LL_ENDL; } void LLMessageSystem::dumpCircuitInfo() { - lldebugst(LLERR_CIRCUIT_INFO) << mCircuitInfo << llendl; + LL_DEBUGS("Messaging") << mCircuitInfo << LL_ENDL; } /* virtual */ @@ -1587,7 +1587,7 @@ void LLMessageSystem::enableCircuit(const LLHost &host, BOOL trusted) void LLMessageSystem::disableCircuit(const LLHost &host) { - LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << llendl; + LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << LL_ENDL; U32 code = gMessageSystem->findCircuitCode( host ); // Don't need to do this, as we're removing the circuit info anyway - djs 01/28/03 @@ -1600,7 +1600,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) code_session_map_t::iterator it = mCircuitCodes.find(code); if(it != mCircuitCodes.end()) { - LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << llendl; + LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << LL_ENDL; //mCircuitCodes.removeData(code); mCircuitCodes.erase(it); } @@ -1616,7 +1616,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) U32 old_port = (U32)(ip_port & (U64)0xFFFFFFFF); U32 old_ip = (U32)(ip_port >> 32); - LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << llendl; + LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << LL_ENDL; gMessageSystem->mIPPortToCircuitCode.erase(ip_port); } mCircuitInfo.removeCircuitData(host); @@ -1626,7 +1626,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) // Sigh, since we can open circuits which don't have circuit // codes, it's possible for this to happen... - LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << llendl; + LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << LL_ENDL; } } @@ -1657,7 +1657,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit) if (!host.isOk()) { - LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << llendl; + LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << LL_ENDL; return TRUE; } @@ -1668,7 +1668,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit) } else { - LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << llendl; + LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1679,7 +1679,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit) if (!host.isOk()) { - LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << llendl; + LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << LL_ENDL; return FALSE; } @@ -1690,7 +1690,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit) } else { - LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << llendl; + LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1704,7 +1704,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const LLHost &host) } else { - LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << llendl; + LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1861,18 +1861,18 @@ void LLMessageSystem::processAssignCircuitCode(LLMessageSystem* msg, void**) { LL_WARNS("Messaging") << "AssignCircuitCode, bad session id. Expecting " << msg->getMySessionID() << " but got " << session_id - << llendl; + << LL_ENDL; return; } U32 code; msg->getU32Fast(_PREHASH_CircuitCode, _PREHASH_Code, code); if (!code) { - LL_ERRS("Messaging") << "Assigning circuit code of zero!" << llendl; + LL_ERRS("Messaging") << "Assigning circuit code of zero!" << LL_ENDL; } msg->mOurCircuitCode = code; - LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << llendl; + LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << LL_ENDL; } */ @@ -1896,20 +1896,20 @@ bool LLMessageSystem::addCircuitCode(U32 code, const LLUUID& session_id) { if(!code) { - LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << llendl; + LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << LL_ENDL; return false; } code_session_map_t::iterator it = mCircuitCodes.find(code); if(it == mCircuitCodes.end()) { - LL_INFOS("Messaging") << "New circuit code " << code << " added" << llendl; + LL_INFOS("Messaging") << "New circuit code " << code << " added" << LL_ENDL; //msg->mCircuitCodes[circuit_code] = circuit_code; mCircuitCodes.insert(code_session_map_t::value_type(code, session_id)); } else { - LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << llendl; + LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << LL_ENDL; } return true; } @@ -1943,7 +1943,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, // Whoah, abort! We don't know anything about this circuit code. LL_WARNS("Messaging") << "UseCircuitCode for " << circuit_code_in << " received without AddCircuitCode message - aborting" - << llendl; + << LL_ENDL; return; } @@ -1955,7 +1955,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, { LL_WARNS("Messaging") << "UseCircuitCode unmatched session id. Got " << session_id << " but expected " << (*it).second - << llendl; + << LL_ENDL; return; } @@ -1968,7 +1968,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, if ((ip_port_old == ip_port_in) && (circuit_code_old == circuit_code_in)) { // Current information is the same as incoming info, ignore - LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << llendl; + LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << LL_ENDL; return; } @@ -1978,27 +1978,27 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, msg->mIPPortToCircuitCode.erase(ip_port_old); U32 old_port = (U32)(ip_port_old & (U64)0xFFFFFFFF); U32 old_ip = (U32)(ip_port_old >> 32); - LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << llendl; + LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << LL_ENDL; } if (circuit_code_old) { LLHost cur_host(ip, port); - LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << llendl; + LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << LL_ENDL; msg->disableCircuit(cur_host); if (circuit_code_old == circuit_code_in) { - LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << llendl; - LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << llendl; - LL_WARNS("Messaging") << "Permanently disabling circuit" << llendl; + LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << LL_ENDL; + LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << LL_ENDL; + LL_WARNS("Messaging") << "Permanently disabling circuit" << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Circuit code changed for " << msg->getSender() << " from " << circuit_code_old << " to " - << circuit_code_in << llendl; + << circuit_code_in << LL_ENDL; } } @@ -2040,7 +2040,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, LL_INFOS("Messaging") << "Circuit code " << circuit_code_in << " from " << msg->getSender() << " for agent " << id << " in session " - << session_id << llendl; + << session_id << LL_ENDL; const LLUseCircuitCodeResponder* responder = (const LLUseCircuitCodeResponder*) user; @@ -2051,7 +2051,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, } else { - LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << llendl; + LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << LL_ENDL; } } @@ -2073,7 +2073,7 @@ void LLMessageSystem::processError(LLMessageSystem* msg, void**) LL_WARNS("Messaging") << "Message error from " << msg->getSender() << " - " << error_code << " " << error_token << " " << error_id << " \"" - << error_system << "\" \"" << error_message << "\"" << llendl; + << error_system << "\" \"" << error_message << "\"" << LL_ENDL; } @@ -2109,7 +2109,7 @@ void LLMessageSystem::dispatch( gMessageSystem->mMessageTemplates.end()) && !LLMessageConfig::isValidMessage(msg_name)) { - LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << llendl; + LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << LL_ENDL; responsep->notFound("Invalid message name"); return; } @@ -2120,12 +2120,12 @@ void LLMessageSystem::dispatch( if (!handler) { LL_WARNS("Messaging") << "LLMessageService::dispatch > no handler for " - << path << llendl; + << path << LL_ENDL; return; } // enable this for output of message names - //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << llendl; - //lldebugs << "data: " << LLSDNotationStreamer(message) << llendl; + //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << LL_ENDL; + //LL_DEBUGS() << "data: " << LLSDNotationStreamer(message) << LL_ENDL; handler->post(responsep, context, message); } @@ -2243,7 +2243,7 @@ S32 LLMessageSystem::sendError( else { LL_WARNS("Messaging") << "Data and message were too large -- data removed." - << llendl; + << LL_ENDL; addBinaryData("Data", NULL, 0); } return sendReliable(host); @@ -2263,7 +2263,7 @@ void process_packet_ack(LLMessageSystem *msgsystem, void** /*user_data*/) for (S32 i = 0; i < ack_count; i++) { msgsystem->getU32Fast(_PREHASH_Packets, _PREHASH_ID, packet_id, i); -// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << llendl; +// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << LL_ENDL; cdp->ackReliablePacket(packet_id); } if (!cdp->getUnackedPacketCount()) @@ -2284,12 +2284,12 @@ void process_log_messages(LLMessageSystem* msg, void**) if (log_message) { - LL_INFOS("Messaging") << "Starting logging via message" << llendl; + LL_INFOS("Messaging") << "Starting logging via message" << LL_ENDL; msg->startLogging(); } else { - LL_INFOS("Messaging") << "Stopping logging via message" << llendl; + LL_INFOS("Messaging") << "Stopping logging via message" << LL_ENDL; msg->stopLogging(); } }*/ @@ -2309,7 +2309,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if (!cdp) { LL_WARNS("Messaging") << "Attempt to create trusted circuit without circuit data: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } @@ -2328,13 +2328,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if( msg->getBlockUntrustedInterface() ) { LL_WARNS("Messaging") << "Ignoring CreateTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Processing CreateTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; } } @@ -2350,7 +2350,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if(msg->isMatchingDigestForWindowAndUUIDs(their_digest, TRUST_TIME_WINDOW, local_id, remote_id)) { cdp->setTrusted(TRUE); - LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << llendl; + LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << LL_ENDL; return; } else if (cdp->getTrusted()) @@ -2360,13 +2360,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) // the message system is being slow. Don't bother sending the deny, as it may continually // ping-pong back and forth on a very hosed circuit. LL_WARNS("Messaging") << "Ignoring bad digest from known trusted circuit: " << their_digest - << " host: " << msg->getSender() << llendl; + << " host: " << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Bad digest from known circuit: " << their_digest - << " host: " << msg->getSender() << llendl; + << " host: " << msg->getSender() << LL_ENDL; msg->sendDenyTrustedCircuit(msg->getSender()); return; } @@ -2402,13 +2402,13 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **) if( msg->getBlockUntrustedInterface() ) { LL_WARNS("Messaging") << "Ignoring DenyTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Processing DenyTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; } } @@ -2421,7 +2421,7 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **) // *TODO: probably should keep a count of number of resends // per circuit, and stop resending after a while. LL_INFOS("Messaging") << "Got DenyTrustedCircuit. Sending CreateTrustedCircuit to " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; msg->sendCreateTrustedCircuit(msg->getSender(), local_id, remote_id); } @@ -2537,11 +2537,11 @@ bool start_messaging_system( if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber) { LL_INFOS("AppInit") << "Message template version does not match prehash version number" << LL_ENDL; - LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << llendl; + LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << LL_ENDL; } else { - LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << llendl; + LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << LL_ENDL; } } @@ -2587,7 +2587,7 @@ void LLMessageSystem::startLogging() str << "\t<-\tincoming message" <\toutgoing message" << std::endl; str << " <> host size zero id name"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } void LLMessageSystem::stopLogging() @@ -2595,7 +2595,7 @@ void LLMessageSystem::stopLogging() if(mVerboseLog) { mVerboseLog = FALSE; - LL_INFOS("Messaging") << "END MESSAGE LOG" << llendl; + LL_INFOS("Messaging") << "END MESSAGE LOG" << LL_ENDL; } } @@ -2703,7 +2703,7 @@ void end_messaging_system(bool print_summary) { std::ostringstream str; gMessageSystem->summarizeLogs(str); - LL_INFOS("Messaging") << str.str().c_str() << llendl; + LL_INFOS("Messaging") << str.str().c_str() << LL_ENDL; } delete gMessageSystem; @@ -2756,7 +2756,7 @@ void LLMessageSystem::dumpReceiveCounts() if(mNumMessageCounts > 0) { - LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << llendl; + LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " m essages processed in " << mReceiveTime << " seconds" << LL_ENDL; for (message_template_name_map_t::const_iterator iter = mMessageTemplates.begin(), end = mMessageTemplates.end(); iter != end; iter++) @@ -2765,7 +2765,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << LL_ENDL; } } } @@ -2882,7 +2882,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) if ((*data_size ) < LL_MINIMUM_VALID_PACKET_SIZE) { LL_WARNS("Messaging") << "zeroCodeExpand() called with data_size of " << *data_size - << llendl; + << LL_ENDL; } mTotalBytesIn += *data_size; @@ -2921,7 +2921,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) { if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-1])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; break; @@ -2933,7 +2933,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) *outptr++ = *inptr++; if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-256])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; count = -1; @@ -2952,7 +2952,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) { if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-(*inptr)])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; } @@ -2976,7 +2976,7 @@ void LLMessageSystem::addTemplate(LLMessageTemplate *templatep) if (mMessageTemplates.count(templatep->mName) > 0) { LL_ERRS("Messaging") << templatep->mName << " already used as a template name!" - << llendl; + << LL_ENDL; } mMessageTemplates[templatep->mName] = templatep; mMessageNumbers[templatep->mMessageNumber] = templatep; @@ -2992,7 +2992,7 @@ void LLMessageSystem::setHandlerFuncFast(const char *name, void (*handler_func)( } else { - LL_ERRS("Messaging") << name << " is not a known message name!" << llendl; + LL_ERRS("Messaging") << name << " is not a known message name!" << LL_ENDL; } } @@ -3005,7 +3005,7 @@ bool LLMessageSystem::callHandler(const char *name, if(iter == mMessageTemplates.end()) { LL_WARNS("Messaging") << "LLMessageSystem::callHandler: unknown message " - << name << llendl; + << name << LL_ENDL; return false; } @@ -3016,7 +3016,7 @@ bool LLMessageSystem::callHandler(const char *name, << name << " from " << (trustedSource ? "trusted " : "untrusted ") - << "source" << llendl; + << "source" << LL_ENDL; return false; } @@ -3042,12 +3042,23 @@ void LLMessageSystem::setExceptionFunc(EMessageException e, BOOL LLMessageSystem::callExceptionFunc(EMessageException exception) { callbacks_t::iterator it = mExceptionCallbacks.find(exception); - if(it != mExceptionCallbacks.end()) + if(it == mExceptionCallbacks.end()) { - ((*it).second.first)(this, (*it).second.second,exception); - return TRUE; + return FALSE; } - return FALSE; + + exception_t& ex = it->second; + msg_exception_callback ex_cb = ex.first; + + if (!ex_cb) + { + LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << LL_ENDL; + return FALSE; + } + + (ex_cb)(this, ex.second, exception); + + return TRUE; } void LLMessageSystem::setTimingFunc(msg_timing_callback func, void* data) @@ -3152,7 +3163,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << LL_ENDL; } U32 now = (U32)time(NULL); @@ -3171,7 +3182,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << LL_ENDL; } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ @@ -3218,7 +3229,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << LL_ENDL; } U32 now = (U32)time(NULL); @@ -3237,7 +3248,7 @@ bool LLMessageSystem::isMatchingDigestForWindow(const char* digest, S32 const wi std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << LL_ENDL; } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ @@ -3271,12 +3282,12 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID char digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ if (id1.isNull()) { - LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << llendl; + LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << LL_ENDL; return; } if (id2.isNull()) { - LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << llendl; + LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << LL_ENDL; return; } generateDigestForWindowAndUUIDs(digest, TRUST_TIME_WINDOW, id1, id2); @@ -3284,7 +3295,7 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID nextBlockFast(_PREHASH_DataBlock); addUUIDFast(_PREHASH_EndPointID, id1); addBinaryDataFast(_PREHASH_Digest, digest, MD5HEX_STR_BYTES); - LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << llendl; + LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << LL_ENDL; sendMessage(host); } @@ -3298,10 +3309,10 @@ void LLMessageSystem::reallySendDenyTrustedCircuit(const LLHost &host) LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (!cdp) { - LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << llendl; + LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << LL_ENDL; return; } - LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << llendl; + LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << LL_ENDL; newMessageFast(_PREHASH_DenyTrustedCircuit); nextBlockFast(_PREHASH_DataBlock); addUUIDFast(_PREHASH_EndPointID, cdp->getLocalEndPointID()); @@ -3322,7 +3333,7 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << LL_ENDL; } LLTimer timeout; @@ -3374,8 +3385,8 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ void LLMessageSystem::dumpPacketToLog() { - LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing->getLastSender() << llendl; - LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl; + LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing->getLastSender() << LL_ENDL; + LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << LL_ENDL; char line_buffer[256]; /* Flawfinder: ignore */ S32 i; S32 cur_line_pos = 0; @@ -3390,13 +3401,13 @@ void LLMessageSystem::dumpPacketToLog() if (cur_line_pos >= 16) { cur_line_pos = 0; - LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl; + LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL; cur_line++; } } if (cur_line_pos) { - LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl; + LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL; } } @@ -3940,7 +3951,7 @@ void LLMessageSystem::getStringFast(const char *block, const char *var, { if(buffer_size <= 0) { - LL_WARNS("Messaging") << "buffer_size <= 0" << llendl; + LL_WARNS("Messaging") << "buffer_size <= 0" << LL_ENDL; } mMessageReader->getString(block, var, buffer_size, s, blocknum); } @@ -4049,7 +4060,7 @@ void LLMessageSystem::banUdpMessage(const std::string& name) } else { - llwarns << "Attempted to ban an unknown message: " << name << "." << llendl; + LL_WARNS() << "Attempted to ban an unknown message: " << name << "." << LL_ENDL; } } const LLHost& LLMessageSystem::getSender() const diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index fff0c6f85..ced674700 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -45,7 +45,7 @@ #include "llerror.h" #include "net.h" -#include "string_table.h" +#include "llstringtable.h" #include "llcircuit.h" #include "lltimer.h" //#include "llpacketring.h" @@ -896,7 +896,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_S16: if (n != 2) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 1) = *(ct); @@ -911,7 +911,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_F32: if (n != 4) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 3) = *(ct); @@ -928,7 +928,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_F64: if (n != 8) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 7) = *(ct); @@ -948,7 +948,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLQuaternion: // We only send x, y, z and infer w (we set x, y, z to ensure that w >= 0) if (n != 12) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 8, ct + 8, MVT_F32, 4); @@ -961,7 +961,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLVector3d: if (n != 24) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 16, ct + 16, MVT_F64, 8); @@ -974,7 +974,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLVector4: if (n != 16) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 12, ct + 12, MVT_F32, 4); @@ -988,7 +988,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_U16Vec3: if (n != 6) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 4, ct + 4, MVT_U16, 2); @@ -1001,7 +1001,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_U16Quat: if (n != 8) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 6, ct + 6, MVT_U16, 2); @@ -1015,7 +1015,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_S16Array: if (n % 2) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN length = n % 2; diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp index dd063fcb8..e4f5fb3a3 100644 --- a/indra/llmessage/message_string_table.cpp +++ b/indra/llmessage/message_string_table.cpp @@ -80,10 +80,10 @@ char* LLMessageStringTable::getString(const char *str) if (mUsed >= MESSAGE_NUMBER_OF_HASH_BUCKETS - 1) { U32 i; - llinfos << "Dumping string table before crashing on HashTable full!" << llendl; + LL_INFOS() << "Dumping string table before crashing on HashTable full!" << LL_ENDL; for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { - llinfos << "Entry #" << i << ": " << mString[i] << llendl; + LL_INFOS() << "Entry #" << i << ": " << mString[i] << LL_ENDL; } } return mString[hash_value]; diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index f2b7a3d8c..396f946b4 100644 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -175,7 +175,7 @@ U32 ip_string_to_u32(const char* ip_string) if (ip == INADDR_NONE && strncmp(ip_string, BROADCAST_ADDRESS_STRING, MAXADDRSTR) != 0) { - llwarns << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << llendl; + LL_WARNS() << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << LL_ENDL; return INVALID_HOST_IP_ADDRESS; } return ip; @@ -334,7 +334,7 @@ S32 receive_packet(int hSocket, char * receiveBuffer) return 0; if (WSAECONNRESET == WSAGetLastError()) return 0; - llinfos << "receivePacket() failed, Error: " << WSAGetLastError() << llendl; + LL_INFOS() << "receivePacket() failed, Error: " << WSAGetLastError() << LL_ENDL; } return nRet; @@ -368,7 +368,7 @@ BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, i { return TRUE; } - llinfos << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort + LL_INFOS() << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort << ", Error " << last_error << LL_ENDL; } } @@ -397,7 +397,7 @@ S32 start_net(S32& socket_out, int& nPort) hSocket = socket(AF_INET, SOCK_DGRAM, 0); if (hSocket < 0) { - llwarns << "socket() failed" << llendl; + LL_WARNS() << "socket() failed" << LL_ENDL; return 1; } @@ -408,11 +408,11 @@ S32 start_net(S32& socket_out, int& nPort) stLclAddr.sin_family = AF_INET; stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY); stLclAddr.sin_port = htons(0); - llinfos << "attempting to connect on OS assigned port" << llendl; + LL_INFOS() << "attempting to connect on OS assigned port" << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (nRet < 0) { - llwarns << "Failed to bind on an OS assigned port error: " + LL_WARNS() << "Failed to bind on an OS assigned port error: " << nRet << LL_ENDL; } else @@ -420,9 +420,9 @@ S32 start_net(S32& socket_out, int& nPort) sockaddr_in socket_info; socklen_t len = sizeof(sockaddr_in); int err = getsockname(hSocket, (sockaddr*)&socket_info, &len); - llinfos << "Get socket returned: " << err << " length " << len << llendl; + LL_INFOS() << "Get socket returned: " << err << " length " << len << LL_ENDL; nPort = ntohs(socket_info.sin_port); - llinfos << "Assigned port: " << nPort << llendl; + LL_INFOS() << "Assigned port: " << nPort << LL_ENDL; } } @@ -433,7 +433,7 @@ S32 start_net(S32& socket_out, int& nPort) stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY); stLclAddr.sin_port = htons(nPort); U32 attempt_port = nPort; - llinfos << "attempting to connect on port " << attempt_port << llendl; + LL_INFOS() << "attempting to connect on port " << attempt_port << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (nRet < 0) @@ -447,7 +447,7 @@ S32 start_net(S32& socket_out, int& nPort) attempt_port++) { stLclAddr.sin_port = htons(attempt_port); - llinfos << "trying port " << attempt_port << llendl; + LL_INFOS() << "trying port " << attempt_port << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (!((nRet < 0) && (errno == EADDRINUSE))) { @@ -456,7 +456,7 @@ S32 start_net(S32& socket_out, int& nPort) } if (nRet < 0) { - llwarns << "startNet() : Couldn't find available network port." << llendl; + LL_WARNS() << "startNet() : Couldn't find available network port." << LL_ENDL; // Fail gracefully in release. return 3; } @@ -464,12 +464,12 @@ S32 start_net(S32& socket_out, int& nPort) // Some other socket error else { - llwarns << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << llendl; + LL_WARNS() << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << LL_ENDL; // Fail gracefully in release. return 4; } } - llinfos << "connected on port " << attempt_port << llendl; + LL_INFOS() << "connected on port " << attempt_port << LL_ENDL; nPort = attempt_port; } // Set socket to be non-blocking @@ -478,18 +478,18 @@ S32 start_net(S32& socket_out, int& nPort) nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size); if (nRet) { - llinfos << "Can't set receive size!" << llendl; + LL_INFOS() << "Can't set receive size!" << LL_ENDL; } nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size); if (nRet) { - llinfos << "Can't set send size!" << llendl; + LL_INFOS() << "Can't set send size!" << LL_ENDL; } getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size); getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size); - llinfos << "startNet - receive buffer size : " << rec_size << llendl; - llinfos << "startNet - send buffer size : " << snd_size << llendl; + LL_INFOS() << "startNet - receive buffer size : " << rec_size << LL_ENDL; + LL_INFOS() << "startNet - send buffer size : " << snd_size << LL_ENDL; #if LL_LINUX // Turn on recipient address tracking @@ -497,11 +497,11 @@ S32 start_net(S32& socket_out, int& nPort) int use_pktinfo = 1; if( setsockopt( hSocket, SOL_IP, IP_PKTINFO, &use_pktinfo, sizeof(use_pktinfo) ) == -1 ) { - llwarns << "No IP_PKTINFO available" << llendl; + LL_WARNS() << "No IP_PKTINFO available" << LL_ENDL; } else { - llinfos << "IP_PKKTINFO enabled" << llendl; + LL_INFOS() << "IP_PKKTINFO enabled" << LL_ENDL; } } #endif @@ -629,22 +629,22 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, if (errno == EAGAIN) { // say nothing, just repeat send - llinfos << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = TRUE; } else if (errno == ECONNREFUSED) { // response to ICMP connection refused message on earlier send - llinfos << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = TRUE; } else { // some other error - llinfos << "sendto() failed: " << errno << ", " << strerror(errno) << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() failed: " << errno << ", " << strerror(errno) << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = FALSE; } } @@ -653,7 +653,7 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, if (send_attempts >= 3) { - llinfos << "sendPacket() bailed out of send!" << llendl; + LL_INFOS() << "sendPacket() bailed out of send!" << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp index ad2161425..4871e0d95 100644 --- a/indra/llmessage/partsyspacket.cpp +++ b/indra/llmessage/partsyspacket.cpp @@ -1272,7 +1272,7 @@ BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed) } else { - llerrs << "NULL input data or number of bytes exceed mData size" << llendl; + LL_ERRS() << "NULL input data or number of bytes exceed mData size" << LL_ENDL; return FALSE; } } diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index 3bcd70944..5047b5e79 100644 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -88,7 +88,7 @@ void code_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, S32 *patch) if ( (wbits > 17) ||(wbits < 2)) { - llerrs << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << llendl; + LL_ERRS() << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << LL_ENDL; } ph->quant_wbits |= (wbits - 2); @@ -135,7 +135,7 @@ void code_patch(LLBitPack &bitpack, S32 *patch, S32 postquant) if ( (postquant > patch_size*patch_size) ||(postquant < 0)) { - llerrs << "Bad postquant in code_patch!" << llendl; + LL_ERRS() << "Bad postquant in code_patch!" << LL_ENDL; } if (postquant) diff --git a/indra/llmessage/tests/llmime_test.cpp b/indra/llmessage/tests/llmime_test.cpp index aed5c4589..ea48561ae 100644 --- a/indra/llmessage/tests/llmime_test.cpp +++ b/indra/llmessage/tests/llmime_test.cpp @@ -83,8 +83,8 @@ namespace tut headers["Content-Length"] = MULTI_CONTENT_LENGTH; headers["Content-Type"] = MULTI_CONTENT_TYPE; LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET); - llinfos << "headers: " << LLSDOStreamer(headers) - << llendl; + LL_INFOS() << "headers: " << LLSDOStreamer(headers) + << LL_ENDL; const S32 META_CONTENT_LENGTH = 700; diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index 283ba356f..199769e9b 100644 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -402,7 +402,7 @@ void LLPluginCookieStore::writeChangedCookies(std::ostream& s, bool clear_change { if(mHasChangedCookies) { - lldebugs << "returning changed cookies: " << llendl; + LL_DEBUGS() << "returning changed cookies: " << LL_ENDL; cookie_map_t::iterator iter; for(iter = mCookies.begin(); iter != mCookies.end(); ) { @@ -414,7 +414,7 @@ void LLPluginCookieStore::writeChangedCookies(std::ostream& s, bool clear_change { s << iter->second->getCookie() << "\n"; - lldebugs << " " << iter->second->getCookie() << llendl; + LL_DEBUGS() << " " << iter->second->getCookie() << LL_ENDL; // If requested, clear the changed mark if(clear_changed) diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index cbe3f1226..655d3b35f 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -230,7 +230,7 @@ bool LLPluginMessagePipe::pumpOutput(bool flush) else if(APR_STATUS_IS_EOF(status)) { // This is what we normally expect when a plugin exits. - llinfos << "Got EOF from plugin socket. " << llendl; + LL_INFOS() << "Got EOF from plugin socket. " << LL_ENDL; if(mOwner) { diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 13c1d3c4e..dc57862d8 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -185,7 +185,7 @@ bool LLPluginProcessParent::accept() if(status == APR_SUCCESS) { -// llinfos << "SUCCESS" << llendl; +// LL_INFOS() << "SUCCESS" << LL_ENDL; // Success. Create a message pipe on the new socket new LLPluginMessagePipe(this, mSocket); diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index cc6329e17..57ceb3e11 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -69,7 +69,7 @@ template T getMaterialField(const LLSD& data, const std::string& fie { return (T)data[field]; } - llerrs << "Missing or mistyped field '" << field << "' in material definition" << llendl; + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; return (T)LLSD(); } @@ -80,7 +80,7 @@ template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, c { return data[field].asUUID(); } - llerrs << "Missing or mistyped field '" << field << "' in material definition" << llendl; + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; return LLUUID::null; } diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index 86da1fbf4..2e4781377 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -558,14 +558,14 @@ LLUUID LLMaterialTable::getCollisionSoundUUID(U8 mcode, U8 mcode2) mcode &= LL_MCODE_MASK; mcode2 &= LL_MCODE_MASK; - //llinfos << "code 1: " << ((U32) mcode) << " code 2:" << ((U32) mcode2) << llendl; + //LL_INFOS() << "code 1: " << ((U32) mcode) << " code 2:" << ((U32) mcode2) << LL_ENDL; if (mCollisionSoundMatrix && (mcode < LL_MCODE_END) && (mcode2 < LL_MCODE_END)) { return(mCollisionSoundMatrix[mcode * LL_MCODE_END + mcode2]); } else { - //llinfos << "Null Sound" << llendl; + //LL_INFOS() << "Null Sound" << LL_ENDL; return(SND_NULL); } } diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 911d461f7..27bb606ff 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -169,13 +169,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source) || !pos_source ) { - llwarns << "Could not find dom sources for basic geo data; invalid model." << llendl; + LL_WARNS() << "Could not find dom sources for basic geo data; invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } if (!pos_source) { - llwarns << "Unable to process mesh without position data; invalid model; invalid model." << llendl; + LL_WARNS() << "Unable to process mesh without position data; invalid model; invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -196,7 +196,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (vertex_count == 0) { - llwarns << "Unable to process mesh with empty position array; invalid model." << llendl; + LL_WARNS() << "Unable to process mesh with empty position array; invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -213,7 +213,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (((i + pos_offset) > index_count) || ((idx[i+pos_offset]*3+2) > vertex_count)) { - llwarns << "Out of range index data; invalid model." << llendl; + LL_WARNS() << "Out of range index data; invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -223,7 +223,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (!cv.getPosition().isFinite3()) { - llwarns << "Nan positional data, invalid model." << llendl; + LL_WARNS() << "Nan positional data, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -236,7 +236,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (((i + tc_offset) > index_count) || ((idx[i+tc_offset]*2+1) > tc_count)) { - llwarns << "Out of range TC indices." << llendl; + LL_WARNS() << "Out of range TC indices." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -245,7 +245,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (!cv.mTexCoord.isFinite()) { - llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -257,7 +257,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (((i + norm_offset) > index_count) || ((idx[i+norm_offset]*3+2) > norm_count)) { - llwarns << "Found out of range norm indices, invalid model." << llendl; + LL_WARNS() << "Found out of range norm indices, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -267,7 +267,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa if (!cv.getNormal().isFinite3()) { - llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -296,7 +296,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector& fa verts.push_back(cv); if (verts.size() >= 65535) { - //llerrs << "Attempted to write model exceeding 16-bit index buffer limitation." << llendl; + //LL_ERRS() << "Attempted to write model exceeding 16-bit index buffer limitation." << LL_ENDL; return LLModel::VERTEX_NUMBER_OVERFLOW ; } U16 index = (U16) (verts.size()-1); @@ -396,7 +396,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source)) { - llwarns << "Could not get DOM sources for basic geo data, invalid model." << llendl; + LL_WARNS() << "Could not get DOM sources for basic geo data, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -450,7 +450,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (((cur_idx + pos_offset) > index_count) || ((idx[cur_idx+pos_offset]*3+2) > vertex_count)) { - llwarns << "Out of range position indices, invalid model." << llendl; + LL_WARNS() << "Out of range position indices, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -460,7 +460,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (!cv.getPosition().isFinite3()) { - llwarns << "Found NaN while loading positions from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading positions from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -473,7 +473,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (((cur_idx + tc_offset) > index_count) || ((idx[cur_idx+tc_offset]*2+1) > tc_count)) { - llwarns << "Out of range TC indices, invalid model." << llendl; + LL_WARNS() << "Out of range TC indices, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -482,7 +482,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (!cv.mTexCoord.isFinite()) { - llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -494,7 +494,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (((cur_idx + norm_offset) > index_count) || ((idx[cur_idx+norm_offset]*3+2) > norm_count)) { - llwarns << "Out of range norm indices, invalid model." << llendl; + LL_WARNS() << "Out of range norm indices, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } @@ -504,7 +504,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac if (!cv.getNormal().isFinite3()) { - llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -552,7 +552,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector& fac verts.push_back(cv); if (verts.size() >= 65535) { - //llerrs << "Attempted to write model exceeding 16-bit index buffer limitation." << llendl; + //LL_ERRS() << "Attempted to write model exceeding 16-bit index buffer limitation." << LL_ENDL; return LLModel::VERTEX_NUMBER_OVERFLOW ; } U16 index = (U16) (verts.size()-1); @@ -673,7 +673,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac domVertices* vertices = (domVertices*) elem.cast(); if (!vertices) { - llwarns << "Could not find vertex source, invalid model." << llendl; + LL_WARNS() << "Could not find vertex source, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } domInputLocal_Array& v_inp = vertices->getInput_array(); @@ -687,7 +687,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac domSource* src = (domSource*) elem.cast(); if (!src) { - llwarns << "Could not find DOM source, invalid model." << llendl; + LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } v = &(src->getFloat_array()->getValue()); @@ -703,7 +703,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac domSource* src = (domSource*) elem.cast(); if (!src) { - llwarns << "Could not find DOM source, invalid model." << llendl; + LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } n = &(src->getFloat_array()->getValue()); @@ -716,7 +716,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac domSource* src = (domSource*) elem.cast(); if (!src) { - llwarns << "Could not find DOM source, invalid model." << llendl; + LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } t = &(src->getFloat_array()->getValue()); @@ -754,7 +754,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac if (!vert.getPosition().isFinite3()) { - llwarns << "Found NaN while loading position data from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading position data from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -772,7 +772,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac if (!vert.getNormal().isFinite3()) { - llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -791,7 +791,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac if (!vert.mTexCoord.isFinite()) { - llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL; return LLModel::BAD_ELEMENT; } } @@ -890,12 +890,12 @@ std::string LLModel::getStatusString(U32 status) { if(status_strings[status] == std::string()) { - llerrs << "No valid status string for this status: " << (U32)status << llendl ; + LL_ERRS() << "No valid status string for this status: " << (U32)status << LL_ENDL ; } return status_strings[status] ; } - llerrs << "Invalid model status: " << (U32)status << llendl ; + LL_ERRS() << "Invalid model status: " << (U32)status << LL_ENDL ; return std::string() ; } @@ -971,7 +971,7 @@ BOOL LLModel::createVolumeFacesFromDomMesh(domMesh* mesh) } else { - llwarns << "no mesh found" << llendl; + LL_WARNS() << "no mesh found" << LL_ENDL; } return FALSE; @@ -1267,14 +1267,14 @@ void LLModel::addFace(const LLVolumeFace& face) { if (face.mNumVertices == 0) { - llerrs << "Cannot add empty face." << llendl; + LL_ERRS() << "Cannot add empty face." << LL_ENDL; } mVolumeFaces.push_back(face); if (mVolumeFaces.size() > MAX_MODEL_FACES) { - llerrs << "Model prims cannot have more than " << MAX_MODEL_FACES << " faces!" << llendl; + LL_ERRS() << "Model prims cannot have more than " << MAX_MODEL_FACES << " faces!" << LL_ENDL; } } @@ -1296,7 +1296,7 @@ void LLModel::generateNormals(F32 angle_cutoff) if (vol_face.mNumIndices > 65535) { - llwarns << "Too many vertices for normal generation to work." << llendl; + LL_WARNS() << "Too many vertices for normal generation to work." << LL_ENDL; continue; } @@ -1896,7 +1896,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) { if ((iter->first - pos).magVec() > 0.1f) { - llerrs << "Couldn't find weight list." << llendl; + LL_ERRS() << "Couldn't find weight list." << LL_ENDL; } return iter->second; @@ -2001,7 +2001,7 @@ bool LLModel::loadModel(std::istream& is) { if (!LLSDSerialize::fromBinary(header, is, 1024*1024*1024)) { - llwarns << "Mesh header parse error. Not a valid mesh asset!" << llendl; + LL_WARNS() << "Mesh header parse error. Not a valid mesh asset!" << LL_ENDL; return false; } } @@ -2031,7 +2031,7 @@ bool LLModel::loadModel(std::istream& is) if (header[nm[lod]]["offset"].asInteger() == -1 || header[nm[lod]]["size"].asInteger() == 0 ) { //cannot load requested LOD - llwarns << "LoD data is invalid!" << llendl; + LL_WARNS() << "LoD data is invalid!" << LL_ENDL; return false; } @@ -2094,7 +2094,7 @@ bool LLModel::loadModel(std::istream& is) } else { - llwarns << "unpackVolumeFaces failed!" << llendl; + LL_WARNS() << "unpackVolumeFaces failed!" << LL_ENDL; } return false; @@ -2112,7 +2112,7 @@ bool LLModel::isMaterialListSubset( LLModel* ref ) for (S32 dst = 0; dst < refCnt; ++dst) { - //llinfos<mMaterialList[dst]<mMaterialList[dst]<mMaterialList[dst]; if ( foundRef ) @@ -2157,7 +2157,7 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn bool isASubset = isMaterialListSubset( ref ); if ( !isASubset ) { - llinfos<<"Material of model is not a subset of reference."< p.size()) { - llerrs << "Index out of bounds" << llendl; + LL_ERRS() << "Index out of bounds" << LL_ENDL; } } } @@ -2629,7 +2629,7 @@ void LLModel::Decomposition::merge(const LLModel::Decomposition* rhs) if (mMeshID != rhs->mMeshID) { - llerrs << "Attempted to merge with decomposition of some other mesh." << llendl; + LL_ERRS() << "Attempted to merge with decomposition of some other mesh." << LL_ENDL; } if (mBaseHull.empty()) diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 44a517af3..e9c804b26 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -127,7 +127,7 @@ void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager ) { if ( !volume_manager || sVolumeManager ) { - llerrs << "LLPrimitive::sVolumeManager attempting to be set to NULL or it already has been set." << llendl; + LL_ERRS() << "LLPrimitive::sVolumeManager attempting to be set to NULL or it already has been set." << LL_ENDL; } sVolumeManager = volume_manager; } @@ -197,7 +197,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) } else { - llerrs << "primitive allocation failed" << llendl; + LL_ERRS() << "primitive allocation failed" << LL_ENDL; } return retval; @@ -477,7 +477,7 @@ LLPCode LLPrimitive::legacyToPCode(const U8 legacy) pcode = LL_PCODE_TREE_NEW; break; default: - llwarns << "Unknown legacy code " << legacy << " [" << (S32)legacy << "]!" << llendl; + LL_WARNS() << "Unknown legacy code " << legacy << " [" << (S32)legacy << "]!" << LL_ENDL; } return pcode; @@ -572,7 +572,7 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode) legacy = TREE_NEW; break; default: - llwarns << "Unknown pcode " << (S32)pcode << ":" << pcode << "!" << llendl; + LL_WARNS() << "Unknown pcode " << (S32)pcode << ":" << pcode << "!" << LL_ENDL; return 0; } return legacy; @@ -659,7 +659,7 @@ std::string LLPrimitive::pCodeToString(const LLPCode pcode) } else { - llwarns << "Unknown base mask for pcode: " << base_code << llendl; + LL_WARNS() << "Unknown base mask for pcode: " << base_code << LL_ENDL; } U8 mask_code = pcode & (~LL_PCODE_BASE_MASK); @@ -695,7 +695,7 @@ void LLPrimitive::copyTEs(const LLPrimitive *primitivep) U32 i; if (primitivep->getExpectedNumTEs() != getExpectedNumTEs()) { - llwarns << "Primitives don't have same expected number of TE's" << llendl; + LL_WARNS() << "Primitives don't have same expected number of TE's" << LL_ENDL; } U32 num_tes = llmin(primitivep->getExpectedNumTEs(), getExpectedNumTEs()); if (mTextureList.size() < getExpectedNumTEs()) @@ -797,7 +797,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai { S32 te_index = face_index_from_id(cur_mask, old_faces); old_tes.copyTexture(face_bit, *(getTE(te_index))); - //llinfos << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << llendl; + //LL_INFOS() << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << LL_ENDL; } } @@ -817,7 +817,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai if (mVolumep->getNumFaces() == 0 && new_face_mask != 0) { - llwarns << "Object with 0 faces found...INCORRECT!" << llendl; + LL_WARNS() << "Object with 0 faces found...INCORRECT!" << LL_ENDL; setNumTEs(mVolumep->getNumFaces()); return TRUE; } @@ -875,7 +875,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai } if (i == 4) { - llwarns << "No path end or outer face in volume!" << llendl; + LL_WARNS() << "No path end or outer face in volume!" << LL_ENDL; } continue; } @@ -911,7 +911,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai } if (i == 4) { - llwarns << "No path end or outer face in volume!" << llendl; + LL_WARNS() << "No path end or outer face in volume!" << LL_ENDL; } continue; } @@ -937,8 +937,8 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai } if (-1 == min_outer_bit) { - llinfos << (LLVolume *)mVolumep << llendl; - llwarns << "Bad! No outer faces, impossible!" << llendl; + LL_INFOS() << (LLVolume *)mVolumep << LL_ENDL; + LL_WARNS() << "Bad! No outer faces, impossible!" << LL_ENDL; } face_mapping[face_bit] = min_outer_bit; } @@ -957,7 +957,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai { if (-1 == face_mapping[face_bit]) { - llwarns << "No mapping from old face to new face!" << llendl; + LL_WARNS() << "No mapping from old face to new face!" << LL_ENDL; } S32 te_num = face_index_from_id(cur_mask, mVolumep->getProfile().mFaces); @@ -1415,7 +1415,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) if (!dp.unpackBinaryData(packed_buffer, size, "TextureEntry")) { retval = TEM_INVALID; - llwarns << "Bad texture entry block! Abort!" << llendl; + LL_WARNS() << "Bad texture entry block! Abort!" << LL_ENDL; return retval; } diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 1effeea73..82481feaa 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -534,7 +534,7 @@ void LLPrimitive::setPosition(const F32 x, const F32 y, const F32 z) } else { - llerrs << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } @@ -547,7 +547,7 @@ void LLPrimitive::setPosition(const LLVector3& pos) } else { - llerrs << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } @@ -559,7 +559,7 @@ void LLPrimitive::setAngularVelocity(const LLVector3& avel) } else { - llerror("Non Finite in LLPrimitive::setAngularVelocity", 0); + LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL; } } @@ -571,7 +571,7 @@ void LLPrimitive::setAngularVelocity(const F32 x, const F32 y, const F32 z) } else { - llerror("Non Finite in LLPrimitive::setAngularVelocity", 0); + LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL; } } @@ -583,7 +583,7 @@ void LLPrimitive::setVelocity(const LLVector3& vel) } else { - llerrs << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } @@ -595,7 +595,7 @@ void LLPrimitive::setVelocity(const F32 x, const F32 y, const F32 z) } else { - llerrs << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } @@ -607,7 +607,7 @@ void LLPrimitive::setVelocityX(const F32 x) } else { - llerror("Non Finite in LLPrimitive::setVelocityX", 0); + LL_ERRS() << "Non Finite in LLPrimitive::setVelocityX" << LL_ENDL; } } @@ -619,7 +619,7 @@ void LLPrimitive::setVelocityY(const F32 y) } else { - llerror("Non Finite in LLPrimitive::setVelocityY", 0); + LL_ERRS() << "Non Finite in LLPrimitive::setVelocityY" << LL_ENDL; } } @@ -631,7 +631,7 @@ void LLPrimitive::setVelocityZ(const F32 z) } else { - llerror("Non Finite in LLPrimitive::setVelocityZ", 0); + LL_ERRS() << "Non Finite in LLPrimitive::setVelocityZ" << LL_ENDL; } } @@ -643,7 +643,7 @@ void LLPrimitive::addVelocity(const LLVector3& vel) } else { - llerror("Non Finite in LLPrimitive::addVelocity", 0); + LL_ERRS() << "Non Finite in LLPrimitive::addVelocity" << LL_ENDL; } } @@ -655,7 +655,7 @@ void LLPrimitive::setAcceleration(const LLVector3& accel) } else { - llerrs << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } @@ -667,7 +667,7 @@ void LLPrimitive::setAcceleration(const F32 x, const F32 y, const F32 z) } else { - llerrs << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl; + LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL; } } #endif // CHECK_FOR_FINITE diff --git a/indra/llprimitive/llprimlinkinfo.h b/indra/llprimitive/llprimlinkinfo.h index 946fa75bf..a160978f0 100644 --- a/indra/llprimitive/llprimlinkinfo.h +++ b/indra/llprimitive/llprimlinkinfo.h @@ -280,28 +280,28 @@ S32 LLPrimLinkInfo< DATA_TYPE >::merge(LLPrimLinkInfo& other_info) // other_info.computeBoundingSphere(); // if ( other_radius != other_info.mBoundingSphere.getRadius() ) // { -// llinfos << "Other bounding sphere changed!!" << llendl; +// LL_INFOS() << "Other bounding sphere changed!!" << LL_ENDL; // } // F32 this_radius = mBoundingSphere.getRadius(); // computeBoundingSphere(); // if ( this_radius != mBoundingSphere.getRadius() ) // { -// llinfos << "This bounding sphere changed!!" << llendl; +// LL_INFOS() << "This bounding sphere changed!!" << LL_ENDL; // } F32 max_span = get_max_linkable_span(mBoundingSphere, other_info.mBoundingSphere); // F32 center_dist = (mBoundingSphere.getCenter() - other_info.mBoundingSphere.getCenter()).length(); - // llinfos << "objects are " << center_dist << "m apart" << llendl; + // LL_INFOS() << "objects are " << center_dist << "m apart" << LL_ENDL; F32 span = get_span(mBoundingSphere, other_info.mBoundingSphere); F32 span_limit = max_span + (2.f * other_info.mBoundingSphere.getRadius()); if (span > span_limit) { // there is no way any piece of other_info could link with this one - // llinfos << "span too large: " << span << " vs. " << span_limit << llendl; + // LL_INFOS() << "span too large: " << span << " vs. " << span_limit << LL_ENDL; return 0; } diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index 537e7a669..dfae9699e 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -130,7 +130,7 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) if (S32(index) >= mEntryList.size()) { S32 current_size = mEntryList.size(); - llwarns << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << llendl; + LL_WARNS() << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << LL_ENDL; return TEM_CHANGE_NONE; } diff --git a/indra/llprimitive/lltextureanim.cpp b/indra/llprimitive/lltextureanim.cpp index 4588a19f6..41415cf52 100644 --- a/indra/llprimitive/lltextureanim.cpp +++ b/indra/llprimitive/lltextureanim.cpp @@ -131,7 +131,7 @@ void LLTextureAnim::unpackTAMessage(LLMessageSystem *mesgsys, const S32 block_nu { if (size) { - llwarns << "Bad size " << size << " for TA block, ignoring." << llendl; + LL_WARNS() << "Bad size " << size << " for TA block, ignoring." << LL_ENDL; } mMode = 0; return; @@ -166,7 +166,7 @@ void LLTextureAnim::unpackTAMessage(LLDataPacker &dp) { if (size) { - llwarns << "Bad size " << size << " for TA block, ignoring." << llendl; + LL_WARNS() << "Bad size " << size << " for TA block, ignoring." << LL_ENDL; } mMode = 0; return; diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 0db75a0e8..284dfc15f 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -271,8 +271,8 @@ bool LLTextureEntry::fromLLSD(const LLSD& sd) w = TEXTURE_MEDIA_DATA_KEY; if (hasMedia() != sd.has(w)) { - llwarns << "LLTextureEntry::fromLLSD: media_flags (" << hasMedia() << - ") does not match presence of media_data (" << sd.has(w) << "). Fixing." << llendl; + LL_WARNS() << "LLTextureEntry::fromLLSD: media_flags (" << hasMedia() << + ") does not match presence of media_data (" << sd.has(w) << "). Fixing." << LL_ENDL; } updateMediaData(sd[w]); diff --git a/indra/llprimitive/lltreeparams.cpp b/indra/llprimitive/lltreeparams.cpp index 1c82fb63f..f07faee6a 100644 --- a/indra/llprimitive/lltreeparams.cpp +++ b/indra/llprimitive/lltreeparams.cpp @@ -46,7 +46,7 @@ LLTreeParams::LLTreeParams() { -// llinfos << "TREE PARAMS INITIALIZED" << llendl; +// LL_INFOS() << "TREE PARAMS INITIALIZED" << LL_ENDL; // init to basic something or other... mShape = SR_TEND_FLAME; mLevels = 1; diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp index d66e8c234..3226719ba 100644 --- a/indra/llprimitive/llvolumemessage.cpp +++ b/indra/llprimitive/llvolumemessage.cpp @@ -115,8 +115,8 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile begin out of range: " << temp_f32 - << ". Clamping to 0.0." << llendl; + LL_WARNS() << "Profile begin out of range: " << temp_f32 + << ". Clamping to 0.0." << LL_ENDL; temp_f32 = 0.f; ok = false; } @@ -126,8 +126,8 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile end out of range: " << 1.f - temp_f32 - << ". Clamping to 1.0." << llendl; + LL_WARNS() << "Profile end out of range: " << 1.f - temp_f32 + << ". Clamping to 1.0." << LL_ENDL; temp_f32 = 1.f; ok = false; } @@ -137,19 +137,19 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * HOLLOW_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile hollow out of range: " << temp_f32 - << ". Clamping to 0.0." << llendl; + LL_WARNS() << "Profile hollow out of range: " << temp_f32 + << ". Clamping to 0.0." << LL_ENDL; temp_f32 = 0.f; ok = false; } params->setHollow(temp_f32); /* - llinfos << "Unpacking Profile Block " << block_num << llendl; - llinfos << "Curve: " << (U32)getCurve() << llendl; - llinfos << "Begin: " << getBegin() << llendl; - llinfos << "End: " << getEnd() << llendl; - llinfos << "Hollow: " << getHollow() << llendl; + LL_INFOS() << "Unpacking Profile Block " << block_num << LL_ENDL; + LL_INFOS() << "Curve: " << (U32)getCurve() << LL_ENDL; + LL_INFOS() << "Begin: " << getBegin() << LL_ENDL; + LL_INFOS() << "End: " << getEnd() << LL_ENDL; + LL_INFOS() << "Hollow: " << getHollow() << LL_ENDL; */ return ok; @@ -171,8 +171,8 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile begin out of range: " << temp_f32 << llendl; - llwarns << "Clamping to 0.0" << llendl; + LL_WARNS() << "Profile begin out of range: " << temp_f32 << LL_ENDL; + LL_WARNS() << "Clamping to 0.0" << LL_ENDL; temp_f32 = 0.f; ok = false; } @@ -182,8 +182,8 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * CUT_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile end out of range: " << 1.f - temp_f32 << llendl; - llwarns << "Clamping to 1.0" << llendl; + LL_WARNS() << "Profile end out of range: " << 1.f - temp_f32 << LL_ENDL; + LL_WARNS() << "Clamping to 1.0" << LL_ENDL; temp_f32 = 1.f; ok = false; } @@ -193,8 +193,8 @@ bool LLVolumeMessage::unpackProfileParams( temp_f32 = temp_u16 * HOLLOW_QUANTA; if (temp_f32 > 1.f) { - llwarns << "Profile hollow out of range: " << temp_f32 << llendl; - llwarns << "Clamping to 0.0" << llendl; + LL_WARNS() << "Profile hollow out of range: " << temp_f32 << LL_ENDL; + LL_WARNS() << "Clamping to 0.0" << LL_ENDL; temp_f32 = 0.f; ok = false; } @@ -385,12 +385,12 @@ bool LLVolumeMessage::unpackPathParams( params->setSkew((F32)(skew * SCALE_QUANTA)); /* - llinfos << "Unpacking Path Block " << block_num << llendl; - llinfos << "Curve: " << (U32)params->getCurve() << llendl; - llinfos << "Begin: " << params->getBegin() << llendl; - llinfos << "End: " << params->getEnd() << llendl; - llinfos << "Scale: " << params->getScale() << llendl; - llinfos << "Twist: " << params->getTwist() << llendl; + LL_INFOS() << "Unpacking Path Block " << block_num << LL_ENDL; + LL_INFOS() << "Curve: " << (U32)params->getCurve() << LL_ENDL; + LL_INFOS() << "Begin: " << params->getBegin() << LL_ENDL; + LL_INFOS() << "End: " << params->getEnd() << LL_ENDL; + LL_INFOS() << "Scale: " << params->getScale() << LL_ENDL; + LL_INFOS() << "Twist: " << params->getTwist() << LL_ENDL; */ return true; @@ -486,16 +486,16 @@ bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params) bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800; if(bad) { - llwarns << "LLVolumeMessage::constrainVolumeParams() - " + LL_WARNS() << "LLVolumeMessage::constrainVolumeParams() - " << "forced to constrain incoming volume params: " - << llformat("0x%04x",bad) << llendl; + << llformat("0x%04x",bad) << LL_ENDL; } return bad ? false : true; } bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys) { - // llinfos << "pack volume" << llendl; + // LL_INFOS() << "pack volume" << LL_ENDL; if (params) { packPathParams(¶ms->getPathParams(), mesgsys); @@ -511,7 +511,7 @@ bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSy bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLDataPacker &dp) { - // llinfos << "pack volume" << llendl; + // LL_INFOS() << "pack volume" << LL_ENDL; if (params) { packPathParams(¶ms->getPathParams(), dp); diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 3fd4464fb..03291018e 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -101,7 +101,7 @@ void LLCubeMap::initGL() } else { - llwarns << "Using cube map without extension!" << llendl; + LL_WARNS() << "Using cube map without extension!" << LL_ENDL; } } diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index e622899cd..4547c2f61 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -77,7 +77,7 @@ LLFontManager::LLFontManager() if (error) { // Clean up freetype libs. - llerrs << "Freetype initialization failure!" << llendl; + LL_ERRS() << "Freetype initialization failure!" << LL_ENDL; FT_Done_FreeType(gFTLibrary); } } @@ -140,7 +140,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size, mFTFace = NULL; } - llinfos << "Loading font file: " << filename << llendl; + LL_INFOS() << "Loading font file: " << filename << LL_ENDL; int error; @@ -191,7 +191,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size, if (!mFTFace->charmap) { - //llinfos << " no unicode encoding, set whatever encoding there is..." << llendl; + //LL_INFOS() << " no unicode encoding, set whatever encoding there is..." << LL_ENDL; FT_Set_Charmap(mFTFace, mFTFace->charmaps[0]); } @@ -310,7 +310,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const return FALSE; llassert(!mIsFallback); - //lldebugs << "Adding new glyph for " << wch << " to font" << llendl; + //LL_DEBUGS() << "Adding new glyph for " << wch << " to font" << LL_ENDL; FT_UInt glyph_index; @@ -318,7 +318,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const glyph_index = FT_Get_Char_Index(mFTFace, wch); if (glyph_index == 0) { - //llinfos << "Trying to add glyph from fallback font!" << llendl; + //LL_INFOS() << "Trying to add glyph from fallback font!" << LL_ENDL; font_vector_t::const_iterator iter; for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++) { @@ -491,7 +491,7 @@ void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi) //loadFace(mName,mPointSize,vert_dpi,horz_dpi,mFontBitmapCachep->getNumComponents(),mIsFallback); if (mFallbackFonts.empty()) { - llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl; + LL_WARNS() << "LLFontGL::reset(), no fallback fonts present" << LL_ENDL; } else { diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 2a2ea73fe..b509b8de2 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -359,7 +359,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } if (!fgi) { - llerrs << "Missing Glyph Info" << llendl; + LL_ERRS() << "Missing Glyph Info" << LL_ENDL; break; } // Per-glyph bitmap texture. @@ -1224,7 +1224,7 @@ std::string LLFontGL::getFontPathSystem() system_root = getenv("SystemRoot"); /* Flawfinder: ignore */ if (!system_root) { - llwarns << "SystemRoot not found, attempting to load fonts from default path." << llendl; + LL_WARNS() << "SystemRoot not found, attempting to load fonts from default path." << LL_ENDL; } #endif @@ -1269,12 +1269,12 @@ std::string LLFontGL::getFontPathLocal() LLFontGL::LLFontGL(const LLFontGL &source) { - llerrs << "Not implemented!" << llendl; + LL_ERRS() << "Not implemented!" << LL_ENDL; } LLFontGL &LLFontGL::operator=(const LLFontGL &source) { - llerrs << "Not implemented" << llendl; + LL_ERRS() << "Not implemented" << LL_ENDL; return *this; } diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index fa713cbb6..53e3a1c57 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -198,8 +198,8 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename) if ( root.isNull() || ! root->hasName( "fonts" ) ) { - llwarns << "Bad font info file: " - << full_filename << llendl; + LL_WARNS() << "Bad font info file: " + << full_filename << LL_ENDL; continue; } @@ -352,10 +352,10 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) bool found_size = nameToSize(norm_desc.getSize(),point_size); if (!found_size) { - llwarns << "createFont unrecognized size " << norm_desc.getSize() << llendl; + LL_WARNS() << "createFont unrecognized size " << norm_desc.getSize() << LL_ENDL; return NULL; } - llinfos << "createFont " << norm_desc.getName() << " size " << norm_desc.getSize() << " style " << ((S32) norm_desc.getStyle()) << llendl; + LL_INFOS() << "createFont " << norm_desc.getName() << " size " << norm_desc.getSize() << " style " << ((S32) norm_desc.getStyle()) << LL_ENDL; F32 fallback_scale = 1.0; // Find corresponding font template (based on same descriptor with no size specified) @@ -364,8 +364,8 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) const LLFontDescriptor *match_desc = getClosestFontTemplate(template_desc); if (!match_desc) { - llwarns << "createFont failed, no template found for " - << norm_desc.getName() << " style [" << ((S32)norm_desc.getStyle()) << "]" << llendl; + LL_WARNS() << "createFont failed, no template found for " + << norm_desc.getName() << " style [" << ((S32)norm_desc.getStyle()) << "]" << LL_ENDL; return NULL; } @@ -379,11 +379,11 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) if (it != mFontMap.end() && it->second != NULL) { if (it->second != NULL) { - llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl; + LL_INFOS() << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << LL_ENDL; return it->second; } else { - llwarns << "Failed to find font" << llendl; + LL_WARNS() << "Failed to find font" << LL_ENDL; } //Haven't plugged free-type in yet. // copying underlying Freetype font, and storing in LLFontGL with requested font descriptor @@ -406,7 +406,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) file_names.insert(file_names.end(), match_default_desc->getFileNames().begin(), match_default_desc->getFileNames().end()); - llinfos << "Found matching fallback fonts: " << match_default_desc->getFileNames().size() << llendl; + LL_INFOS() << "Found matching fallback fonts: " << match_default_desc->getFileNames().size() << LL_ENDL; } // Add ultimate fallback list - generated dynamically on linux, @@ -418,7 +418,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) // Load fonts based on names. if (file_names.empty()) { - llwarns << "createFont failed, no file names specified" << llendl; + LL_WARNS() << "createFont failed, no file names specified" << LL_ENDL; return NULL; } @@ -488,7 +488,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) } else { - llwarns << "createFont failed in some way" << llendl; + LL_WARNS() << "createFont failed in some way" << LL_ENDL; } mFontMap[norm_desc] = result; return result; @@ -542,9 +542,9 @@ LLFontGL *LLFontRegistry::getFont(const LLFontDescriptor& orig_desc) LLFontGL *fontp = createFont(orig_desc); if (!fontp) { - llwarns << "getFont failed, name " << orig_desc.getName() + LL_WARNS() << "getFont failed, name " << orig_desc.getName() <<" style=[" << ((S32) orig_desc.getStyle()) << "]" - << " size=[" << orig_desc.getSize() << "]" << llendl; + << " size=[" << orig_desc.getSize() << "]" << LL_ENDL; } return fontp; } @@ -647,28 +647,28 @@ const LLFontDescriptor *LLFontRegistry::getClosestFontTemplate(const LLFontDescr void LLFontRegistry::dump() { - llinfos << "LLFontRegistry dump: " << llendl; + LL_INFOS() << "LLFontRegistry dump: " << LL_ENDL; for (font_size_map_t::iterator size_it = mFontSizes.begin(); size_it != mFontSizes.end(); ++size_it) { - llinfos << "Size: " << size_it->first << " => " << size_it->second << llendl; + LL_INFOS() << "Size: " << size_it->first << " => " << size_it->second << LL_ENDL; } for (font_reg_map_t::iterator font_it = mFontMap.begin(); font_it != mFontMap.end(); ++font_it) { const LLFontDescriptor& desc = font_it->first; - llinfos << "Font: name=" << desc.getName() + LL_INFOS() << "Font: name=" << desc.getName() << " style=[" << ((S32)desc.getStyle()) << "]" << " size=[" << desc.getSize() << "]" << " fileNames=" - << llendl; + << LL_ENDL; for (string_vec_t::const_iterator file_it=desc.getFileNames().begin(); file_it != desc.getFileNames().end(); ++file_it) { - llinfos << " file: " << *file_it <mShaderObjects.end()) { - LL_WARNS("ShaderLoading") << "Attached unknown shader!" << llendl; + LL_WARNS("ShaderLoading") << "Attached unknown shader!" << LL_ENDL; } stop_glerror(); @@ -511,7 +511,7 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) unbind(); - LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << llendl; + LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL; return res; } @@ -657,7 +657,7 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode) } else { - llerrs << "Texture channel " << index << " texture type corrupted." << llendl; + LL_ERRS() << "Texture channel " << index << " texture type corrupted." << LL_ENDL; } } gGL.getTexUnit(index)->disable(); diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index c5fc3abca..7e91f9ab1 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -332,7 +332,7 @@ public: stop_glerror(); if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str())) { - llerrs << "Uniform does not match." << llendl; + LL_ERRS() << "Uniform does not match." << LL_ENDL; } stop_glerror(); } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index cda75e761..2f7768738 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -120,7 +120,7 @@ void LLImageGL::checkTexSize(bool forced) const BOOL error = FALSE; if (texname != mTexName) { - llinfos << "Bound: " << texname << " Should bind: " << mTexName << " Default: " << LLImageGL::sDefaultGLTexture->getTexName() << llendl; + LL_INFOS() << "Bound: " << texname << " Should bind: " << mTexName << " Default: " << LLImageGL::sDefaultGLTexture->getTexName() << LL_ENDL; error = TRUE; if (gDebugSession) @@ -129,7 +129,7 @@ void LLImageGL::checkTexSize(bool forced) const } else { - llerrs << "Invalid texture bound!" << llendl; + LL_ERRS() << "Invalid texture bound!" << LL_ENDL; } } stop_glerror() ; @@ -153,8 +153,8 @@ void LLImageGL::checkTexSize(bool forced) const } else { - llerrs << "wrong texture size and discard level: width: " << - mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << llendl ; + LL_ERRS() << "wrong texture size and discard level: width: " << + mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << LL_ENDL ; } } @@ -242,7 +242,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_RGBA: return 32; case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac default: - llerrs << "LLImageGL::Unknown format: " << dataformat << llendl; + LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL; return 0; } } @@ -279,7 +279,7 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat) case GL_RGBA: return 4; case GL_BGRA: return 4; // Used for QuickTime media textures on the Mac default: - llerrs << "LLImageGL::Unknown format: " << dataformat << llendl; + LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL; return 0; } } @@ -360,7 +360,7 @@ void LLImageGL::destroyGL(BOOL save_state) } } sImageList = stored_images; - llinfos << "Storing " << stored_images.size() << " images..." << llendl; + LL_INFOS() << "Storing " << stored_images.size() << " images..." << LL_ENDL; sAllowReadBackRaw = false ; } @@ -375,7 +375,7 @@ void LLImageGL::restoreGL() LLImageGL* glimage = *iter; if(glimage->getTexName()) { - llerrs << "tex name is not 0." << llendl ; + LL_ERRS() << "tex name is not 0." << LL_ENDL ; } if (glimage->mSaveData.notNull() && glimage->getComponents() && glimage->mSaveData->getComponents() && @@ -392,7 +392,7 @@ void LLImageGL::restoreGL() } restored_images = restored_images; - llinfos << "Restored " << restored_images.size() << " images" << llendl; + LL_INFOS() << "Restored " << restored_images.size() << " images" << LL_ENDL; } //static @@ -571,12 +571,12 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // Check if dimensions are a power of two! if (!checkSize(width,height)) { - llwarns << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << llendl; + LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << LL_ENDL; } if (mTexName) { -// llwarns << "Setting Size of LLImageGL with existing mTexName = " << mTexName << llendl; +// LL_WARNS() << "Setting Size of LLImageGL with existing mTexName = " << mTexName << LL_ENDL; destroyGLTexture(); } @@ -615,7 +615,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // virtual void LLImageGL::dump() { - llinfos << "mMaxDiscardLevel " << S32(mMaxDiscardLevel) + LL_INFOS() << "mMaxDiscardLevel " << S32(mMaxDiscardLevel) << " mLastBindTime " << mLastBindTime << " mTarget " << S32(mTarget) << " mBindTarget " << S32(mBindTarget) @@ -630,12 +630,12 @@ void LLImageGL::dump() #if DEBUG_MISS << " mMissed " << mMissed #endif - << llendl; + << LL_ENDL; - llinfos << " mTextureMemory " << mTextureMemory + LL_INFOS() << " mTextureMemory " << mTextureMemory << " mTexNames " << mTexName << " mIsResident " << S32(mIsResident) - << llendl; + << LL_ENDL; } //---------------------------------------------------------------------------- @@ -910,7 +910,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) } else { - llerrs << "Compressed Image has mipmaps but data does not (can not auto generate compressed mips)" << llendl; + LL_ERRS() << "Compressed Image has mipmaps but data does not (can not auto generate compressed mips)" << LL_ENDL; } } else @@ -961,13 +961,13 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 if (mTexName == 0) { // *TODO: Re-enable warning? Ran into thread locking issues? DK 2011-02-18 - //llwarns << "Setting subimage on image without GL texture" << llendl; + //LL_WARNS() << "Setting subimage on image without GL texture" << LL_ENDL; return FALSE; } if (datap == NULL) { // *TODO: Re-enable warning? Ran into thread locking issues? DK 2011-02-18 - //llwarns << "Setting subimage on image with NULL datap" << llendl; + //LL_WARNS() << "Setting subimage on image with NULL datap" << LL_ENDL; return FALSE; } @@ -981,7 +981,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 if (mUseMipMaps) { dump(); - llerrs << "setSubImage called with mipmapped image (not supported)" << llendl; + LL_ERRS() << "setSubImage called with mipmapped image (not supported)" << LL_ENDL; } llassert_always(mCurrentDiscardLevel == 0); llassert_always(x_pos >= 0 && y_pos >= 0); @@ -990,28 +990,28 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 (y_pos + height) > getHeight()) { dump(); - llerrs << "Subimage not wholly in target image!" + LL_ERRS() << "Subimage not wholly in target image!" << " x_pos " << x_pos << " y_pos " << y_pos << " width " << width << " height " << height << " getWidth() " << getWidth() << " getHeight() " << getHeight() - << llendl; + << LL_ENDL; } if ((x_pos + width) > data_width || (y_pos + height) > data_height) { dump(); - llerrs << "Subimage not wholly in source image!" + LL_ERRS() << "Subimage not wholly in source image!" << " x_pos " << x_pos << " y_pos " << y_pos << " width " << width << " height " << height << " source_width " << data_width << " source_height " << data_height - << llendl; + << LL_ENDL; } @@ -1027,7 +1027,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 datap += (y_pos * data_width + x_pos) * getComponents(); // Update the GL texture BOOL res = gGL.getTexUnit(0)->bindManual(mBindTarget, mTexName); - if (!res) llerrs << "LLImageGL::setSubImage(): bindTexture failed" << llendl; + if (!res) LL_ERRS() << "LLImageGL::setSubImage(): bindTexture failed" << LL_ENDL; stop_glerror(); glTexSubImage2D(mTarget, 0, x_pos, y_pos, @@ -1215,7 +1215,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt intformat = GL_COMPRESSED_ALPHA; break; default: - llwarns << "Could not compress format: " << std::hex << intformat << std::dec << llendl; + LL_WARNS() << "Could not compress format: " << std::hex << intformat << std::dec << LL_ENDL; break; } } @@ -1233,7 +1233,7 @@ BOOL LLImageGL::createGLTexture() LLFastTimer t(FTM_CREATE_GL_TEXTURE1); if (gGLManager.mIsDisabled) { - llwarns << "Trying to create a texture while GL is disabled!" << llendl; + LL_WARNS() << "Trying to create a texture while GL is disabled!" << LL_ENDL; return FALSE; } @@ -1252,7 +1252,7 @@ BOOL LLImageGL::createGLTexture() stop_glerror(); if (!mTexName) { - llerrs << "LLImageGL::createGLTexture failed to make an empty texture" << llendl; + LL_ERRS() << "LLImageGL::createGLTexture failed to make an empty texture" << LL_ENDL; } return TRUE ; @@ -1264,7 +1264,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S LLFastTimer t(FTM_CREATE_GL_TEXTURE2); if (gGLManager.mIsDisabled) { - llwarns << "Trying to create a texture while GL is disabled!" << llendl; + LL_WARNS() << "Trying to create a texture while GL is disabled!" << LL_ENDL; return FALSE; } @@ -1378,7 +1378,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } if (!mTexName) { - llerrs << "LLImageGL::createGLTexture failed to make texture" << llendl; + LL_ERRS() << "LLImageGL::createGLTexture failed to make texture" << LL_ENDL; } if (mUseMipMaps) @@ -1436,7 +1436,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre { // VWR-13505 : Merov : Allow gl texture read back so save texture works again (temporary) //llassert_always(sAllowReadBackRaw) ; - //llerrs << "should not call this function!" << llendl ; + //LL_ERRS() << "should not call this function!" << LL_ENDL ; if (discard_level < 0) { @@ -1476,15 +1476,15 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre } if(width < glwidth) { - llwarns << "texture size is smaller than it should be." << llendl ; - llwarns << "width: " << width << " glwidth: " << glwidth << " mWidth: " << mWidth << - " mCurrentDiscardLevel: " << (S32)mCurrentDiscardLevel << " discard_level: " << (S32)discard_level << llendl ; + LL_WARNS() << "texture size is smaller than it should be." << LL_ENDL ; + LL_WARNS() << "width: " << width << " glwidth: " << glwidth << " mWidth: " << mWidth << + " mCurrentDiscardLevel: " << (S32)mCurrentDiscardLevel << " discard_level: " << (S32)discard_level << LL_ENDL ; return FALSE ; } if (width <= 0 || width > 2048 || height <= 0 || height > 2048 || ncomponents < 1 || ncomponents > 4) { - llerrs << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << llendl; + LL_ERRS() << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << LL_ENDL; } LLGLint is_compressed = 0; @@ -1497,7 +1497,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre GLenum error ; while((error = glGetError()) != GL_NO_ERROR) { - llwarns << "GL Error happens before reading back texture. Error code: " << error << llendl ; + LL_WARNS() << "GL Error happens before reading back texture. Error code: " << error << LL_ENDL ; } //----------------------------------------------------------------------------------------------- @@ -1507,8 +1507,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, (GLint*)&glbytes); if(!imageraw->allocateDataSize(width, height, ncomponents, glbytes)) { - llwarns << "Memory allocation failed for reading back texture. Size is: " << glbytes << llendl ; - llwarns << "width: " << width << "height: " << height << "components: " << ncomponents << llendl ; + LL_WARNS() << "Memory allocation failed for reading back texture. Size is: " << glbytes << LL_ENDL ; + LL_WARNS() << "width: " << width << "height: " << height << "components: " << ncomponents << LL_ENDL ; return FALSE ; } @@ -1519,8 +1519,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre { if(!imageraw->allocateDataSize(width, height, ncomponents)) { - llwarns << "Memory allocation failed for reading back texture." << llendl ; - llwarns << "width: " << width << "height: " << height << "components: " << ncomponents << llendl ; + LL_WARNS() << "Memory allocation failed for reading back texture." << LL_ENDL ; + LL_WARNS() << "width: " << width << "height: " << height << "components: " << ncomponents << LL_ENDL ; return FALSE ; } @@ -1531,12 +1531,12 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre //----------------------------------------------------------------------------------------------- if((error = glGetError()) != GL_NO_ERROR) { - llwarns << "GL Error happens after reading back texture. Error code: " << error << llendl ; + LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ; imageraw->deleteData() ; while((error = glGetError()) != GL_NO_ERROR) { - llwarns << "GL Error happens after reading back texture. Error code: " << error << llendl ; + LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ; } return FALSE ; @@ -1792,7 +1792,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() mAlphaOffset < 0 || //unsupported type (mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation { - llwarns << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << llendl; + LL_WARNS() << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << LL_ENDL; setNeedsAlphaAndPickMask(FALSE); } diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index ba6277235..9991870bc 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -353,7 +353,7 @@ LLPostProcess::LLPostProcess(void) : /* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/ std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME)); - LL_DEBUGS2("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL; + LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL; llifstream effectsXML(pathName); @@ -702,7 +702,7 @@ void LLPostProcess::saveEffectAs(std::string const & effectName) mAllEffectInfo[effectName] = mSelectedEffectInfo; std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME)); - //llinfos << "Saving PostProcess Effects settings to " << pathName << llendl; + //LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL; llofstream effectsXML(pathName); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 78de9749d..b8a723415 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -233,7 +233,7 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) LLImageGL* gl_tex = NULL ; if (texture == NULL || !(gl_tex = texture->getGLTexture())) { - llwarns << "NULL LLTexUnit::bind texture" << llendl; + LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL; return false; } @@ -285,7 +285,7 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) if(!texture) { - llwarns << "NULL LLTexUnit::bind texture" << llendl; + LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL; return false; } @@ -335,13 +335,13 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap) if (cubeMap == NULL) { - llwarns << "NULL LLTexUnit::bind cubemap" << llendl; + LL_WARNS() << "NULL LLTexUnit::bind cubemap" << LL_ENDL; return false; } if (cubeMap->mImages[0].isNull()) { - llwarns << "NULL LLTexUnit::bind cubeMap->mImages[0]" << llendl; + LL_WARNS() << "NULL LLTexUnit::bind cubeMap->mImages[0]" << LL_ENDL; return false; } if (mCurrTexture != cubeMap->mImages[0]->getTexName()) @@ -364,7 +364,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap) } else { - llwarns << "Using cube map without extension!" << llendl; + LL_WARNS() << "Using cube map without extension!" << LL_ENDL; return false; } } @@ -383,7 +383,7 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth) { if (renderTarget->hasStencil()) { - llerrs << "Cannot bind a render buffer for sampling. Allocate render target without a stencil buffer if sampling of depth buffer is required." << llendl; + LL_ERRS() << "Cannot bind a render buffer for sampling. Allocate render target without a stencil buffer if sampling of depth buffer is required." << LL_ENDL; } bindManual(renderTarget->getUsage(), renderTarget->getDepth()); @@ -510,7 +510,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio { glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gGL.mMaxAnisotropy); - llinfos << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << llendl ; + LL_INFOS() << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << LL_ENDL ; gGL.mMaxAnisotropy = llmax(1.f, gGL.mMaxAnisotropy) ; } glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGL.mMaxAnisotropy); @@ -564,7 +564,7 @@ void LLTexUnit::setTextureBlendType(eTextureBlendType type) glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); break; default: - llerrs << "Unknown Texture Blend Type: " << type << llendl; + LL_ERRS() << "Unknown Texture Blend Type: " << type << LL_ENDL; break; } setColorScale(scale_amount); @@ -604,7 +604,7 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) return GL_CONSTANT_ARB; default: - llwarns << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << llendl; + LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL; return GL_PRIMARY_COLOR_ARB; } } @@ -642,7 +642,7 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) return GL_ONE_MINUS_SRC_ALPHA; default: - llwarns << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << llendl; + LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << LL_ENDL; return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR; } } @@ -783,7 +783,7 @@ void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eT break; default: - llwarns << "Unknown eTextureBlendOp: " << op << ". Setting op to replace." << llendl; + LL_WARNS() << "Unknown eTextureBlendOp: " << op << ". Setting op to replace." << LL_ENDL; // Slightly special syntax (no second sources), just set all and return. glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_REPLACE); glTexEnvi(GL_TEXTURE_ENV, src0_enum, source1); @@ -831,7 +831,7 @@ void LLTexUnit::debugTextureUnit(void) if ((GL_TEXTURE0_ARB + mIndex) != activeTexture) { U32 set_unit = (activeTexture - GL_TEXTURE0_ARB); - llwarns << "Incorrect Texture Unit! Expected: " << set_unit << " Actual: " << mIndex << llendl; + LL_WARNS() << "Incorrect Texture Unit! Expected: " << set_unit << " Actual: " << mIndex << LL_ENDL; } } @@ -1660,7 +1660,7 @@ void LLRender::pushMatrix() } else { - llwarns << "Matrix stack overflow." << llendl; + LL_WARNS() << "Matrix stack overflow." << LL_ENDL; } } } @@ -1676,7 +1676,7 @@ void LLRender::popMatrix() } else { - llwarns << "Matrix stack underflow." << llendl; + LL_WARNS() << "Matrix stack underflow." << LL_ENDL; } } } @@ -1684,7 +1684,6 @@ void LLRender::popMatrix() void LLRender::loadMatrix(const LLMatrix4a& mat) { flush(); - mMatrix[mMatrixMode][mMatIdx[mMatrixMode]] = mat; mMatHash[mMatrixMode]++; } @@ -1742,7 +1741,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z) { if (mUIOffset.empty()) { - llerrs << "Need to push a UI translation frame before offsetting" << llendl; + LL_ERRS() << "Need to push a UI translation frame before offsetting" << LL_ENDL; } LLVector4a add(x,y,z); @@ -1753,7 +1752,7 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z) { if (mUIScale.empty()) { - llerrs << "Need to push a UI transformation frame before scaling." << llendl; + LL_ERRS() << "Need to push a UI transformation frame before scaling." << LL_ENDL; } LLVector4a scale(x,y,z); @@ -1785,7 +1784,7 @@ void LLRender::popUIMatrix() { if (mUIOffset.empty()) { - llerrs << "UI offset stack blown." << llendl; + LL_ERRS() << "UI offset stack blown." << LL_ENDL; } mUIOffset.pop_back(); mUIScale.pop_back(); @@ -1814,7 +1813,7 @@ void LLRender::loadUIIdentity() { if (mUIOffset.empty() || mUIScale.empty()) { - llerrs << "Need to push UI translation frame before clearing offset." << llendl; + LL_ERRS() << "Need to push UI translation frame before clearing offset." << LL_ENDL; } mUIOffset.back().splat(0.f); mUIScale.back().splat(1.f); @@ -1872,7 +1871,7 @@ void LLRender::setSceneBlendType(eBlendType type) blendFunc(BF_ONE, BF_ZERO); break; default: - llerrs << "Unknown Scene Blend Type: " << type << llendl; + LL_ERRS() << "Unknown Scene Blend Type: " << type << LL_ENDL; break; } } @@ -1913,7 +1912,7 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) if (cur_func != sGLCompareFunc[func]) { - llerrs << "Alpha test function corrupted!" << llendl; + LL_ERRS() << "Alpha test function corrupted!" << LL_ENDL; } F32 ref = 0.f; @@ -1921,7 +1920,7 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) if (ref != value) { - llerrs << "Alpha test value corrupted!" << llendl; + LL_ERRS() << "Alpha test value corrupted!" << LL_ENDL; } } } @@ -1961,7 +1960,7 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, llassert(alpha_dfactor < BF_UNDEF); if (!gGLManager.mHasBlendFuncSeparate) { - LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << llendl; + LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << LL_ENDL; blendFunc(color_sfactor, color_dfactor); return; } @@ -1990,7 +1989,7 @@ LLTexUnit* LLRender::getTexUnit(U32 index) } else { - lldebugs << "Non-existing texture unit layer requested: " << index << llendl; + LL_DEBUGS() << "Non-existing texture unit layer requested: " << index << LL_ENDL; return mDummyTexUnit; } } @@ -2026,7 +2025,7 @@ bool LLRender::verifyTexUnitActive(U32 unitToVerify) } else { - llwarns << "TexUnit currently active: " << mCurrTextureUnitIndex << " (expecting " << unitToVerify << ")" << llendl; + LL_WARNS() << "TexUnit currently active: " << mCurrTextureUnitIndex << " (expecting " << unitToVerify << ")" << LL_ENDL; return false; } } @@ -2057,7 +2056,7 @@ void LLRender::begin(const GLuint& mode) } else if (mCount != 0) { - llerrs << "gGL.begin() called redundantly." << llendl; + LL_ERRS() << "gGL.begin() called redundantly." << LL_ENDL; } mMode = mode; @@ -2069,7 +2068,7 @@ void LLRender::end() if (mCount == 0) { return; - //IMM_ERRS << "GL begin and end called with no vertices specified." << llendl; + //IMM_ERRS << "GL begin and end called with no vertices specified." << LL_ENDL; } if ((mMode != LLRender::QUADS && @@ -2088,22 +2087,22 @@ void LLRender::flush() #if 0 if (!glIsEnabled(GL_VERTEX_ARRAY)) { - llerrs << "foo 1" << llendl; + LL_ERRS() << "foo 1" << LL_ENDL; } if (!glIsEnabled(GL_COLOR_ARRAY)) { - llerrs << "foo 2" << llendl; + LL_ERRS() << "foo 2" << LL_ENDL; } if (!glIsEnabled(GL_TEXTURE_COORD_ARRAY)) { - llerrs << "foo 3" << llendl; + LL_ERRS() << "foo 3" << LL_ENDL; } if (glIsEnabled(GL_NORMAL_ARRAY)) { - llerrs << "foo 7" << llendl; + LL_ERRS() << "foo 7" << LL_ENDL; } GLvoid* pointer; @@ -2111,19 +2110,19 @@ void LLRender::flush() glGetPointerv(GL_VERTEX_ARRAY_POINTER, &pointer); if (pointer != &(mBuffer[0].v)) { - llerrs << "foo 4" << llendl; + LL_ERRS() << "foo 4" << LL_ENDL; } glGetPointerv(GL_COLOR_ARRAY_POINTER, &pointer); if (pointer != &(mBuffer[0].c)) { - llerrs << "foo 5" << llendl; + LL_ERRS() << "foo 5" << LL_ENDL; } glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &pointer); if (pointer != &(mBuffer[0].uv)) { - llerrs << "foo 6" << llendl; + LL_ERRS() << "foo 6" << LL_ENDL; } #endif @@ -2139,7 +2138,7 @@ void LLRender::flush() { if (mCount%4 != 0) { - llerrs << "Incomplete quad rendered." << llendl; + LL_ERRS() << "Incomplete quad rendered." << LL_ENDL; } } @@ -2147,7 +2146,7 @@ void LLRender::flush() { if (mCount%3 != 0) { - llerrs << "Incomplete triangle rendered." << llendl; + LL_ERRS() << "Incomplete triangle rendered." << LL_ENDL; } } @@ -2155,7 +2154,7 @@ void LLRender::flush() { if (mCount%2 != 0) { - llerrs << "Incomplete line rendered." << llendl; + LL_ERRS() << "Incomplete line rendered." << LL_ENDL; } } } @@ -2208,7 +2207,7 @@ void LLRender::vertex4a(const LLVector4a& vertex) if (mCount > 4094) { - // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; } @@ -2252,7 +2251,7 @@ void LLRender::vertexBatchPreTransformed(LLVector4a* verts, S32 vert_count) { if (mCount + vert_count > 4094) { - // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; } @@ -2309,7 +2308,7 @@ void LLRender::vertexBatchPreTransformed(LLVector4a* verts, LLVector2* uvs, S32 { if (mCount + vert_count > 4094) { - // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; } @@ -2367,7 +2366,7 @@ void LLRender::vertexBatchPreTransformed(LLVector4a* verts, LLVector2* uvs, LLCo { if (mCount + vert_count > 4094) { - // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL; return; } diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 19c00156d..cc447d870 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -342,7 +342,7 @@ void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const { if (NULL == image) { - llwarns << "image == NULL; aborting function" << llendl; + LL_WARNS() << "image == NULL; aborting function" << LL_ENDL; return; } gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), 0.f, image, color, uv_rect ); @@ -352,7 +352,7 @@ void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, { if (NULL == image) { - llwarns << "image == NULL; aborting function" << llendl; + LL_WARNS() << "image == NULL; aborting function" << LL_ENDL; return; } gl_draw_scaled_rotated_image( x, y, width, height, 0.f, image, color, uv_rect ); @@ -362,7 +362,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border { if (NULL == image) { - llwarns << "image == NULL; aborting function" << llendl; + LL_WARNS() << "image == NULL; aborting function" << LL_ENDL; return; } @@ -380,7 +380,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (NULL == image) { - llwarns << "image == NULL; aborting function" << llendl; + LL_WARNS() << "image == NULL; aborting function" << LL_ENDL; return; } @@ -639,7 +639,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre { if (NULL == image) { - llwarns << "image == NULL; aborting function" << llendl; + LL_WARNS() << "image == NULL; aborting function" << LL_ENDL; return; } diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 6e47a9acd..3010f9dc5 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -43,7 +43,7 @@ void check_framebuffer_status() case GL_FRAMEBUFFER_COMPLETE: break; default: - llwarns << "check_framebuffer_status failed -- " << std::hex << status << std::dec << llendl; + LL_WARNS() << "check_framebuffer_status failed -- " << std::hex << status << std::dec << LL_ENDL; ll_fail("check_framebuffer_status failed"); break; } @@ -143,7 +143,7 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo { if (!allocateDepth()) { - llwarns << "Failed to allocate depth buffer for render target." << llendl; + LL_WARNS() << "Failed to allocate depth buffer for render target." << LL_ENDL; return false; } } @@ -183,13 +183,13 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) if( offset >= 4 ) { - llwarns << "Too many color attachments" << llendl; + LL_WARNS() << "Too many color attachments" << LL_ENDL; llassert( offset < 4 ); return false; } if( offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers) ) { - llwarns << "FBO not used or no drawbuffers available; mFBO=" << (U32)mFBO << " gGLManager.mHasDrawBuffers=" << (U32)gGLManager.mHasDrawBuffers << llendl; + LL_WARNS() << "FBO not used or no drawbuffers available; mFBO=" << (U32)mFBO << " gGLManager.mHasDrawBuffers=" << (U32)gGLManager.mHasDrawBuffers << LL_ENDL; llassert( mFBO != 0 ); llassert( gGLManager.mHasDrawBuffers ); return false; @@ -207,7 +207,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); if (glGetError() != GL_NO_ERROR) { - llwarns << "Could not allocate color buffer for render target." << llendl; + LL_WARNS() << "Could not allocate color buffer for render target." << LL_ENDL; return false; } } @@ -294,7 +294,7 @@ bool LLRenderTarget::allocateDepth() if (glGetError() != GL_NO_ERROR) { - llwarns << "Unable to allocate depth buffer for render target." << llendl; + LL_WARNS() << "Unable to allocate depth buffer for render target." << LL_ENDL; return false; } @@ -307,17 +307,17 @@ void LLRenderTarget::shareDepthBuffer(LLRenderTarget& target) { if (!mFBO || !target.mFBO) { - llerrs << "Cannot share depth buffer between non FBO render targets." << llendl; + LL_ERRS() << "Cannot share depth buffer between non FBO render targets." << LL_ENDL; } if (target.mDepth) { - llerrs << "Attempting to override existing depth buffer. Detach existing buffer first." << llendl; + LL_ERRS() << "Attempting to override existing depth buffer. Detach existing buffer first." << LL_ENDL; } if (target.mUseDepth) { - llerrs << "Attempting to override existing shared depth buffer. Detach existing buffer first." << llendl; + LL_ERRS() << "Attempting to override existing shared depth buffer. Detach existing buffer first." << LL_ENDL; } if (mDepth) @@ -481,7 +481,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const { if (attachment > mTex.size()-1) { - llerrs << "Invalid attachment index." << llendl; + LL_ERRS() << "Invalid attachment index." << LL_ENDL; } if (mTex.empty()) { @@ -605,7 +605,7 @@ void LLRenderTarget::copyContents(LLRenderTarget& source, S32 srcX0, S32 srcY0, gGL.flush(); if (!source.mFBO || !mFBO) { - llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + LL_WARNS() << "Cannot copy framebuffer contents for non FBO render targets." << LL_ENDL; return; } @@ -660,7 +660,7 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0 { if (!source.mFBO) { - llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + LL_WARNS() << "Cannot copy framebuffer contents for non FBO render targets." << LL_ENDL; return; } { @@ -783,7 +783,7 @@ bool LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth if(color_fmt != GL_RGBA) { - llwarns << "Unsupported color format: " << color_fmt << llendl; + LL_WARNS() << "Unsupported color format: " << color_fmt << LL_ENDL; return false; } @@ -887,7 +887,7 @@ bool LLMultisampleBuffer::addColorAttachment(U32 color_fmt) if (offset >= 4 || (offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers))) { - llerrs << "Too many color attachments!" << llendl; + LL_ERRS() << "Too many color attachments!" << LL_ENDL; } U32 tex; @@ -898,7 +898,7 @@ bool LLMultisampleBuffer::addColorAttachment(U32 color_fmt) glRenderbufferStorageMultisample(GL_RENDERBUFFER, mSamples, color_fmt, mResX, mResY); if (glGetError() != GL_NO_ERROR) { - llwarns << "Unable to allocate color buffer for multisample render target." << llendl; + LL_WARNS() << "Unable to allocate color buffer for multisample render target." << LL_ENDL; release(); return false; } @@ -934,7 +934,7 @@ bool LLMultisampleBuffer::allocateDepth() if (glGetError() != GL_NO_ERROR) { - llwarns << "Unable to allocate depth buffer for multisample render target." << llendl; + LL_WARNS() << "Unable to allocate depth buffer for multisample render target." << LL_ENDL; return false; } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 7181f1e05..f7496140c 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -601,7 +601,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { //should NEVER get here -- if major version is 1 and minor version is less than 10, // viewer should never attempt to use shaders, continuing will result in undefined behavior - llerrs << "Unsupported GLSL Version." << llendl; + LL_ERRS() << "Unsupported GLSL Version." << LL_ENDL; } if (minor_version <= 19) @@ -786,7 +786,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade else { //should never get here. Indexed texture rendering requires GLSL 1.30 or later // (for passing integers between vertex and fragment shaders) - llerrs << "Indexed texture rendering requires GLSL 1.30 or later." << llendl; + LL_ERRS() << "Indexed texture rendering requires GLSL 1.30 or later." << LL_ENDL; } } else @@ -875,13 +875,13 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (i % 128 == 0) { //dump every 128 lines - LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl; + LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL; ostr = std::stringstream(); } } - LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl; + LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL; #else std::string str; @@ -890,7 +890,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (i % 128 == 0) { - LL_WARNS("ShaderLoading") << str << llendl; + LL_WARNS("ShaderLoading") << str << LL_ENDL; str = ""; } } @@ -1273,7 +1273,7 @@ void LLShaderMgr::initAttribsAndUniforms() { if (dupe_check.find(mReservedUniforms[i]) != dupe_check.end()) { - llerrs << "Duplicate reserved uniform name found: " << mReservedUniforms[i] << llendl; + LL_ERRS() << "Duplicate reserved uniform name found: " << mReservedUniforms[i] << LL_ENDL; } dupe_check.insert(mReservedUniforms[i]); } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 00f4e3dff..1d02fa44a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -486,7 +486,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } else { - llerrs << "Bad client state! " << array[i] << " disabled." << llendl; + LL_ERRS() << "Bad client state! " << array[i] << " disabled." << LL_ENDL; } } } @@ -505,7 +505,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } else { - llerrs << "Bad client state! " << array[i] << " enabled." << llendl; + LL_ERRS() << "Bad client state! " << array[i] << " enabled." << LL_ENDL; } } } @@ -571,13 +571,13 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector& pos, con if( count == 0 ) { - llwarns << "Called drawArrays with 0 vertices" << llendl; + LL_WARNS() << "Called drawArrays with 0 vertices" << LL_ENDL; return; } if( norm.size() < pos.size() ) { - llwarns << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << llendl; + LL_WARNS() << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << LL_ENDL; return; } @@ -643,7 +643,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of if (start >= (U32) mNumVerts || end >= (U32) mNumVerts) { - llerrs << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << llendl; + LL_ERRS() << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << LL_ENDL; } llassert(mNumIndices >= 0); @@ -651,7 +651,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of if (indices_offset >= (U32) mNumIndices || indices_offset + count > (U32) mNumIndices) { - llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl; + LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset + count << "]" << LL_ENDL; } if (gDebugGL && !useVBOs()) @@ -661,7 +661,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of { if (idx[i] < start || idx[i] > end) { - llerrs << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << llendl; + LL_ERRS() << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << LL_ENDL; } } @@ -679,7 +679,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of S32 idx = (S32) (v[i][3]+0.25f); if (idx < 0 || idx >= shader->mFeatures.mIndexedTextureChannels) { - llerrs << "Bad texture index found in vertex data stream." << llendl; + LL_ERRS() << "Bad texture index found in vertex data stream." << LL_ENDL; } } } @@ -699,19 +699,19 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi { if (mGLArray != sGLRenderArray) { - llerrs << "Wrong vertex array bound." << llendl; + LL_ERRS() << "Wrong vertex array bound." << LL_ENDL; } } else { if (mGLIndices != sGLRenderIndices) { - llerrs << "Wrong index buffer bound." << llendl; + LL_ERRS() << "Wrong index buffer bound." << LL_ENDL; } if (mGLBuffer != sGLRenderBuffer) { - llerrs << "Wrong vertex buffer bound." << llendl; + LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL; } } @@ -722,13 +722,13 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi if (elem != mGLIndices) { - llerrs << "Wrong index buffer bound!" << llendl; + LL_ERRS() << "Wrong index buffer bound!" << LL_ENDL; } } if (mode >= LLRender::NUM_MODES) { - llerrs << "Invalid draw mode: " << mode << llendl; + LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL; return; } @@ -751,32 +751,32 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const if (indices_offset >= (U32) mNumIndices || indices_offset + count > (U32) mNumIndices) { - llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl; + LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset + count << "]" << LL_ENDL; } if (mGLArray) { if (mGLArray != sGLRenderArray) { - llerrs << "Wrong vertex array bound." << llendl; + LL_ERRS() << "Wrong vertex array bound." << LL_ENDL; } } else { if (mGLIndices != sGLRenderIndices) { - llerrs << "Wrong index buffer bound." << llendl; + LL_ERRS() << "Wrong index buffer bound." << LL_ENDL; } if (mGLBuffer != sGLRenderBuffer) { - llerrs << "Wrong vertex buffer bound." << llendl; + LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL; } } if (mode >= LLRender::NUM_MODES) { - llerrs << "Invalid draw mode: " << mode << llendl; + LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL; return; } @@ -798,27 +798,27 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const if (first >= (U32) mNumVerts || first + count > (U32) mNumVerts) { - llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl; + LL_ERRS() << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << LL_ENDL; } if (mGLArray) { if (mGLArray != sGLRenderArray) { - llerrs << "Wrong vertex array bound." << llendl; + LL_ERRS() << "Wrong vertex array bound." << LL_ENDL; } } else { if (mGLBuffer != sGLRenderBuffer || useVBOs() != sVBOActive) { - llerrs << "Wrong vertex buffer bound." << llendl; + LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL; } } if (mode >= LLRender::NUM_MODES) { - llerrs << "Invalid draw mode: " << mode << llendl; + LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL; return; } @@ -1241,7 +1241,7 @@ void LLVertexBuffer::updateNumVerts(S32 nverts) if (nverts > 65536) { - llwarns << "Vertex buffer overflow!" << llendl; + LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL; nverts = 65536; } @@ -1280,7 +1280,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) if (nverts < 0 || nindices < 0 || nverts > 65536) { - llwarns << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl; + LL_WARNS() << "Bad vertex buffer allocation: " << nverts << " : " << nindices << LL_ENDL; } updateNumVerts(nverts); @@ -1474,11 +1474,11 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo bindGLBuffer(true); if (mFinal) { - llerrs << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << llendl; + LL_ERRS() << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << LL_ENDL; } if (!useVBOs() && !mMappedData && !mMappedIndexData) { - llerrs << "LLVertexBuffer::mapVertexBuffer() called on unallocated buffer." << llendl; + LL_ERRS() << "LLVertexBuffer::mapVertexBuffer() called on unallocated buffer." << LL_ENDL; } if (useVBOs()) @@ -1515,7 +1515,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo if (mVertexLocked && map_range) { - llerrs << "Attempted to map a specific range of a buffer that was already mapped." << llendl; + LL_ERRS() << "Attempted to map a specific range of a buffer that was already mapped." << LL_ENDL; } if (!mVertexLocked) @@ -1557,7 +1557,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo if (size < mSize) { - llerrs << "Invalid buffer size." << llendl; + LL_ERRS() << "Invalid buffer size." << LL_ENDL; } } @@ -1606,25 +1606,25 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo { //-------------------- //print out more debug info before crash - llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl; + LL_INFOS() << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << LL_ENDL; GLint size; glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); - llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl; + LL_INFOS() << "GL_ARRAY_BUFFER_ARB size is " << size << LL_ENDL; //-------------------- GLint buff; glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLBuffer) { - llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + LL_ERRS() << "Invalid GL vertex buffer bound: " << buff << LL_ENDL; } - llerrs << "glMapBuffer returned NULL (no vertex data)" << llendl; + LL_ERRS() << "glMapBuffer returned NULL (no vertex data)" << LL_ENDL; } else { - llerrs << "memory allocation for vertex data failed." << llendl; + LL_ERRS() << "memory allocation for vertex data failed." << LL_ENDL; } } } @@ -1653,11 +1653,11 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range bindGLIndices(true); if (mFinal) { - llerrs << "LLVertexBuffer::mapIndexBuffer() called on a finalized buffer." << llendl; + LL_ERRS() << "LLVertexBuffer::mapIndexBuffer() called on a finalized buffer." << LL_ENDL; } if (!useVBOs() && !mMappedData && !mMappedIndexData) { - llerrs << "LLVertexBuffer::mapIndexBuffer() called on unallocated buffer." << llendl; + LL_ERRS() << "LLVertexBuffer::mapIndexBuffer() called on unallocated buffer." << LL_ENDL; } if (useVBOs()) @@ -1691,7 +1691,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range if (mIndexLocked && map_range) { - llerrs << "Attempted to map a specific range of a buffer that was already mapped." << llendl; + LL_ERRS() << "Attempted to map a specific range of a buffer that was already mapped." << LL_ENDL; } if (!mIndexLocked) @@ -1707,7 +1707,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range if (elem != mGLIndices) { - llerrs << "Wrong index buffer bound!" << llendl; + LL_ERRS() << "Wrong index buffer bound!" << LL_ENDL; } } @@ -1783,14 +1783,14 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); if ((GLuint)buff != mGLIndices) { - llerrs << "Invalid GL index buffer bound: " << buff << llendl; + LL_ERRS() << "Invalid GL index buffer bound: " << buff << LL_ENDL; } - llerrs << "glMapBuffer returned NULL (no index data)" << llendl; + LL_ERRS() << "glMapBuffer returned NULL (no index data)" << LL_ENDL; } else { - llerrs << "memory allocation for Index data failed. " << llendl; + LL_ERRS() << "memory allocation for Index data failed. " << LL_ENDL; } } } @@ -1984,7 +1984,7 @@ template struct VertexBufferStrider if (ptr == NULL) { - llwarns << "mapIndexBuffer failed!" << llendl; + LL_WARNS() << "mapIndexBuffer failed!" << LL_ENDL; return false; } @@ -2000,7 +2000,7 @@ template struct VertexBufferStrider if (ptr == NULL) { - llwarns << "mapVertexBuffer failed!" << llendl; + LL_WARNS() << "mapVertexBuffer failed!" << LL_ENDL; return false; } @@ -2010,7 +2010,7 @@ template struct VertexBufferStrider } else { - llwarns << "VertexBufferStrider could not find valid vertex data." << llendl; + LL_WARNS() << "VertexBufferStrider could not find valid vertex data." << LL_ENDL; } return false; } @@ -2117,7 +2117,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) //LLFastTimer t(FTM_BIND_GL_BUFFER); /*if (sMapped) { - llerrs << "VBO bound while another VBO mapped!" << llendl; + LL_ERRS() << "VBO bound while another VBO mapped!" << LL_ENDL; }*/ glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); sGLRenderBuffer = mGLBuffer; @@ -2148,7 +2148,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind) LLFastTimer t(FTM_BIND_GL_INDICES); /*if (sMapped) { - llerrs << "VBO bound while another VBO mapped!" << llendl; + LL_ERRS() << "VBO bound while another VBO mapped!" << LL_ENDL; }*/ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices); sGLRenderIndices = mGLIndices; @@ -2200,7 +2200,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) U32 required = 1 << i; if ((data_mask & required) == 0) { - llwarns << "Missing attribute: " << LLShaderMgr::instance()->mReservedAttribs[i] << llendl; + LL_WARNS() << "Missing attribute: " << LLShaderMgr::instance()->mReservedAttribs[i] << LL_ENDL; } required_mask |= required; @@ -2209,7 +2209,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if ((data_mask & required_mask) != required_mask) { - llerrs << "Shader consumption mismatches data provision." << llendl; + LL_ERRS() << "Shader consumption mismatches data provision." << LL_ENDL; } } } @@ -2241,7 +2241,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) } else { - llerrs << "Invalid GL vertex buffer bound: " << buff << llendl; + LL_ERRS() << "Invalid GL vertex buffer bound: " << buff << LL_ENDL; } } @@ -2256,7 +2256,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) } else { - llerrs << "Invalid GL index buffer bound: " << buff << llendl; + LL_ERRS() << "Invalid GL index buffer bound: " << buff << LL_ENDL; } } } @@ -2332,10 +2332,10 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) U32 mask = 1 << i; if (mask & data_mask && !(mask & mTypeMask)) { //bit set in data_mask, but not set in mTypeMask - llwarns << "Missing required component " << vb_type_name[i] << llendl; + LL_WARNS() << "Missing required component " << vb_type_name[i] << LL_ENDL; } } - llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl; + LL_ERRS() << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << LL_ENDL; } if (LLGLSLShader::sNoFixedFunction) diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 28008b767..1cebd96bd 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -115,7 +115,7 @@ public: const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) { - llerrs << "Illegal operation!" << llendl; + LL_ERRS() << "Illegal operation!" << LL_ENDL; return *this; } diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index 739eb61d4..3b4931341 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -186,7 +186,7 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) // Message: create text box using raw string, as text has been structure deliberately // Use size of created text box to generate dialog box size std::string msg = mNote->getMessage(); - llwarns << "Alert: " << msg << llendl; + LL_WARNS() << "Alert: " << msg << LL_ENDL; LLTextBox* msg_box = new LLTextBox( std::string("Alert message"), msg, (F32)MAX_ALLOWED_MSG_WIDTH, font ); const LLRect& text_rect = msg_box->getRect(); @@ -504,7 +504,7 @@ void LLAlertDialog::setEditTextArgs(const LLSD& edit_args) } else { - llwarns << "LLAlertDialog::setEditTextArgs called on dialog with no line editor" << llendl; + LL_WARNS() << "LLAlertDialog::setEditTextArgs called on dialog with no line editor" << LL_ENDL; } } diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 664f66b37..7e93d1052 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -525,7 +525,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) // We only handle the click if the click both started and ended within us getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } return TRUE; } @@ -741,7 +741,7 @@ void LLButton::draw() else { // no image - lldebugs << "No image for button " << getName() << llendl; + LL_DEBUGS() << "No image for button " << getName() << LL_ENDL; // draw it in pink so we can find it gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1 % alpha, FALSE); } @@ -958,7 +958,7 @@ void LLButton::setImageUnselected(LLPointer image) mImageUnselected = image; if (mImageUnselected.isNull()) { - llwarns << "Setting default button image for: " << getName() << " to NULL" << llendl; + LL_WARNS() << "Setting default button image for: " << getName() << " to NULL" << LL_ENDL; } } diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 60032acf3..65a03b0b5 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -167,7 +167,7 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * if (contents.find_first_not_of(" \n\t") != contents.npos) { - llerrs << "Legacy combo box item format used! Please convert to tags!" << llendl; + LL_ERRS() << "Legacy combo box item format used! Please convert to tags!" << LL_ENDL; } else { diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index f9ee54e9f..ef4325f5b 100644 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -178,7 +178,7 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent) LLView *childp = *child_iter; if (!childp->getVisible()) { - llwarns << "Incorrect visibility!" << llendl; + LL_WARNS() << "Incorrect visibility!" << LL_ENDL; } LLRect child_rect = childp->getRequiredRect(); child_height += child_rect.getHeight(); diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index fc29d4f45..929548137 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -351,13 +351,13 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) mDragLastScreenY += delta_y; getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" <setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 703f664bf..fbd2a646d 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -789,7 +789,7 @@ BOOL LLFloater::canSnapTo(const LLView* other_view) { if (NULL == other_view) { - llwarns << "other_view is NULL" << llendl; + LL_WARNS() << "other_view is NULL" << LL_ENDL; return FALSE; } @@ -2580,7 +2580,7 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor if (!result) { - llerrs << "Failed to construct floater " << name << llendl; + LL_ERRS() << "Failed to construct floater " << name << LL_ENDL; } applyRectControl(); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index e5242f7db..afcafdace 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -392,11 +392,11 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) { if (new_captor) { - llinfos << "New mouse captor: " << new_captor->getName() << llendl; + LL_INFOS() << "New mouse captor: " << new_captor->getName() << LL_ENDL; } else { - llinfos << "New mouse captor: NULL" << llendl; + LL_INFOS() << "New mouse captor: NULL" << LL_ENDL; } } diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h index 31d48084b..2cba7f2cd 100644 --- a/indra/llui/llfunctorregistry.h +++ b/indra/llui/llfunctorregistry.h @@ -81,7 +81,7 @@ public: } else { - llerrs << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << llendl; + LL_ERRS() << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << LL_ENDL; retval = false; } @@ -92,7 +92,7 @@ public: { if (mMap.count(name) == 0) { - llwarns << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << llendl; + LL_WARNS() << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << LL_ENDL; return false; } mMap.erase(name); @@ -107,7 +107,7 @@ public: } else { - llwarns << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << llendl; + LL_WARNS() << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << LL_ENDL; return mMap[LOGFUNCTOR]; } } @@ -119,7 +119,7 @@ private: static void log_functor(const LLSD& notification, const LLSD& payload) { - llwarns << "log_functor called with payload: " << payload << llendl; + LL_WARNS() << "log_functor called with payload: " << payload << LL_ENDL; } static void do_nothing(const LLSD& notification, const LLSD& payload) diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index e3a2795fb..2d3e23e67 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -100,7 +100,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file.open(filename); /* Flawfinder: ignore */ if( file.fail() ) { - llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl; + LL_INFOS() << "LLKeywords::loadFromFile() Unable to open file: " << filename << LL_ENDL; return mLoaded; } @@ -108,7 +108,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file >> buffer; if( strcmp( buffer, "llkeywords" ) ) { - llinfos << filename << " does not appear to be a keyword file" << llendl; + LL_INFOS() << filename << " does not appear to be a keyword file" << LL_ENDL; return mLoaded; } @@ -118,7 +118,7 @@ BOOL LLKeywords::loadFromFile( const std::string& filename ) file >> version_num; if( strcmp(buffer, "version") || version_num != (U32)KEYWORD_FILE_CURRENT_VERSION ) { - llinfos << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << llendl; + LL_INFOS() << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << LL_ENDL; return mLoaded; } @@ -348,7 +348,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) S32 values_read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b ); if( values_read != 3 ) { - llinfos << " poorly formed color in keyword file" << llendl; + LL_INFOS() << " poorly formed color in keyword file" << LL_ENDL; } return LLColor3( r, g, b ); } @@ -560,7 +560,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW S32 seg_start = cur - base; S32 seg_end = seg_start + seg_len; - // llinfos << "Seg: [" << word.c_str() << "]" << llendl; + // LL_INFOS() << "Seg: [" << word.c_str() << "]" << LL_ENDL; LLTextSegmentPtr text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); @@ -605,10 +605,10 @@ void LLKeywords::insertSegment(std::vector& seg_list, LLTextSe #ifdef _DEBUG void LLKeywords::dump() { - llinfos << "LLKeywords" << llendl; + LL_INFOS() << "LLKeywords" << LL_ENDL; - llinfos << "LLKeywords::sWordTokenMap" << llendl; + LL_INFOS() << "LLKeywords::sWordTokenMap" << LL_ENDL; word_token_map_t::iterator word_token_iter = mWordTokenMap.begin(); while( word_token_iter != mWordTokenMap.end() ) { @@ -617,7 +617,7 @@ void LLKeywords::dump() ++word_token_iter; } - llinfos << "LLKeywords::sLineTokenList" << llendl; + LL_INFOS() << "LLKeywords::sLineTokenList" << LL_ENDL; for (token_list_t::iterator iter = mLineTokenList.begin(); iter != mLineTokenList.end(); ++iter) { @@ -626,7 +626,7 @@ void LLKeywords::dump() } - llinfos << "LLKeywords::sDelimiterTokenList" << llendl; + LL_INFOS() << "LLKeywords::sDelimiterTokenList" << LL_ENDL; for (token_list_t::iterator iter = mDelimiterTokenList.begin(); iter != mDelimiterTokenList.end(); ++iter) { @@ -637,12 +637,12 @@ void LLKeywords::dump() void LLKeywordToken::dump() { - llinfos << "[" << + LL_INFOS() << "[" << mColor.mV[VX] << ", " << mColor.mV[VY] << ", " << mColor.mV[VZ] << "] [" << wstring_to_utf8str(mToken) << "]" << - llendl; + LL_ENDL; } #endif // DEBUG diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index fde54de87..e724dfb54 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -276,7 +276,7 @@ void LLLayoutStack::draw() // Check for bogus rectangle if (!panelp->getRect().isValid()) { - llwarns << "Bogus rectangle for " << panelp->getName() << " with " << panelp->getRect() << llendl; + LL_WARNS() << "Bogus rectangle for " << panelp->getName() << " with " << panelp->getRect() << LL_ENDL; } } LLUI::popMatrix(); @@ -290,7 +290,7 @@ void LLLayoutStack::draw() // Check for bogus rectangle if (!getRect().isValid()) { - llwarns << "Bogus rectangle for " << getName() << " with " << getRect() << llendl; + LL_WARNS() << "Bogus rectangle for " << getName() << " with " << getRect() << LL_ENDL; } } } @@ -951,7 +951,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor } else { - llwarns << "Unknown orientation " << orientation_string << ", using vertical" << llendl; + LL_WARNS() << "Unknown orientation " << orientation_string << ", using vertical" << LL_ENDL; } BOOL clip = false; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 04bd6ee0c..57cdb8462 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -463,7 +463,7 @@ void LLLineEditor::spell_correct(void* data) LLLineEditor* line = tempBind->origin; if(tempBind && line) { - llinfos << ((LLMenuItemCallGL *)(tempBind->menuItem))->getName() << " : " << tempBind->origin->getName() << " : " << tempBind->word << llendl; + LL_INFOS() << ((LLMenuItemCallGL *)(tempBind->menuItem))->getName() << " : " << tempBind->origin->getName() << " : " << tempBind->word << LL_ENDL; if(line)line->spellReplace(tempBind); } } @@ -486,7 +486,7 @@ std::vector LLLineEditor::getMisspelledWordsPositions() std::vector thePosesOfBadWords; const LLWString& text = mText.getWString(); - //llinfos << "end of box is at " << cursorloc << " and end of text is at " << text.length() << llendl; + //LL_INFOS() << "end of box is at " << cursorloc << " and end of text is at " << text.length() << LL_ENDL; S32 wordStart=0; S32 wordEnd=mStartSpellHere; while(wordEnd < mEndSpellHere) @@ -728,7 +728,7 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - // llinfos << "MiddleMouseDown" << llendl; + // llinfo << "MiddleMouseDown" << LL_ENDL; setFocus( TRUE ); if( canPastePrimary() ) { @@ -797,14 +797,14 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) mKeystrokeTimer.reset(); getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; handled = TRUE; } if( !handled ) { getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } @@ -1357,7 +1357,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) case KEY_BACKSPACE: if (!mReadOnly) { - //llinfos << "Handling backspace" << llendl; + //LL_INFOS() << "Handling backspace" << LL_ENDL; if( hasSelection() ) { deleteSelection(); @@ -2837,7 +2837,7 @@ void LLLineEditor::resetPreedit() { if (hasSelection()) { - llwarns << "Preedit and selection!" << llendl; + LL_WARNS() << "Preedit and selection!" << LL_ENDL; deselect(); } @@ -2994,7 +2994,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length) setCursor(position); if (hasPreeditString()) { - llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl; + LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL; } mPreeditWString.assign( LLWString( mText.getWString(), position, length ) ); if (length > 0) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 086574e09..7470f5d5b 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -158,7 +158,7 @@ LLMenuItemGL::LLMenuItemGL( const std::string& name, const std::string& label, K LLMenuItemGL::~LLMenuItemGL() { - lldebugs << "Menu destroyed:" << this->getName() << llendl; + LL_DEBUGS() << "Menu destroyed:" << this->getName() << LL_ENDL; }; // virtual @@ -1160,7 +1160,7 @@ void LLMenuItemToggleGL::buildDrawLabel( void ) void LLMenuItemToggleGL::onCommit( void ) { getMenu()->setItemLastSelected( this ); - //llinfos << "LLMenuItemToggleGL::onCommit " << mLabel.c_str() << llendl; + //LL_INFOS() << "LLMenuItemToggleGL::onCommit " << mLabel.c_str() << LL_ENDL; *mToggle = !(*mToggle); buildDrawLabel(); LLMenuItemGL::onCommit(); @@ -1174,7 +1174,7 @@ LLMenuItemBranchGL::LLMenuItemBranchGL( const std::string& name, const std::stri LLMenuGL* branch = dynamic_cast(branch_handle.get()); if(!branch) { - llerrs << "Non-menu handle passed as branch reference." << llendl; + LL_ERRS() << "Non-menu handle passed as branch reference." << LL_ENDL; } if (branch) @@ -1393,7 +1393,7 @@ void LLMenuItemBranchGL::handleVisibilityChange( BOOL new_visibility ) { if (new_visibility == FALSE && getBranch() && !getBranch()->getTornOff()) { - lldebugs << "Forcing branch to visible. Menu: " << getName() << " Branch: " << getBranch()->getName() << llendl; + LL_DEBUGS() << "Forcing branch to visible. Menu: " << getName() << " Branch: " << getBranch()->getName() << LL_ENDL; getBranch()->setVisible(FALSE); } LLMenuItemGL::handleVisibilityChange(new_visibility); @@ -2214,7 +2214,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory if (!callback) { - lldebugs << "Ignoring \"on_check\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + LL_DEBUGS() << "Ignoring \"on_check\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << LL_ENDL; continue; } @@ -2259,7 +2259,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory if (!callback) { - lldebugs << "Ignoring \"on_click\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + LL_DEBUGS() << "Ignoring \"on_click\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << LL_ENDL; continue; } @@ -2293,7 +2293,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory if (!callback) { - lldebugs << "Ignoring \"on_enable\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + LL_DEBUGS() << "Ignoring \"on_enable\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << LL_ENDL; continue; } @@ -2337,7 +2337,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory if (!callback) { - lldebugs << "Ignoring \"on_visible\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + LL_DEBUGS() << "Ignoring \"on_visible\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << LL_ENDL; continue; } @@ -2366,17 +2366,17 @@ bool LLMenuGL::addChild(LLView* view, S32 tab_group) { if (LLMenuGL* menup = dynamic_cast(view)) { - lldebugs << "Adding menu " << menup->getName() << " to " << getName() << llendl; + LL_DEBUGS() << "Adding menu " << menup->getName() << " to " << getName() << LL_ENDL; appendMenu(menup); return true; } else if (LLMenuItemGL* itemp = dynamic_cast(view)) { - lldebugs << "Adding " << itemp->getName() << " to " << getName() << llendl; + LL_DEBUGS() << "Adding " << itemp->getName() << " to " << getName() << LL_ENDL; append(itemp); return true; } - lldebugs << "Error adding unknown child '"<<(view ? view->getName() : std::string("NULL")) << "' to " << getName() << llendl; + LL_DEBUGS() << "Error adding unknown child '"<<(view ? view->getName() : std::string("NULL")) << "' to " << getName() << LL_ENDL; return false; } @@ -2619,7 +2619,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction) } default: //LL_WARNS() << "Unknown scrolling direction: " << direction << LL_ENDL; - llwarns << "Unknown scrolling direction: " << direction << llendl; + LL_WARNS() << "Unknown scrolling direction: " << direction << LL_ENDL; } mNeedsArrange = TRUE; @@ -3214,8 +3214,8 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu ) { if( menu == this ) { - llerrs << "** Attempt to attach menu to itself. This is certainly " - << "a logic error." << llendl; + LL_ERRS() << "** Attempt to attach menu to itself. This is certainly " + << "a logic error." << LL_ENDL; } BOOL success = TRUE; @@ -3707,7 +3707,7 @@ void LLMenuGL::setVisible(BOOL visible) { if (!visible) { - lldebugs << "Hiding " << getName() << llendl; + LL_DEBUGS() << "Hiding " << getName() << LL_ENDL; mFadeTimer.start(); clearHoverItem(); // reset last known mouse coordinates so @@ -3717,7 +3717,7 @@ void LLMenuGL::setVisible(BOOL visible) } else { - lldebugs << "Showing " << getName() << llendl; + LL_DEBUGS() << "Showing " << getName() << LL_ENDL; mHasSelection = true; mFadeTimer.stop(); } @@ -3743,7 +3743,7 @@ LLMenuGL* LLMenuGL::getChildMenuByName(const std::string& name, BOOL recurse) co return menup; } } - llwarns << "Child Menu " << name << " not found in menu " << getName() << llendl; + LL_WARNS() << "Child Menu " << name << " not found in menu " << getName() << LL_ENDL; return NULL; } @@ -4052,11 +4052,11 @@ void LLMenuBarGL::setVisible(BOOL visible) { if(!visible) { - lldebugs << "Hiding " << getName() << llendl; + LL_DEBUGS() << "Hiding " << getName() << LL_ENDL; } else { - lldebugs << "Showing " << getName() << llendl; + LL_DEBUGS() << "Showing " << getName() << LL_ENDL; } } LLUICtrl::setVisible(visible); @@ -4168,8 +4168,8 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu ) { if( menu == this ) { - llerrs << "** Attempt to attach menu to itself. This is certainly " - << "a logic error." << llendl; + LL_ERRS() << "** Attempt to attach menu to itself. This is certainly " + << "a logic error." << LL_ENDL; } BOOL success = TRUE; @@ -4886,7 +4886,6 @@ BOOL LLContextMenu::handleHoverOver(LLMenuItemGL* item, S32 x, S32 y) if (item && item->getEnabled()) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; handled = TRUE; if (item != mHoverItem) @@ -4913,7 +4912,6 @@ BOOL LLContextMenu::handleHoverOver(LLMenuItemGL* item, S32 x, S32 y) if( !handled && pointInView( x, y ) ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; handled = TRUE; } @@ -4989,7 +4987,7 @@ BOOL LLContextMenu::appendContextSubMenu(LLContextMenu* menu) { if (menu == this) { - llerrs << "Can't attach a context menu to itself" << llendl; + LL_ERRS() << "Can't attach a context menu to itself" << LL_ENDL; } LLContextMenuBranch* item = new LLContextMenuBranch(menu->getName(), menu->getLabel(), menu); getParent()->addChild(item->getBranch()); diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 4185aadb1..8d7b0fdbf 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -73,7 +73,7 @@ LLModalDialog::~LLModalDialog() std::list::iterator iter = std::find(sModalStack.begin(), sModalStack.end(), this); if (iter != sModalStack.end()) { - llerrs << "Attempt to delete dialog while still in sModalStack!" << llendl; + LL_ERRS() << "Attempt to delete dialog while still in sModalStack!" << LL_ENDL; } } @@ -115,7 +115,7 @@ void LLModalDialog::startModal() if (iter != sModalStack.end()) { sModalStack.erase(iter); - llwarns << "Dialog already on modal stack" << llendl; + LL_WARNS() << "Dialog already on modal stack" << LL_ENDL; //TODO: incvestigate in which specific cases it happens, cause that's not good! -SG } @@ -139,7 +139,7 @@ void LLModalDialog::stopModal() } else { - llwarns << "LLModalDialog::stopModal not in list!" << llendl; + LL_WARNS() << "LLModalDialog::stopModal not in list!" << LL_ENDL; } } if (!sModalStack.empty()) @@ -194,7 +194,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) if( childrenHandleHover(x, y, mask) == NULL ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL; } return TRUE; } diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 1db97fe7c..a15a1ec5f 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -239,7 +239,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, if (!mTabContainer) { - llerrs << "Tab Container used without having been initialized." << llendl; + LL_ERRS() << "Tab Container used without having been initialized." << LL_ENDL; return; } diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index 183a1245f..f4643fa9e 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -288,7 +288,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal) // stop if it's filled if(initVal == mInitialValue && !firstTry) { - llwarns << "Whoa! Too many multi slider elements to add one to" << llendl; + LL_WARNS() << "Whoa! Too many multi slider elements to add one to" << LL_ENDL; return false; } @@ -343,12 +343,12 @@ BOOL LLMultiSlider::handleHover(S32 x, S32 y, MASK mask) onCommit(); getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; } return TRUE; } diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 50da07787..7ef608470 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -391,7 +391,7 @@ void LLMultiSliderCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLMultiSliderCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLMultiSliderCtrl::setPrecision - precision out of range" << LL_ENDL; return; } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 29b146f59..3d66d0d36 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -90,12 +90,12 @@ private: void savePersistentNotifications() { - llinfos << "Saving open notifications to " << mFileName << llendl; + LL_INFOS() << "Saving open notifications to " << mFileName << LL_ENDL; llofstream notify_file(mFileName.c_str()); if (!notify_file.is_open()) { - llwarns << "Failed to open " << mFileName << llendl; + LL_WARNS() << "Failed to open " << mFileName << LL_ENDL; return; } @@ -121,12 +121,12 @@ private: void loadPersistentNotifications() { - llinfos << "Loading open notifications from " << mFileName << llendl; + LL_INFOS() << "Loading open notifications from " << mFileName << LL_ENDL; llifstream notify_file(mFileName.c_str()); if (!notify_file.is_open()) { - llwarns << "Failed to open " << mFileName << llendl; + LL_WARNS() << "Failed to open " << mFileName << LL_ENDL; return; } @@ -134,7 +134,7 @@ private: LLPointer parser = new LLSDXMLParser(); if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0) { - llwarns << "Failed to parse open notifications" << llendl; + LL_WARNS() << "Failed to parse open notifications" << LL_ENDL; return; } @@ -142,7 +142,7 @@ private: std::string version = input["version"]; if (version != NOTIFICATION_PERSIST_VERSION) { - llwarns << "Bad open notifications version: " << version << llendl; + LL_WARNS() << "Bad open notifications version: " << version << LL_ENDL; return; } LLSD& data = input["data"]; @@ -230,7 +230,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLXMLNodeP { if (!xml_node->hasName("form")) { - llwarns << "Bad xml node for form: " << xml_node->getName() << llendl; + LL_WARNS() << "Bad xml node for form: " << xml_node->getName() << LL_ENDL; } LLXMLNodePtr child = xml_node->getFirstChild(); while(child) @@ -284,7 +284,7 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd) } else { - llwarns << "Invalid form data " << sd << llendl; + LL_WARNS() << "Invalid form data " << sd << LL_ENDL; mFormData = LLSD::emptyArray(); } } @@ -891,7 +891,7 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt assert(!wasFound); if (passesFilter) { - llinfos << "Inserting " << pNotification->getName() << llendl; + LL_INFOS() << "Inserting " << pNotification->getName() << LL_ENDL; // not in our list, add it and say so mItems.insert(pNotification); abortProcessing = mChanged(payload); @@ -1109,7 +1109,7 @@ LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelN ChannelMap::iterator p = mChannels.find(channelName); if(p == mChannels.end()) { - llerrs << "Did not find channel named " << channelName << llendl; + LL_ERRS() << "Did not find channel named " << channelName << LL_ENDL; return LLNotificationChannelPtr(); } return p->second; @@ -1171,7 +1171,7 @@ bool LLNotificationTemplates::addTemplate(const std::string &name, { if (mTemplates.count(name)) { - llwarns << "LLNotifications -- attempted to add template '" << name << "' twice." << llendl; + LL_WARNS() << "LLNotifications -- attempted to add template '" << name << "' twice." << LL_ENDL; return false; } mTemplates[name] = theTemplate; @@ -1208,7 +1208,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op if (selected_item.isUndefined()) { - llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl; + LL_WARNS() << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL; return; } response[selected_item["name"].asString()] = true; @@ -1229,7 +1229,7 @@ LLNotificationTemplates::TemplateNames LLNotificationTemplates::getTemplateNames typedef std::map StringMap; void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements) { - //llwarns << "replaceSubstitutionStrings" << llendl; + //LL_WARNS() << "replaceSubstitutionStrings" << LL_ENDL; // walk the list of attributes looking for replacements for (LLXMLAttribList::iterator it=node->mAttributes.begin(); it != node->mAttributes.end(); ++it) @@ -1243,13 +1243,13 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements) if (found != replacements.end()) { replacement = found->second; - //llinfos << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl; + //LL_INFOS() << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL; it->second->setValue(replacement); } else { - llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl; + LL_WARNS() << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL; } } } @@ -1288,7 +1288,7 @@ LLXMLNodePtr LLNotificationTemplates::checkForXMLTemplate(LLXMLNodePtr item) } else { - llwarns << "XML template lookup failure on '" << replacementName << "' " << llendl; + LL_WARNS() << "XML template lookup failure on '" << replacementName << "' " << LL_ENDL; } } } @@ -1304,7 +1304,7 @@ bool LLNotificationTemplates::loadTemplates() if (!success || root.isNull() || !root->hasName( "notifications" )) { - llerrs << "Problem reading UI Notifications file: " << xml_filename << llendl; + LL_ERRS() << "Problem reading UI Notifications file: " << xml_filename << LL_ENDL; return false; } @@ -1336,8 +1336,8 @@ bool LLNotificationTemplates::loadTemplates() if (!item->hasName("notification")) { - llwarns << "Unexpected entity " << item->getName()->mString << - " found in " << xml_filename << llendl; + LL_WARNS() << "Unexpected entity " << item->getName()->mString << + " found in " << xml_filename << LL_ENDL; continue; } } @@ -1354,7 +1354,7 @@ bool LLNotifications::loadNotifications() if (!success || root.isNull() || !root->hasName( "notifications" )) { - llerrs << "Problem reading UI Notifications file: " << xml_filename << llendl; + LL_ERRS() << "Problem reading UI Notifications file: " << xml_filename << LL_ENDL; return false; } @@ -1374,11 +1374,11 @@ bool LLNotifications::loadNotifications() if (!item->getAttributeString("name", pTemplate->mName)) { - llwarns << "Unable to parse notification with no name" << llendl; + LL_WARNS() << "Unable to parse notification with no name" << LL_ENDL; continue; } - //llinfos << "Parsing " << pTemplate->mName << llendl; + //LL_INFOS() << "Parsing " << pTemplate->mName << LL_ENDL; pTemplate->mMessage = item->getTextContents(); pTemplate->mDefaultFunctor = pTemplate->mName; @@ -1436,12 +1436,12 @@ bool LLNotifications::loadNotifications() std::string key; formitem->getAttributeString("key", key); pTemplate->mUniqueContext.push_back(key); - //llwarns << "adding " << key << " to unique context" << llendl; + //LL_WARNS() << "adding " << key << " to unique context" << LL_ENDL; } else { - llwarns << "'unique' has unrecognized subelement " - << formitem->getName()->mString << llendl; + LL_WARNS() << "'unique' has unrecognized subelement " + << formitem->getName()->mString << LL_ENDL; } } } @@ -1457,7 +1457,7 @@ bool LLNotifications::loadNotifications() //std::ostringstream ostream; //root->writeToOstream(ostream, "\n "); - //llwarns << ostream.str() << llendl; + //LL_WARNS() << ostream.str() << LL_ENDL; return true; } @@ -1630,7 +1630,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif) LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { - llerrs << "Notification added a second time to the master notification channel." << llendl; + LL_ERRS() << "Notification added a second time to the master notification channel." << LL_ENDL; } UpdateItemSM::add(UpdateItem("add", pNotif)); @@ -1644,7 +1644,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) LLNotificationSet::iterator it=mItems.find(pNotif); if (it == mItems.end()) { - llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl; + LL_ERRS() << "Attempted to delete nonexistent notification " << pNotif->getName() << LL_ENDL; } UpdateItemSM::add(UpdateItem("delete", pNotif)); } @@ -1667,7 +1667,7 @@ LLNotificationPtr LLNotifications::find(LLUUID const& uuid) LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { - llwarns << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl; + LL_WARNS() << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL; return LLNotificationPtr((LLNotification*)NULL); } else diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 66d09954d..005e23268 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -343,8 +343,8 @@ BOOL LLPanel::checkRequirements() args["COMPONENTS"] = mRequirementsError; args["FLOATER"] = getName(); - llwarns << getName() << " failed requirements check on: \n" - << mRequirementsError << llendl; + LL_WARNS() << getName() << " failed requirements check on: \n" + << mRequirementsError << LL_ENDL; LLNotifications::instance().add(LLNotification::Params("FailedRequirementsCheck").payload(args)); mRequirementsError.clear(); @@ -630,11 +630,11 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form //if(LLUI::sConfigGroup->getBOOL("QAMode")) if(LLUI::sQAMode) { - llerrs << err_str << llendl; + LL_ERRS() << err_str << LL_ENDL; } else { - llwarns << err_str << llendl; + LL_WARNS() << err_str << LL_ENDL; } return LLStringUtil::null; } @@ -649,11 +649,11 @@ std::string LLPanel::getString(const std::string& name) const std::string err_str("Failed to find string " + name + " in panel " + getName()); // *TODO: Translate if(LLUI::sQAMode) { - llerrs << err_str << llendl; + LL_ERRS() << err_str << LL_ENDL; } else { - llwarns << err_str << llendl; + LL_WARNS() << err_str << LL_ENDL; } return LLStringUtil::null; } diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 544966479..0cdaffff6 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -314,7 +314,7 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl) index++; } - llwarns << "LLRadioGroup::onClickButton - clicked button that isn't a child" << llendl; + LL_WARNS() << "LLRadioGroup::onClickButton - clicked button that isn't a child" << LL_ENDL; } void LLRadioGroup::setValue( const LLSD& value ) @@ -433,7 +433,7 @@ LLView* LLRadioGroup::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory radio_group->addRadioButton(std::string("radio"), line, rect, font); ++token_iter; } - llwarns << "Legacy radio group format used! Please convert to use tags!" << llendl; + LL_WARNS() << "Legacy radio group format used! Please convert to use tags!" << LL_ENDL; } else { diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 76cd4a5e3..0d2aa393e 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -157,10 +157,10 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) case LLLOCALE_USA: //#if LL_WINDOWS // // Windows doesn't use ISO country codes. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-usa" ) << llendl; +// LL_INFOS() << "Setting locale to " << setlocale( LC_ALL, "english-usa" ) << LL_ENDL; //#else // // posix version should work everywhere else. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_US" ) << llendl; +// LL_INFOS() << "Setting locale to " << setlocale( LC_ALL, "en_US" ) << LL_ENDL; //#endif // mStrings = mUSAStrings; @@ -169,10 +169,10 @@ void LLResMgr::setLocale( LLLOCALE_ID locale_id ) case LLLOCALE_UK: //#if LL_WINDOWS // // Windows doesn't use ISO country codes. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-uk" ) << llendl; +// LL_INFOS() << "Setting locale to " << setlocale( LC_ALL, "english-uk" ) << LL_ENDL; //#else // // posix version should work everywhere else. -// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_GB" ) << llendl; +// LL_INFOS() << "Setting locale to " << setlocale( LC_ALL, "en_GB" ) << LL_ENDL; //#endif // mStrings = mUKStrings; @@ -469,13 +469,13 @@ LLLocale::LLLocale(const std::string& locale_string) char* new_locale_string = setlocale( LC_ALL, locale_string.c_str()); if ( new_locale_string == NULL && PrevFailedLocaleString != locale_string ) { - llwarns << "Failed to set locale " << locale_string.c_str() << llendl; + LL_WARNS() << "Failed to set locale " << locale_string.c_str() << LL_ENDL; setlocale(LC_ALL, SYSTEM_LOCALE.c_str()); PrevFailedLocaleString = locale_string; } //else //{ - // llinfos << "Set locale to " << new_locale_string << llendl; + // LL_INFOS() << "Set locale to " << new_locale_string << LL_ENDL; //} } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index ca898a4d0..1b8fe5ce2 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -402,7 +402,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) } getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; handled = TRUE; } else @@ -414,7 +414,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; handled = TRUE; } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 7fa841b50..9f2cfb306 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -146,7 +146,7 @@ LLScrollContainer::~LLScrollContainer( void ) // virtual void LLScrollContainer::scrollHorizontal( S32 new_pos ) { - //llinfos << "LLScrollContainer::scrollHorizontal()" << llendl; + //LL_INFOS() << "LLScrollContainer::scrollHorizontal()" << LL_ENDL; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); @@ -158,7 +158,7 @@ void LLScrollContainer::scrollHorizontal( S32 new_pos ) // virtual void LLScrollContainer::scrollVertical( S32 new_pos ) { - // llinfos << "LLScrollContainer::scrollVertical() " << new_pos << llendl; + // LL_INFOS() << "LLScrollContainer::scrollVertical() " << new_pos << LL_ENDL; if( mScrolledView ) { LLRect doc_rect = mScrolledView->getRect(); @@ -648,7 +648,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const { if (!mScrolledView) { - llwarns << "LLScrollContainer::scrollToShowRect with no view!" << llendl; + LL_WARNS() << "LLScrollContainer::scrollToShowRect with no view!" << LL_ENDL; return; } @@ -786,7 +786,7 @@ LLView* LLScrollContainer::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa { if (panelp) { - llinfos << "Warning! Attempting to put multiple panels into a scrollable container view!" << llendl; + LL_INFOS() << "Warning! Attempting to put multiple panels into a scrollable container view!" << LL_ENDL; delete control; } else diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 014bb6956..915833bd0 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1424,7 +1424,7 @@ void LLScrollListCtrl::drawItems() mLineHeight ); item->setRect(item_rect); - //llinfos << item_rect.getWidth() << llendl; + //LL_INFOS() << item_rect.getWidth() << LL_ENDL; max_columns = llmax(max_columns, item->getNumColumns()); diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index fc48e2578..3abe322a9 100644 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -79,7 +79,7 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell ) } else { - llerrs << "LLScrollListItem::setColumn: bad column: " << column << llendl; + LL_ERRS() << "LLScrollListItem::setColumn: bad column: " << column << LL_ENDL; } } diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 893354252..14fa0cd0f 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -156,12 +156,12 @@ BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask) setValueAndCommit(t * (mMaxValue - mMinValue) + mMinValue ); getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; } else { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; } return TRUE; } diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 365f0b3d7..be2562e6d 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -340,7 +340,7 @@ void LLSliderCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLSliderCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLSliderCtrl::setPrecision - precision out of range" << LL_ENDL; return; } diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 213354f94..9c50c5402 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -384,7 +384,7 @@ void LLSpinCtrl::setPrecision(S32 precision) { if (precision < 0 || precision > 10) { - llerrs << "LLSpinCtrl::setPrecision - precision out of range" << llendl; + LL_ERRS() << "LLSpinCtrl::setPrecision - precision out of range" << LL_ENDL; return; } @@ -400,7 +400,7 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label) } else { - llwarns << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << llendl; + LL_WARNS() << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << LL_ENDL; } updateLabelColor(); } diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index bed37f2c0..751156a31 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -127,7 +127,7 @@ void LLStatBar::draw() { if (!mStatp) { -// llinfos << "No stats for statistics bar!" << llendl; +// LL_INFOS() << "No stats for statistics bar!" << LL_ENDL; return; } @@ -247,7 +247,7 @@ void LLStatBar::draw() if (left < 0) { left = 0; - llwarns << "Min:" << min << llendl; + LL_WARNS() << "Min:" << min << LL_ENDL; } right = (S32) ((max - mMinBar) * value_scale); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index c0e5b8052..fde1550ba 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1336,8 +1336,8 @@ BOOL LLTabContainer::selectTabByName(const std::string& name) LLPanel* panel = getPanelByName(name); if (!panel) { - llwarns << "LLTabContainer::selectTabByName(" - << name << ") failed" << llendl; + LL_WARNS() << "LLTabContainer::selectTabByName(" + << name << ") failed" << LL_ENDL; return FALSE; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 683d52d0d..83912db9c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -392,7 +392,7 @@ void LLTextEditor::spell_correct(void* data) LLTextEditor* line = tempBind->origin; if(tempBind && line) { - llinfos << tempBind->menuItem->getName() << " : " << tempBind->origin->getName() << " : " << tempBind->word << llendl; + LL_INFOS() << tempBind->menuItem->getName() << " : " << tempBind->origin->getName() << " : " << tempBind->word << LL_ENDL; if(line)line->spellReplace(tempBind); } } @@ -675,7 +675,7 @@ const std::string& LLTextEditor::getText() const { if (mAllowEmbeddedItems) { - llwarns << "getText() called on text with embedded items (not supported)" << llendl; + LL_WARNS() << "getText() called on text with embedded items (not supported)" << LL_ENDL; } mUTF8Text = wstring_to_utf8str(mWText); mTextIsUpToDate = TRUE; @@ -890,10 +890,10 @@ S32 LLTextEditor::getLineStart( S32 line ) const S32 res = seg->getStart() + segoffset; if (res > seg->getEnd()) { - //llerrs << "wtf" << llendl; + //LL_ERRS() << "wtf" << LL_ENDL; // This happens when creating a new notecard using the AO on certain opensims. // Play it safe instead of bringing down the viewer - MC - llwarns << "BAD JOOJOO! Text length (" << res << ") greater than text end (" << seg->getEnd() << "). Setting line start to " << seg->getEnd() << llendl; + LL_WARNS() << "BAD JOOJOO! Text length (" << res << ") greater than text end (" << seg->getEnd() << "). Setting line start to " << seg->getEnd() << LL_ENDL; res = seg->getEnd(); } return res; @@ -1499,7 +1499,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) mSelectionEnd = mCursorPos; } - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL; getWindow()->setCursor(UI_CURSOR_IBEAM); handled = TRUE; } @@ -1527,14 +1527,14 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) { if(cur_segment->getStyle()->isLink()) { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (over link, inactive)" << LL_ENDL; getWindow()->setCursor(UI_CURSOR_HAND); handled = TRUE; } else if(cur_segment->getStyle()->getIsEmbeddedItem()) { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (over embedded item, inactive)" << LL_ENDL; getWindow()->setCursor(UI_CURSOR_HAND); //getWindow()->setCursor(UI_CURSOR_ARROW); handled = TRUE; @@ -1545,7 +1545,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) if( !handled ) { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL; if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) { getWindow()->setCursor(UI_CURSOR_IBEAM); @@ -3489,7 +3489,7 @@ void LLTextEditor::drawText() seg_iter++; if (seg_iter == mSegments.end()) { - llwarns << "Ran off the segmentation end!" << llendl; + LL_WARNS() << "Ran off the segmentation end!" << LL_ENDL; return; } cur_segment = *seg_iter; @@ -4462,7 +4462,7 @@ void LLTextEditor::pruneSegments() } else { - llwarns << "Tried to erase end of empty LLTextEditor" << llendl; + LL_WARNS() << "Tried to erase end of empty LLTextEditor" << LL_ENDL; } } @@ -4606,20 +4606,20 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) instream.getline(tbuf, MAX_STRING); if( 1 != sscanf(tbuf, "Linden text version %d", &version) ) { - llwarns << "Invalid Linden text file header " << llendl; + LL_WARNS() << "Invalid Linden text file header " << LL_ENDL; return FALSE; } if( 1 != version ) { - llwarns << "Invalid Linden text file version: " << version << llendl; + LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL; return FALSE; } instream.getline(tbuf, MAX_STRING); if( 0 != sscanf(tbuf, "{") ) { - llwarns << "Invalid Linden text file format" << llendl; + LL_WARNS() << "Invalid Linden text file format" << LL_ENDL; return FALSE; } @@ -4627,13 +4627,13 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) instream.getline(tbuf, MAX_STRING); if( 1 != sscanf(tbuf, "Text length %d", &text_len) ) { - llwarns << "Invalid Linden text length field" << llendl; + LL_WARNS() << "Invalid Linden text length field" << LL_ENDL; return FALSE; } if( text_len > mMaxTextByteLength ) { - llwarns << "Invalid Linden text length: " << text_len << llendl; + LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL; return FALSE; } @@ -4642,21 +4642,21 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length ) char* text = new char[ text_len + 1]; if (text == NULL) { - llerrs << "Memory allocation failure." << llendl; + LL_ERRS() << "Memory allocation failure." << LL_ENDL; return FALSE; } instream.get(text, text_len + 1, '\0'); text[text_len] = '\0'; if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */ { - llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */ + LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */ success = FALSE; } instream.getline(tbuf, MAX_STRING); if( success && (0 != sscanf(tbuf, "}")) ) { - llwarns << "Invalid Linden text file format: missing terminal }" << llendl; + LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL; success = FALSE; } @@ -4747,13 +4747,13 @@ BOOL LLTextSegment::getToolTip(std::string& msg) const void LLTextSegment::dump() const { - llinfos << "Segment [" << + LL_INFOS() << "Segment [" << // mColor.mV[VX] << ", " << // mColor.mV[VY] << ", " << // mColor.mV[VZ] << "]\t[" << mStart << ", " << getEnd() << "]" << - llendl; + LL_ENDL; } @@ -5049,7 +5049,7 @@ void LLTextEditor::resetPreedit() { if (hasSelection()) { - llwarns << "Preedit and selection!" << llendl; + LL_WARNS() << "Preedit and selection!" << LL_ENDL; deselect(); } @@ -5238,7 +5238,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length) setCursorPos(position); if (hasPreeditString()) { - llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl; + LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL; } mPreeditWString = LLWString( mWText, position, length ); if (length > 0) diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index 4fda9d77e..df6cd77a8 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -50,7 +50,7 @@ bool LLTrans::parseStrings(const std::string& xml_filename, const std::sethasName( "strings" )) { - llerrs << "Problem reading strings: " << xml_filename << llendl; + LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL; return false; } @@ -67,7 +67,7 @@ bool LLTrans::parseStrings(const std::string& xml_filename, const std::setgetAttributeString("name", string_name)) { - llwarns << "Unable to parse string with no name" << llendl; + LL_WARNS() << "Unable to parse string with no name" << LL_ENDL; continue; } @@ -96,7 +96,7 @@ int const access_increment = 1000; static void log_sStringTemplates_accesses(void) { - lldebugs << "LLTrans::getString/findString called " << sStringTemplates_accesses << " in total." << llendl; + LL_DEBUGS() << "LLTrans::getString/findString called " << sStringTemplates_accesses << " in total." << LL_ENDL; } //static diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 722093628..42f617b21 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -79,7 +79,7 @@ void make_ui_sound(const char* namep) std::string name = ll_safe_string(namep); if (!LLUI::sConfigGroup->controlExists(name)) { - llwarns << "tried to make ui sound for unknown sound name: " << name << llendl; + LL_WARNS() << "tried to make ui sound for unknown sound name: " << name << LL_ENDL; } else { @@ -90,12 +90,12 @@ void make_ui_sound(const char* namep) { if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle")) { - llinfos << "ui sound name: " << name << " triggered but silent (null uuid)" << llendl; + LL_INFOS() << "ui sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL; } } else { - llwarns << "ui sound named: " << name << " does not translate to a valid uuid" << llendl; + LL_WARNS() << "ui sound named: " << name << " does not translate to a valid uuid" << LL_ENDL; } } @@ -103,7 +103,7 @@ void make_ui_sound(const char* namep) { if (LLUI::sConfigGroup->getBOOL("UISndDebugSpamToggle")) { - llinfos << "ui sound name: " << name << llendl; + LL_INFOS() << "ui sound name: " << name << LL_ENDL; } LLUI::sAudioCallback(uuid); } @@ -137,7 +137,7 @@ void LLUI::initClass(LLControlGroup* config, || sIgnoresGroup == NULL || sColorsGroup == NULL) { - llerrs << "Failure to initialize configuration groups" << llendl; + LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL; } sAudioCallback = audio_callback; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 1d3d7b33e..7cf54e95d 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -381,7 +381,7 @@ private: static void initClass() { - llerrs << "No static initClass() method defined for " << typeid(T).name() << llendl; + LL_ERRS() << "No static initClass() method defined for " << typeid(T).name() << LL_ENDL; } }; @@ -396,7 +396,7 @@ private: static void destroyClass() { - llerrs << "No static destroyClass() method defined for " << typeid(T).name() << llendl; + LL_ERRS() << "No static destroyClass() method defined for " << typeid(T).name() << LL_ENDL; } }; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index a44367725..0dc2be1db 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -235,7 +235,7 @@ LLUICtrl::~LLUICtrl() if( gFocusMgr.getTopCtrl() == this ) { - llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; + LL_WARNS() << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << LL_ENDL; gFocusMgr.removeTopCtrlWithoutCallback( this ); } @@ -281,7 +281,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa } else if (!function_name.empty()) { - llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl; + LL_WARNS() << "No callback found for: '" << function_name << "' in control: " << getName() << LL_ENDL; } } return default_commit_handler; diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 9cd8aa9d8..e980ecec2 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -158,7 +158,7 @@ void LLUICtrlFactory::setupPaths() { std::string slash = gDirUtilp->getDirDelimiter(); std::string dir = "xui" + slash + "en-us"; - llwarns << "XUI::config file unable to open: " << filename << llendl; + LL_WARNS() << "XUI::config file unable to open: " << filename << LL_ENDL; sXUIPaths.push_back(dir); } } @@ -184,14 +184,14 @@ bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNo } else { - llwarns << "Couldn't find UI description file: " << sXUIPaths.front() + gDirUtilp->getDirDelimiter() + xui_filename << llendl; + LL_WARNS() << "Couldn't find UI description file: " << sXUIPaths.front() + gDirUtilp->getDirDelimiter() + xui_filename << LL_ENDL; return false; } } if (!LLXMLNode::parseFile(full_filename, root, NULL)) { - llwarns << "Problem reading UI description file: " << full_filename << llendl; + LL_WARNS() << "Problem reading UI description file: " << full_filename << LL_ENDL; return false; } @@ -213,7 +213,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNo if (!LLXMLNode::parseFile(layer_filename, updateRoot, NULL)) { - llwarns << "Problem reading localized UI description file: " << (*itor) + gDirUtilp->getDirDelimiter() + xui_filename << llendl; + LL_WARNS() << "Problem reading localized UI description file: " << (*itor) + gDirUtilp->getDirDelimiter() + xui_filename << LL_ENDL; return false; } @@ -233,7 +233,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNo bool LLUICtrlFactory::getLayeredXMLNodeFromBuffer(const std::string &buffer, LLXMLNodePtr& root) { if (!LLXMLNode::parseBuffer((U8*)buffer.data(), buffer.size(), root, 0)) { - llwarns << "Error reading UI description from buffer." << llendl; + LL_WARNS() << "Error reading UI description from buffer." << LL_ENDL; return false; } return true; @@ -273,7 +273,7 @@ void LLUICtrlFactory::buildFloaterInternal(LLFloater *floaterp, LLXMLNodePtr &ro // root must be called floater if( !(root->hasName("floater") || root->hasName("multi_floater") ) ) { - llwarns << "Root node should be named floater in: " << filename << llendl; + LL_WARNS() << "Root node should be named floater in: " << filename << LL_ENDL; return; } @@ -324,7 +324,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) llofstream out(filename); if (!out.good()) { - llwarns << "Unable to open " << filename << " for output." << llendl; + LL_WARNS() << "Unable to open " << filename << " for output." << LL_ENDL; return 1; } @@ -373,7 +373,7 @@ BOOL LLUICtrlFactory::buildPanelInternal(LLPanel* panelp, LLXMLNodePtr &root, co // root must be called panel if( !root->hasName("panel" ) ) { - llwarns << "Root node should be named panel in : " << filename << llendl; + LL_WARNS() << "Root node should be named panel in : " << filename << LL_ENDL; return didPost; } @@ -422,7 +422,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parent // root must be called panel if( !root->hasName( "menu_bar" ) && !root->hasName( "menu" )) { - llwarns << "Root node should be named menu bar or menu in : " << filename << llendl; + LL_WARNS() << "Root node should be named menu bar or menu in : " << filename << LL_ENDL; return NULL; } @@ -458,7 +458,7 @@ LLContextMenu* LLUICtrlFactory::buildContextMenu(const std::string& filename, LL // root must be called panel if( !root->hasName( LL_PIE_MENU_TAG )) { - llwarns << "Root node should be named " << LL_PIE_MENU_TAG << " in : " << filename << llendl; + LL_WARNS() << "Root node should be named " << LL_PIE_MENU_TAG << " in : " << filename << LL_ENDL; return NULL; } @@ -496,9 +496,9 @@ void LLUICtrlFactory::rebuild() { continue; } - llinfos << "Rebuilding UI panel " << panelp->getName() + LL_INFOS() << "Rebuilding UI panel " << panelp->getName() << " from " << filename - << llendl; + << LL_ENDL; BOOL visible = panelp->getVisible(); panelp->setVisible(FALSE); panelp->setFocus(FALSE); @@ -519,9 +519,9 @@ void LLUICtrlFactory::rebuild() continue; } std::string filename = built_floater_it->second; - llinfos << "Rebuilding UI floater " << floaterp->getName() + LL_INFOS() << "Rebuilding UI floater " << floaterp->getName() << " from " << filename - << llendl; + << LL_ENDL; BOOL visible = floaterp->getVisible(); floaterp->setVisible(FALSE); floaterp->setFocus(FALSE); @@ -545,7 +545,7 @@ LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) if (func == NULL) { - llwarns << "Unknown control type " << ctrl_type << llendl; + LL_WARNS() << "Unknown control type " << ctrl_type << LL_ENDL; return NULL; } diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index b3ef3aeeb..970d7c0b0 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -157,7 +157,7 @@ private: if (!params.validateBlock()) { - llwarns << /*getInstance()->getCurFileName() <<*/ ": Invalid parameter block for " << typeid(T).name() << llendl; + LL_WARNS() << /*getInstance()->getCurFileName() <<*/ ": Invalid parameter block for " << typeid(T).name() << LL_ENDL; //return NULL; } diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index d88c3cd66..0ca830f7d 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -48,12 +48,12 @@ // LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); // mMessage.setArg("[USERNAME]", "Steve"); // mMessage.setArg("[SECONDLIFE]", "Second Life"); -// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Steve to Second Life" // mMessage.setArg("[USERNAME]", "Joe"); -// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Joe to Second Life" // mMessage = "Bienvenido a la [SECONDLIFE] [USERNAME]" // mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); -// llinfos << mMessage.getString() << llendl; // outputs "Bienvenido a la Segunda Vida Joe" +// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Bienvenido a la Segunda Vida Joe" // Implementation Notes: // Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have diff --git a/indra/llui/llundo.cpp b/indra/llui/llundo.cpp index 8f57636a5..d1e36586c 100644 --- a/indra/llui/llundo.cpp +++ b/indra/llui/llundo.cpp @@ -57,7 +57,7 @@ LLUndoBuffer::LLUndoBuffer( LLUndoAction (*create_func()), S32 initial_count ) mActions[i] = create_func(); if (!mActions[i]) { - llerrs << "Unable to create action for undo buffer" << llendl; + LL_ERRS() << "Unable to create action for undo buffer" << LL_ENDL; } } } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 5cd532d81..54dc1819c 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -789,7 +789,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC if (path_parts < 3) // no parcel id { - llwarns << "Failed to parse url [" << url << "]" << llendl; + LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL; return url; } @@ -929,7 +929,7 @@ std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelC if (path_parts < 3) // no region name { - llwarns << "Failed to parse url [" << url << "]" << llendl; + LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL; return url; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 460ed38a9..d7a11ad00 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -176,12 +176,12 @@ LLView::LLView( const std::string& name, const LLRect& rect, BOOL mouse_opaque, LLView::~LLView() { - //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; + //LL_INFOS() << "Deleting view " << mName << ":" << (void*) this << LL_ENDL; // llassert(LLView::sIsDrawing == FALSE); if( hasMouseCapture() ) { - //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; + //LL_WARNS() << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << LL_ENDL; gFocusMgr.removeMouseCaptureWithoutCallback( this ); } @@ -322,7 +322,7 @@ bool LLView::addChild(LLView* child, S32 tab_group) } if (mParentView == child) { - llerrs << "Adding view " << child->getName() << " as child of itself" << llendl; + LL_ERRS() << "Adding view " << child->getName() << " as child of itself" << LL_ENDL; } // remove from current parent @@ -392,7 +392,7 @@ void LLView::removeChild(LLView* child) } else { - llwarns << child->getName() << "is not a child of " << getName() << llendl; + LL_WARNS() << child->getName() << "is not a child of " << getName() << LL_ENDL; } updateBoundingRect(); } @@ -680,12 +680,12 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask) void LLView::onMouseEnter(S32 x, S32 y, MASK mask) { - //llinfos << "Mouse entered " << getName() << llendl; + //LL_INFOS() << "Mouse entered " << getName() << LL_ENDL; } void LLView::onMouseLeave(S32 x, S32 y, MASK mask) { - //llinfos << "Mouse left " << getName() << llendl; + //LL_INFOS() << "Mouse left " << getName() << LL_ENDL; } std::string LLView::getShowNamesToolTip() @@ -810,7 +810,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m { if (LLView::sDebugKeys) { - llinfos << desc << " handled by " << viewp->getName() << llendl; + LL_INFOS() << desc << " handled by " << viewp->getName() << LL_ENDL; } return viewp; } @@ -950,7 +950,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) handled = handleKeyHere( key, mask ); if (handled && LLView::sDebugKeys) { - llinfos << "Key handled by " << getName() << llendl; + LL_INFOS() << "Key handled by " << getName() << LL_ENDL; } } } @@ -987,7 +987,7 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) handled = handleUnicodeCharHere(uni_char); if (handled && LLView::sDebugKeys) { - llinfos << "Unicode key handled by " << getName() << llendl; + LL_INFOS() << "Unicode key handled by " << getName() << LL_ENDL; } } } @@ -1210,7 +1210,7 @@ void LLView::drawChildren() // Check for bogus rectangle if (!getRect().isValid()) { - llwarns << "Bogus rectangle for " << getName() << " with " << mRect << llendl; + LL_WARNS() << "Bogus rectangle for " << getName() << " with " << mRect << LL_ENDL; } } } @@ -2223,7 +2223,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna } break; default: - llerrs << "Invalid snap edge" << llendl; + LL_ERRS() << "Invalid snap edge" << LL_ENDL; } } @@ -2325,7 +2325,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna } break; default: - llerrs << "Invalid snap edge" << llendl; + LL_ERRS() << "Invalid snap edge" << LL_ENDL; } } } @@ -2341,7 +2341,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna void LLView::registerEventListener(std::string name, LLSimpleListener* function) { mDispatchList.insert(std::pair(name, function)); - lldebugs << getName() << " registered " << name << llendl; + LL_DEBUGS() << getName() << " registered " << name << LL_ENDL; } @@ -2934,7 +2934,7 @@ void LLView::setControlName(const std::string& control_name, LLView *context) if (!mControlName.empty()) { - llwarns << "setControlName called twice on same control!" << llendl; + LL_WARNS() << "setControlName called twice on same control!" << LL_ENDL; mControlConnection.disconnect(); // disconnect current signal mControlName.clear(); } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index cc7ce21eb..89d2fc33c 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -122,7 +122,7 @@ public: if (registry->isTagRegistered(tag)) { //error! - llerrs << "Widget named " << tag << " already registered!" << llendl; + LL_ERRS() << "Widget named " << tag << " already registered!" << LL_ENDL; } else { @@ -557,7 +557,7 @@ public: // did we find *something* with that name? if (child) { - llwarns << "Found child named " << name << " but of wrong type " << typeid(child).name() << ", expecting " << typeid(T).name() << llendl; + LL_WARNS() << "Found child named " << name << " but of wrong type " << typeid(child).name() << ", expecting " << typeid(T).name() << LL_ENDL; } if (create_if_missing) { @@ -584,7 +584,7 @@ public: std::string xml_tag = LLWidgetClassRegistry::getInstance()->getTag(); if (xml_tag.empty()) { - llwarns << "No xml tag registered for this class " << llendl; + LL_WARNS() << "No xml tag registered for this class " << LL_ENDL; return NULL; } // create dummy xml node (