diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
commit | b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch) | |
tree | d73404c2fbacce379a57e2d03a6cd54558590859 /indra/newview/llhudnametag.cpp | |
parent | cb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff) |
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/newview/llhudnametag.cpp')
-rw-r--r-- | indra/newview/llhudnametag.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 4224f7d134..e1bf6c2077 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -443,7 +443,7 @@ void LLHUDNameTag::addLine(const std::string &text_utf8, // "QualityAssurance AssuresQuality1" will end up as "QualityAssurance AssuresQua..." because we are enforcing single line do { - S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, wline.length(), LLFontGL::ANYWHERE); + auto segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); if (segment_length + line_length < wline.length()) // since we only draw one string, line_length should be 0 { // token does does not fit into signle line, need to draw "...". @@ -451,7 +451,7 @@ void LLHUDNameTag::addLine(const std::string &text_utf8, const LLWString dots_pad(utf8str_to_wstring(std::string("...."))); S32 elipses_width = font->getWidthF32(dots_pad.c_str()); // truncated string length - segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels - elipses_width, wline.length(), LLFontGL::ANYWHERE); + segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels - elipses_width, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); const LLWString dots(utf8str_to_wstring(std::string("..."))); LLHUDTextSegment segment(iter->substr(line_length, segment_length) + dots, style, color, font); mTextSegments.push_back(segment); @@ -472,7 +472,7 @@ void LLHUDNameTag::addLine(const std::string &text_utf8, // "QualityAssurance AssuresQuality 1" will be split into two lines "QualityAssurance" and "AssuresQuality" do { - S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, static_cast<S32>(wline.length()), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); LLHUDTextSegment segment(iter->substr(line_length, segment_length), style, color, font); mTextSegments.push_back(segment); line_length += segment_length; @@ -511,7 +511,7 @@ void LLHUDNameTag::addLabel(const std::string& label_utf8, F32 max_pixels) do { S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), - max_pixels, wstr.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + max_pixels, static_cast<S32>(wstr.length()), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); LLHUDTextSegment segment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor, mFontp); mLabelSegments.push_back(segment); line_length += segment_length; |