diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 35d0bc03b7d074e9aaf2aa591909a1c70d5df612..656dd130d36adbfe02606526f97e1ab63d08a367 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -24,6 +24,12 @@ * $/LicenseInfo$ */ +#if LL_MSVC +// disable warning about boost::lexical_cast returning uninitialized data +// when it fails to parse the string +#pragma warning (disable:4701) +#endif + #include "linden_common.h" #include "llavatarappearance.h" @@ -40,6 +46,14 @@ #include "boost/bind.hpp" #include "boost/tokenizer.hpp" + +#if LL_MSVC +// disable boost::lexical_cast warning +#pragma warning (disable:4702) +#endif + +#include <boost/lexical_cast.hpp> + using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- @@ -217,7 +231,7 @@ void LLAvatarAppearance::initInstance() for (U32 lod = 0; lod < mesh_dict->mLOD; lod++) { LLAvatarJointMesh* mesh = createAvatarJointMesh(); - std::string mesh_name = absl::StrCat("m", mesh_dict->mName, lod); + std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod); // We pre-pended an m - need to capitalize first character for camelCase mesh_name[1] = toupper(mesh_name[1]); mesh->setName(mesh_name); diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 2eee399c71b17eb498fd7d63f1db157070ccde96..bf015f28571160ae5d953c069a57ceebe71396b1 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -880,6 +880,8 @@ void LLPolyMesh::dumpDiagInfo() U32 total_faces = 0; U32 total_kb = 0; + std::string buf; + LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; LL_INFOS() << " Global PolyMesh Table (DEBUG only)" << LL_ENDL; LL_INFOS() << " Verts Faces Mem(KB) Name" << LL_ENDL; @@ -896,7 +898,8 @@ void LLPolyMesh::dumpDiagInfo() S32 num_faces = mesh->mNumFaces; U32 num_kb = mesh->getNumKB(); - LL_INFOS() << absl::StreamFormat("%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name) << LL_ENDL; + buf = llformat("%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name.c_str()); + LL_INFOS() << buf << LL_ENDL; total_verts += num_verts; total_faces += num_faces; @@ -904,7 +907,8 @@ void LLPolyMesh::dumpDiagInfo() } LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; - LL_INFOS() << absl::StreamFormat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb) << LL_ENDL; + buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); + LL_INFOS() << buf << LL_ENDL; LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; } diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 008241d84494a9f2ce60a8078ab54afadbd791bc..66b4be6e787a64b9f5b75a392159d9d2401f4dd3 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -776,7 +776,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) std::string terse_F32_to_string(F32 f) { - std::string r = absl::StrFormat("%.2f", f); + std::string r = llformat("%.2f", f); S32 len = r.length(); // "1.20" -> "1.2" diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 727e3692b15f15cd818c0182499a47add8ca90b8..aa2f4eb289b5e3e47d09f1cb99bb05ebc3274287 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -193,7 +193,7 @@ namespace LLInitParam { if (!silent) { - p.parserWarning(absl::StrFormat("Failed to parse parameter \"%s\"", p.getCurrentElementName())); + p.parserWarning(llformat("Failed to parse parameter \"%s\"", p.getCurrentElementName().c_str())); } return false; } diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h index 7e632d8e4c9a20a831daf132a8c420d64d79b703..50d5461ab250003daa1c6aeba931703982006c39 100644 --- a/indra/llcommon/llmetricperformancetester.h +++ b/indra/llcommon/llmetricperformancetester.h @@ -107,7 +107,7 @@ class LL_COMMON_API LLMetricPerformanceTesterBasic /** * @return Returns the label to be used for the current count. It's "TesterName"-"Count". */ - std::string getCurrentLabelName() const { return absl::StrFormat("%s-%d", mName, mCount) ;} + std::string getCurrentLabelName() const { return llformat("%s-%d", mName.c_str(), mCount) ;} /** * @brief Write a test record to the LLSD. Implementers need to overload this method. diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 4ff5395f35c775aa90a4836a63a1a1866c0e8c62..2f967304d0d643bab4cbbd39cb6f3321379dee7a 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -189,7 +189,7 @@ void LLQueuedThread::printQueueStats() if (!mRequestQueue.empty()) { QueuedRequest *req = *mRequestQueue.begin(); - LL_INFOS() << absl::StreamFormat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL; + LL_INFOS() << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL; } else { @@ -224,7 +224,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req) mRequestQueue.insert(req); mRequestHash.insert(req); #if _DEBUG -// LL_INFOS() << absl::StreamFormat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL; +// LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL; #endif mRequestQueueSize = mRequestQueue.size(); unlockData(); @@ -356,7 +356,7 @@ bool LLQueuedThread::completeRequest(handle_t handle) llassert_always(req->getStatus() != STATUS_QUEUED); llassert_always(req->getStatus() != STATUS_INPROGRESS); #if _DEBUG -// LL_INFOS() << absl::StreamFormat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL; +// LL_INFOS() << llformat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL; #endif mRequestHash.erase(handle); req->deleteRequest(); diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 9a161e83083a53d117e623098b74c3646f1c8d09..9c6cbe44c7d2d0699d8aa6940ff3fbb155c374f9 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -287,10 +287,10 @@ LLOSInfo::LLOSInfo() : mOSString = mOSStringSimple; if (mBuild > 0) { - absl::StrAppendFormat(&mOSString, "(Build %d", mBuild); + mOSString += llformat("(Build %d", mBuild); if (ubr > 0) { - absl::StrAppendFormat(&mOSString, ".%d", ubr); + mOSString += llformat(".%d", ubr); } mOSString += ")"; } diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index d6a13920b7739412b0ee3a251a6bd3bb88002026..b0b4cc57b48c1d4830dc48d895b89003d98466f1 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -518,7 +518,7 @@ LLURI LLURI::buildHTTP(const std::string& host, const U32& port, const LLSD& path) { - return LLURI::buildHTTP(absl::StrFormat("%s:%u", host, port), path); + return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path); } // static @@ -527,7 +527,7 @@ LLURI LLURI::buildHTTP(const std::string& host, const LLSD& path, const LLSD& query) { - return LLURI::buildHTTP(absl::StrFormat("%s:%u", host, port), path, query); + return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query); } std::string LLURI::asString() const diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 02dc02de307c730f9e1b2a60fff7c9a355530557..ea5a5005a04fc94c7e6049926652b53bbea0c1fb 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -681,7 +681,7 @@ U8* LLImageBase::allocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - LL_WARNS() << absl::StreamFormat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL; + LL_WARNS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL; mBadBufferAllocation = true; } } diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 072c85991c1f60ffbb1d9caf918db871ee42d653..f88caca5da35a4eaed4a3e13c34b493b981698d7 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -422,7 +422,7 @@ bool LLImageDXT::convertToDXR() case FORMAT_DXT4: newformat = FORMAT_DXR4; break; case FORMAT_DXT5: newformat = FORMAT_DXR5; break; default: - LL_WARNS() << absl::StreamFormat("convertToDXR: can not convert format: 0x%08x",getFourCC(mFileFormat)) << LL_ENDL; + LL_WARNS() << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << LL_ENDL; return false; } mFileFormat = newformat; diff --git a/indra/llinventory/llnotecard.cpp b/indra/llinventory/llnotecard.cpp index ec665055151df20cdf11baa3ac48f0c0221dd5f4..89c4c3af16d991e128d4fe525b9d1f711288454f 100644 --- a/indra/llinventory/llnotecard.cpp +++ b/indra/llinventory/llnotecard.cpp @@ -230,7 +230,7 @@ bool LLNotecard::exportEmbeddedItemsStream( std::ostream& out_stream ) out_stream << "LLEmbeddedItems version 1\n"; out_stream << "{\n"; - out_stream << absl::StreamFormat("count %d\n", mItems.size() ); + out_stream << llformat("count %d\n", mItems.size() ); S32 idx = 0; for (std::vector<LLPointer<LLInventoryItem> >::iterator iter = mItems.begin(); @@ -240,7 +240,7 @@ bool LLNotecard::exportEmbeddedItemsStream( std::ostream& out_stream ) if (item) { out_stream << "{\n"; - out_stream << absl::StreamFormat("ext char index %d\n", idx ); + out_stream << llformat("ext char index %d\n", idx ); if( !item->exportLegacyStream( out_stream ) ) { return FALSE; @@ -265,7 +265,7 @@ bool LLNotecard::exportStream( std::ostream& out_stream ) return FALSE; } - out_stream << absl::StreamFormat("Text length %d\n", mText.length() ); + out_stream << llformat("Text length %d\n", mText.length() ); out_stream << mText; out_stream << "}\n"; diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 9a38a73b3574d7474ab371d2f42601b9a96c0c45..a8e9ce69f304eb10db8b2a0c08a6aae67b74bd6b 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -391,8 +391,9 @@ F32 LLVolumeLODGroup::dump() } usage = usage / (F32)NUM_LODS; - LL_INFOS() << absl::StrFormat("%.3f %d %d %d %d", usage, - mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]) << LL_ENDL; + std::string dump_str = llformat("%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]); + + LL_INFOS() << dump_str << LL_ENDL; return usage; } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 0e7b331a23f4cfe6bfc79a931f15f48dfe1e5a2d..53dacdf54a74881d99fe88e397b5274a562e7eac 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -725,8 +725,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mFullscreenRefresh = -1; std::map<std::string,std::string> args; - args["[WIDTH]"] = absl::StrCat(width); - args["[HEIGHT]"] = absl::StrCat(height); + args["[WIDTH]"] = llformat("%d", width); + args["[HEIGHT]"] = llformat ("%d", height); OSMessageBox(mCallbacks->translateString("MBFullScreenErr", args), mCallbacks->translateString("MBError"), OSMB_OK); } @@ -1698,8 +1698,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO } else { - LL_INFOS() << absl::StreamFormat("Created OpenGL %d.%d %s context.", attribs[1], - attribs[3], LLRender::sGLCoreProfile ? "core" : "compatibility") << LL_ENDL; + LL_INFOS() << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) << + (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL; done = true; // force sNoFixedFunction iff we're trying to use nsight debugging which does not support many legacy API uses diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 9f6446f3d760d7da4435d571880702c425842068..b31981b235d597e1203aa892da78b9df6285dfe1 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -355,7 +355,7 @@ void LLCOFWearables::setAttachmentsTitle() U32 free_slots = gAgentAvatarp->getMaxAttachments() - mAttachments->size(); LLStringUtil::format_map_t args_attachments; - args_attachments["[COUNT]"] = absl::StrCat(free_slots); + args_attachments["[COUNT]"] = llformat ("%d", free_slots); std::string attachments_title = LLTrans::getString("Attachments remain", args_attachments); mAttachmentsTab->setTitle(attachments_title); } diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 83134645b31b6c20b1f05f28dac3390387240605..3b086c4cf5ab11a228b3c156056cccb2f432709a 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -222,7 +222,7 @@ BOOL LLFloaterScriptQueue::start() LLStringUtil::format_map_t args; args["[START]"] = mStartString; - args["[COUNT]"] = absl::StrCat(mObjectList.size()); + args["[COUNT]"] = llformat ("%d", mObjectList.size()); buffer = getString ("Starting", args); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM); diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 6bfb0fa4a73496cd5c02164819d408f9d17d6067..8861f4720577d80e80a01bbf41af488e87e13f2b 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -32,7 +32,7 @@ #include "llnotificationsutil.h" #include "lltrans.h" -#include "absl/strings/str_format.h" +#include "boost/lexical_cast.hpp" const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec @@ -415,7 +415,7 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s while(LLFile::isfile(backupFileName)) { ++backupFileCount; - backupFileName = absl::StrCat(targetDirectory, ".backup", backupFileCount); + backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount); } //Rename the file to its backup name so it is not overwritten diff --git a/indra/newview/llfloatermyscripts.cpp b/indra/newview/llfloatermyscripts.cpp index 25baf0accd884d7d32478c2be18a4d8dc18426b8..6f9a6c90669126376d747e354eff32f0de49db4b 100644 --- a/indra/newview/llfloatermyscripts.cpp +++ b/indra/newview/llfloatermyscripts.cpp @@ -254,15 +254,15 @@ void LLFloaterMyScripts::setAttachmentSummary(LLSD content) if((mAttachmentMemoryUsed >= 0) && (mAttachmentMemoryMax >= 0)) { LLStringUtil::format_map_t args_attachment_memory; - args_attachment_memory["[COUNT]"] = absl::StrCat(mAttachmentMemoryUsed); + args_attachment_memory["[COUNT]"] = llformat ("%d", mAttachmentMemoryUsed); std::string translate_message = "ScriptLimitsMemoryUsedSimple"; if (0 < mAttachmentMemoryMax) { S32 attachment_memory_available = mAttachmentMemoryMax - mAttachmentMemoryUsed; - args_attachment_memory["[MAX]"] = absl::StrCat(mAttachmentMemoryMax); - args_attachment_memory["[AVAILABLE]"] = absl::StrCat(attachment_memory_available); + args_attachment_memory["[MAX]"] = llformat ("%d", mAttachmentMemoryMax); + args_attachment_memory["[AVAILABLE]"] = llformat ("%d", attachment_memory_available); translate_message = "ScriptLimitsMemoryUsed"; } @@ -274,9 +274,9 @@ void LLFloaterMyScripts::setAttachmentSummary(LLSD content) S32 attachment_urls_available = mAttachmentURLsMax - mAttachmentURLsUsed; LLStringUtil::format_map_t args_attachment_urls; - args_attachment_urls["[COUNT]"] = absl::StrCat(mAttachmentURLsUsed); - args_attachment_urls["[MAX]"] = absl::StrCat(mAttachmentURLsMax); - args_attachment_urls["[AVAILABLE]"] = absl::StrCat(attachment_urls_available); + args_attachment_urls["[COUNT]"] = llformat ("%d", mAttachmentURLsUsed); + args_attachment_urls["[MAX]"] = llformat ("%d", mAttachmentURLsMax); + args_attachment_urls["[AVAILABLE]"] = llformat ("%d", attachment_urls_available); std::string msg_attachment_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_attachment_urls); getChild<LLUICtrl>("urls_used")->setValue(LLSD(msg_attachment_urls)); } diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 86f94d3494795abde9ec11c0f65e98983e0a04c9..40fe11b309304eb9982c5262de791913b083df75 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -406,7 +406,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) S32 number_parcels = content["parcels"].size(); LLStringUtil::format_map_t args_parcels; - args_parcels["[PARCELS]"] = absl::StrCat(number_parcels); + args_parcels["[PARCELS]"] = llformat ("%d", number_parcels); std::string msg_parcels = LLTrans::getString("ScriptLimitsParcelsOwned", args_parcels); getChild<LLUICtrl>("parcels_listed")->setValue(LLSD(msg_parcels)); @@ -611,15 +611,15 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) if((mParcelMemoryUsed >= 0) && (mParcelMemoryMax >= 0)) { LLStringUtil::format_map_t args_parcel_memory; - args_parcel_memory["[COUNT]"] = absl::StrCat(mParcelMemoryUsed); + args_parcel_memory["[COUNT]"] = llformat ("%d", mParcelMemoryUsed); std::string translate_message = "ScriptLimitsMemoryUsedSimple"; if (0 < mParcelMemoryMax) { S32 parcel_memory_available = mParcelMemoryMax - mParcelMemoryUsed; - args_parcel_memory["[MAX]"] = absl::StrCat(mParcelMemoryMax); - args_parcel_memory["[AVAILABLE]"] = absl::StrCat(parcel_memory_available); + args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax); + args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available); translate_message = "ScriptLimitsMemoryUsed"; } @@ -632,9 +632,9 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) S32 parcel_urls_available = mParcelURLsMax - mParcelURLsUsed; LLStringUtil::format_map_t args_parcel_urls; - args_parcel_urls["[COUNT]"] = absl::StrCat(mParcelURLsUsed); - args_parcel_urls["[MAX]"] = absl::StrCat(mParcelURLsMax); - args_parcel_urls["[AVAILABLE]"] = absl::StrCat(parcel_urls_available); + args_parcel_urls["[COUNT]"] = llformat ("%d", mParcelURLsUsed); + args_parcel_urls["[MAX]"] = llformat ("%d", mParcelURLsMax); + args_parcel_urls["[AVAILABLE]"] = llformat ("%d", parcel_urls_available); std::string msg_parcel_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_parcel_urls); getChild<LLUICtrl>("urls_used")->setValue(LLSD(msg_parcel_urls)); } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index bc080633387b5932654114eaa03590b7f0b8609d..e0aba6610603959a9a87075b8b489446b5b8f530 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -679,8 +679,8 @@ void LLScriptEdCore::draw() mEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap LLStringUtil::format_map_t args; std::string cursor_pos; - args["[LINE]"] = absl::StrCat(line); - args["[COLUMN]"] = absl::StrCat(column); + args["[LINE]"] = llformat ("%d", line); + args["[COLUMN]"] = llformat ("%d", column); cursor_pos = LLTrans::getString("CursorPos", args); getChild<LLUICtrl>("line_col")->setValue(cursor_pos); }