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/config/ConfigWatcher.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/config/ConfigWatcher.cpp') diff --git a/src/config/ConfigWatcher.cpp b/src/config/ConfigWatcher.cpp index 2ec1c05d..f3a8a2ca 100644 --- a/src/config/ConfigWatcher.cpp +++ b/src/config/ConfigWatcher.cpp @@ -72,15 +72,15 @@ void CConfigWatcher::onInotifyEvent() { if (bytesRead <= 0) return; - for (size_t offset = 0; offset < (size_t)bytesRead;) { - const auto* ev = (const inotify_event*)(buffer.data() + offset); + for (size_t offset = 0; offset < sc(bytesRead);) { + const auto* ev = rc(buffer.data() + offset); - if (offset + sizeof(inotify_event) > (size_t)bytesRead) { + if (offset + sizeof(inotify_event) > sc(bytesRead)) { Debug::log(ERR, "CConfigWatcher: malformed inotify event, truncated header"); break; } - if (offset + sizeof(inotify_event) + ev->len > (size_t)(bytesRead)) { + if (offset + sizeof(inotify_event) + ev->len > sc(bytesRead)) { Debug::log(ERR, "CConfigWatcher: malformed inotify event, truncated name field"); break; } -- cgit v1.2.3