From 9480a98cffaafa5826b8daad20020cf399bbbefc Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 16 Feb 2024 00:07:58 +0100 Subject: Replace most of BOOL with bool in llmath --- indra/llcommon/llstring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llstring.cpp') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f6629803ee..4358e80125 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -308,10 +308,10 @@ S32 wstring_utf16_length(const LLWString &wstr, const S32 woffset, const S32 wle // Given a wstring and an offset in it, returns the length as wstring (i.e., // number of llwchars) of the longest substring that starts at the offset // and whose equivalent utf-16 string does not exceeds the given utf16_length. -S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, BOOL *unaligned) +S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, bool *unaligned) { const auto end = wstr.length(); - BOOL u = FALSE; + bool u = FALSE; S32 n = woffset + utf16_length; S32 i = woffset; while (i < end) -- cgit v1.2.3 From 07f54e72766d903292fec985e7c5eb46a6a325ca Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 16 Feb 2024 00:12:57 +0100 Subject: Replaced one overlooked FALSE --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llstring.cpp') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 4358e80125..ef77b0b1c8 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -311,7 +311,7 @@ S32 wstring_utf16_length(const LLWString &wstr, const S32 woffset, const S32 wle S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, bool *unaligned) { const auto end = wstr.length(); - bool u = FALSE; + bool u{ false }; S32 n = woffset + utf16_length; S32 i = woffset; while (i < end) -- cgit v1.2.3 From 9e854b697a06abed2a0917fb6120445f176764f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 16 Feb 2024 19:29:51 +0100 Subject: misc: BOOL to bool --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llstring.cpp') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index ef77b0b1c8..6e6797312b 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -1359,7 +1359,7 @@ S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions) if (iter != substitutions.end()) { S32 secFromEpoch = 0; - BOOL r = LLStringUtil::convertToS32(iter->second, secFromEpoch); + bool r = LLStringUtil::convertToS32(iter->second, secFromEpoch); if (r) { found_replacement = formatDatetime(replacement, tokens[0], param, secFromEpoch); -- cgit v1.2.3 From 3ffe63b8a4e8a3ceda3f6d204e4b5bb0c80d0870 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 16:49:48 +0100 Subject: Convert remaining BOOLs in llxml and introduce std::string_view --- indra/llcommon/llstring.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llcommon/llstring.cpp') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 6e6797312b..bdd4c2c4bb 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -765,7 +765,7 @@ std::wstring windows_message(DWORD error) return out.str(); } -boost::optional llstring_getoptenv(const std::string& key) +std::optional llstring_getoptenv(const std::string& key) { auto wkey = ll_convert_string_to_wide(key); // Take a wild guess as to how big the buffer should be. @@ -783,8 +783,8 @@ boost::optional llstring_getoptenv(const std::string& key) // did that (ultimately) succeed? if (n) { - // great, return populated boost::optional - return boost::optional(&buffer[0]); + // great, return populated std::optional + return std::make_optional(&buffer[0]); } // not successful @@ -795,7 +795,7 @@ boost::optional llstring_getoptenv(const std::string& key) LL_WARNS() << "GetEnvironmentVariableW('" << key << "') failed: " << windows_message(last_error) << LL_ENDL; } - // return empty boost::optional + // return empty std::optional return {}; } @@ -806,12 +806,12 @@ boost::optional llstring_getoptenv(const std::string& key) auto found = getenv(key.c_str()); if (found) { - // return populated boost::optional - return boost::optional(found); + // return populated std::optional + return std::make_optional(found); } else { - // return empty boost::optional + // return empty std::optional return {}; } } -- cgit v1.2.3 From 855eea7ddf9e1de9226036ca94ccb03ac0e311b9 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 21 Feb 2024 19:19:57 +0200 Subject: viewer#851 Xcode buildfix --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llstring.cpp') diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index bdd4c2c4bb..48551ab375 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -801,7 +801,7 @@ std::optional llstring_getoptenv(const std::string& key) #else // ! LL_WINDOWS -boost::optional llstring_getoptenv(const std::string& key) +std::optional llstring_getoptenv(const std::string& key) { auto found = getenv(key.c_str()); if (found) -- cgit v1.2.3