From beee22a95ed9044950e5486f22edd813e00ffa2c Mon Sep 17 00:00:00 2001 From: Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> Date: Thu, 14 Aug 2025 19:44:56 +0500 Subject: refactor: Use new hyprutils casts (#11377) --- src/protocols/core/Shm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocols/core/Shm.cpp') diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp index d73525a6..673bc03b 100644 --- a/src/protocols/core/Shm.cpp +++ b/src/protocols/core/Shm.cpp @@ -59,7 +59,7 @@ Aquamarine::SSHMAttrs CWLSHMBuffer::shm() { } std::tuple CWLSHMBuffer::beginDataPtr(uint32_t flags) { - return {(uint8_t*)m_pool->m_data + m_offset, m_fmt, m_stride * size.y}; + return {sc(m_pool->m_data) + m_offset, m_fmt, m_stride * size.y}; } void CWLSHMBuffer::endDataPtr() { @@ -101,7 +101,7 @@ static int shmIsSizeValid(CFileDescriptor& fd, size_t size) { return 0; } - return (size_t)st.st_size >= size; + return sc(st.st_size) >= size; } CWLSHMPoolResource::CWLSHMPoolResource(SP resource_, CFileDescriptor fd_, size_t size_) : m_resource(resource_) { @@ -119,7 +119,7 @@ CWLSHMPoolResource::CWLSHMPoolResource(SP resource_, CFileDescriptor m_resource->setOnDestroy([this](CWlShmPool* r) { PROTO::shm->destroyResource(this); }); m_resource->setResize([this](CWlShmPool* r, int32_t size_) { - if UNLIKELY (size_ < (int32_t)m_pool->m_size) { + if UNLIKELY (size_ < sc(m_pool->m_size)) { r->error(-1, "Shrinking a shm pool is illegal"); return; } @@ -188,7 +188,7 @@ CWLSHMResource::CWLSHMResource(SP resource_) : m_resource(resource_) { // send a few supported formats. No need for any other I think? for (auto const& s : PROTO::shm->m_shmFormats) { - m_resource->sendFormat((wl_shm_format)s); + m_resource->sendFormat(sc(s)); } } -- cgit v1.2.3