[client,sdl] fix container size empty warnings

This commit is contained in:
akallabeth
2025-02-10 12:35:27 +01:00
parent 2a9b939b02
commit f124b7db40
2 changed files with 11 additions and 7 deletions

View File

@@ -81,18 +81,22 @@ int SdlSelectList::run()
else if (_list.empty())
CurrentActiveTextInput = 0;
else
CurrentActiveTextInput =
WINPR_ASSERTING_INT_CAST(ssize_t, _list.size()) - 1;
{
auto s = _list.size();
CurrentActiveTextInput = WINPR_ASSERTING_INT_CAST(ssize_t, s) - 1;
}
break;
case SDLK_DOWN:
case SDLK_TAB:
if ((CurrentActiveTextInput < 0) || _list.empty())
CurrentActiveTextInput = 0;
else
{
auto s = _list.size();
CurrentActiveTextInput++;
CurrentActiveTextInput =
CurrentActiveTextInput %
WINPR_ASSERTING_INT_CAST(ssize_t, _list.size());
CurrentActiveTextInput =
CurrentActiveTextInput % WINPR_ASSERTING_INT_CAST(ssize_t, s);
}
break;
case SDLK_RETURN:
case SDLK_RETURN2:

View File

@@ -511,10 +511,10 @@ UINT sdlClip::ReceiveServerFormatList(CliprdrClientContext* context,
clipboard->_current_mimetypes.push_back(s_mime_mate_copied_files);
}
auto s = clipboard->_current_mimetypes.size();
SDL_Event ev = { SDL_EVENT_CLIPBOARD_UPDATE };
ev.clipboard.owner = true;
ev.clipboard.num_mime_types =
WINPR_ASSERTING_INT_CAST(Sint32, clipboard->_current_mimetypes.size());
ev.clipboard.num_mime_types = WINPR_ASSERTING_INT_CAST(Sint32, s);
ev.clipboard.mime_types = clipboard->_current_mimetypes.data();
/* TODO: Hack to identify our own updates */