refactor: Use new hyprutils casts (#11377)

This commit is contained in:
Kamikadze 2025-08-14 19:44:56 +05:00 committed by GitHub
parent aa6a78f0a4
commit beee22a95e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
116 changed files with 715 additions and 696 deletions

View file

@ -44,7 +44,7 @@ CAsyncDialogBox::CAsyncDialogBox(const std::string& title, const std::string& de
}
static int onFdWrite(int fd, uint32_t mask, void* data) {
auto box = (CAsyncDialogBox*)data;
auto box = sc<CAsyncDialogBox*>(data);
// lock the box to prevent a UAF
auto lock = box->lockSelf();
@ -68,7 +68,7 @@ void CAsyncDialogBox::onWrite(int fd, uint32_t mask) {
}
while ((ret = read(m_pipeReadFd.get(), buf.data(), 1023)) > 0) {
m_stdout += std::string_view{(char*)buf.data(), (size_t)ret};
m_stdout += std::string_view{(buf.data()), sc<size_t>(ret)};
}
// restore the flags (otherwise libwayland won't give us a hangup)