Merge pull request #7672 from furo321/bitwise-instead-of-logical

Fix clang warning `-Wbitwise-instead-of-logical`
This commit is contained in:
heinrich5991 2023-12-17 00:11:06 +00:00 committed by GitHub
commit 4af28fd2d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -1217,8 +1217,9 @@ void CChat::OnRender()
m_Input.Activate(EInputPriority::CHAT); // Ensure that the input is active
const CUIRect InputCursorRect = {Cursor.m_X, Cursor.m_Y - ScrollOffset, 0.0f, 0.0f};
// Arithmetic or to ensure that both functions are called so both flags are purged
const bool Changed = m_Input.WasChanged() | m_Input.WasCursorChanged();
const bool WasChanged = m_Input.WasChanged();
const bool WasCursorChanged = m_Input.WasCursorChanged();
const bool Changed = WasChanged || WasCursorChanged;
const STextBoundingBox BoundingBox = m_Input.Render(&InputCursorRect, Cursor.m_FontSize, TEXTALIGN_TL, Changed, MessageMaxWidth, 0.0f);
Graphics()->ClipDisable();

View file

@ -970,8 +970,9 @@ void CGameConsole::OnRender()
pConsole->m_Input.SetHidden(m_ConsoleType == CONSOLETYPE_REMOTE && Client()->State() == IClient::STATE_ONLINE && !Client()->RconAuthed() && (pConsole->m_UserGot || !pConsole->m_UsernameReq));
pConsole->m_Input.Activate(EInputPriority::CONSOLE); // Ensure that the input is active
const CUIRect InputCursorRect = {x, y + FONT_SIZE, 0.0f, 0.0f};
// Arithmetic or to ensure that both functions are called so both flags are purged
const bool Changed = pConsole->m_Input.WasChanged() | pConsole->m_Input.WasCursorChanged();
const bool WasChanged = pConsole->m_Input.WasChanged();
const bool WasCursorChanged = pConsole->m_Input.WasCursorChanged();
const bool Changed = WasChanged || WasCursorChanged;
pConsole->m_BoundingBox = pConsole->m_Input.Render(&InputCursorRect, FONT_SIZE, TEXTALIGN_BL, Changed, Screen.w - 10.0f - x, LINE_SPACING);
if(pConsole->m_LastInputHeight == 0.0f && pConsole->m_BoundingBox.m_H != 0.0f)
pConsole->m_LastInputHeight = pConsole->m_BoundingBox.m_H;