From 7ff52b58f917a094f71aee6fc52b79c6be7431ed Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Thu, 17 Dec 2020 15:15:47 -0500 Subject: [PATCH] Revert "Start changing a few llformat(vsnprtinf wrapper) over to absl::StrFormat" This reverts commit e01b8b983dea56e22800bcdf64cb7b4c77c4b70a. --- indra/llcommon/llerror.cpp | 5 ++--- indra/llcommon/llsdparam.cpp | 4 +--- indra/llcommon/llstring.cpp | 14 ++++++-------- indra/llcommon/lltimer.cpp | 4 +--- indra/llcommon/lluuid.cpp | 4 +--- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index ad91d4318b4..e0c7702b103 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -49,7 +49,6 @@ #include "absl/synchronization/mutex.h" #include "absl/container/flat_hash_map.h" -#include "absl/strings/str_format.h" #include "llapp.h" #include "llapr.h" @@ -654,7 +653,7 @@ namespace LLError default: mLevelString = "XXX"; break; }; - mLocationString = absl::StrFormat("%s(%d)", abbreviateFile(mFile), mLine); + mLocationString = llformat("%s(%d)", abbreviateFile(mFile).c_str(), mLine); #if LL_WINDOWS // DevStudio: __FUNCTION__ already includes the full class name #else @@ -1413,7 +1412,7 @@ namespace LLError return; } - if (out->str().length() < 128) + if(strlen(out->str().c_str()) < 128) { strcpy(message, out->str().c_str()); } diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index ef845e157b3..6a824e2faf2 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -32,8 +32,6 @@ #include "llsdutil.h" #include "boost/bind.hpp" -#include <absl/strings/str_format.h> - static LLInitParam::Parser::parser_read_func_map_t sReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs; static LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs; @@ -121,7 +119,7 @@ void LLParamSDParser::writeSDImpl(LLSD& sd, const LLInitParam::BaseBlock& block, it != mNameStack.end(); ++it) { - absl::StrAppendFormat(&full_name, "[%s]", it->first); + full_name += llformat("[%s]", it->first.c_str()); } return full_name; diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index a7beab3e2a3..4e4ad0fcf41 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -37,8 +37,6 @@ #include <winnls.h> // for WideCharToMultiByte #endif -#include <absl/strings/str_format.h> - LLTrace::BlockTimerStatHandle FT_STRING_FORMAT("String Format"); @@ -1041,19 +1039,19 @@ std::string LLStringOps::getReadableNumber(F64 num) { if (fabs(num)>=1e9) { - return absl::StrFormat("%.2lfB", num / 1e9); + return llformat("%.2lfB", num / 1e9); } else if (fabs(num)>=1e6) { - return absl::StrFormat("%.2lfM", num / 1e6); + return llformat("%.2lfM", num / 1e6); } else if (fabs(num)>=1e3) { - return absl::StrFormat("%.2lfK", num / 1e3); + return llformat("%.2lfK", num / 1e3); } else { - return absl::StrFormat("%.2lf", num); + return llformat("%.2lf", num); } } @@ -1361,14 +1359,14 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, { struct tm * gmt = gmtime (&loc_seconds); LLStringUtil::format_map_t args; - args["[MDAY]"] = absl::StrFormat("%d", gmt->tm_mday); + args["[MDAY]"] = llformat ("%d", gmt->tm_mday); replacement = LLStringOps::sDayFormat; LLStringUtil::format(replacement, args); } else if (code == "%-d") { struct tm * gmt = gmtime (&loc_seconds); - replacement = absl::StrFormat("%d", gmt->tm_mday); // day of the month without leading zero + replacement = llformat ("%d", gmt->tm_mday); // day of the month without leading zero } else if( !LLStringOps::sAM.empty() && !LLStringOps::sPM.empty() && code == "%p" ) { diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 43a4cc2dd08..6909cca9172 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -39,8 +39,6 @@ # error "architecture not supported" #endif -#include <absl/strings/str_format.h> - #include <chrono> #include <thread> @@ -469,7 +467,7 @@ void microsecondsToTimecodeString(U64MicrosecondsImplicit current_time, std::str subframes = current_time / (U64)42; subframes %= 100; - tcstring = absl::StrFormat("%3.3d:%2.2d:%2.2d:%2.2d.%2.2d", hours, minutes, seconds, frames, subframes); + tcstring = llformat("%3.3d:%2.2d:%2.2d:%2.2d.%2.2d",(int)hours,(int)minutes,(int)seconds,(int)frames,(int)subframes); } diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index c6ddf575b9f..3c1a79e3071 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -45,8 +45,6 @@ #include "llthread.h" #include "llmutex.h" -#include <absl/strings/str_format.h> - const LLUUID LLUUID::null; const LLTransactionID LLTransactionID::tnull; @@ -156,7 +154,7 @@ U32 janky_fast_random_seeded_bytes(U32 seed, U32 val) // Common to all UUID implementations void LLUUID::toString(std::string& out) const { - out = absl::StrFormat( + out = llformat( "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", (U8)(mData[0]), (U8)(mData[1]), -- GitLab