summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-01 15:49:26 +0200
commitb42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch)
treed73404c2fbacce379a57e2d03a6cd54558590859 /indra/llui/lllineeditor.cpp
parentcb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff)
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 5ec4c34f57..50bf3f5877 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -590,7 +590,7 @@ const std::string& LLLineEditor::getSuggestion(U32 index) const
U32 LLLineEditor::getSuggestionCount() const
{
- return mSuggestionList.size();
+ return static_cast<U32>(mSuggestionList.size());
}
void LLLineEditor::replaceWithSuggestion(U32 index)
@@ -994,7 +994,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
mText.erase(getCursor(), 1);
}
- S32 cur_bytes = mText.getString().size();
+ S32 cur_bytes = static_cast<S32>(mText.getString().size());
S32 new_bytes = wchar_utf8_length(new_c);
@@ -1007,7 +1007,7 @@ void LLLineEditor::addChar(const llwchar uni_char)
}
else if (mMaxLengthChars)
{
- S32 wide_chars = mText.getWString().size();
+ auto wide_chars = mText.getWString().size();
if ((wide_chars + 1) > mMaxLengthChars)
{
allow_char = false;
@@ -1332,7 +1332,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
if (mMaxLengthChars)
{
- U32 available_chars = mMaxLengthChars - mText.getWString().size();
+ auto available_chars = mMaxLengthChars - mText.getWString().size();
if (available_chars < clean_string.size())
{
@@ -2300,10 +2300,10 @@ bool LLLineEditor::postvalidateFloat(const std::string &str)
LLWString trimmed = utf8str_to_wstring(str);
LLWStringUtil::trim(trimmed);
- S32 len = trimmed.length();
+ auto len = trimmed.length();
if( 0 < len )
{
- S32 i = 0;
+ size_t i = 0;
// First character can be a negative sign
if( '-' == trimmed[0] )
@@ -2360,7 +2360,7 @@ bool LLLineEditor::evaluateFloat()
if (!success)
{
// Move the cursor to near the error on failure
- setCursor(LLCalc::getInstance()->getLastErrorPos());
+ setCursor(static_cast<S32>(LLCalc::getInstance()->getLastErrorPos()));
// *TODO: Translated error message indicating the type of error? Select error text?
}
else
@@ -2501,7 +2501,7 @@ void LLLineEditor::updatePreedit(const LLWString &preedit_string,
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode())
{
mPreeditOverwrittenWString.assign( LLWString( mText, insert_preedit_at, mPreeditWString.length() ) );
- mText.erase(insert_preedit_at, mPreeditWString.length());
+ mText.erase(insert_preedit_at, static_cast<S32>(mPreeditWString.length()));
}
else
{