Fix clang warning -Wbitwise-instead-of-logical

This commit is contained in:
furo 2023-12-16 21:46:06 +01:00
parent 5f9d6b208c
commit c984c6895a
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;