From 97d739ef2aff811b458a501be99a6e325f7b1a61 Mon Sep 17 00:00:00 2001 From: Richard Bainesly Date: Thu, 20 Jun 2024 23:01:11 -0400 Subject: [PATCH] fix integer division --- hyprctl/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 611fee60..40ed0aa2 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -132,7 +132,7 @@ int rollingRead(const int socket, int rate) { buffer.fill('\0'); } - usleep((1 / rate) * 1000000); + usleep(static_cast((1.0 / rate) * 1000000)); } close(socket); return 0; @@ -329,7 +329,7 @@ int main(int argc, char** argv) { const auto ARGS = splitArgs(argc, argv); bool json = false; bool needRoll = false; - int rollRate = 20; + int rollRate = 20; std::string overrideInstance = ""; for (std::size_t i = 0; i < ARGS.size(); ++i) {