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) --- hyprctl/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'hyprctl/main.cpp') diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index daf8d4a8..b15d3e21 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -26,7 +26,9 @@ #include #include #include +#include using namespace Hyprutils::String; +using namespace Hyprutils::Memory; #include "Strings.hpp" @@ -206,7 +208,7 @@ int request(std::string_view arg, int minArgs = 0, bool needRoll = false) { strncpy(serverAddress.sun_path, socketPath.c_str(), sizeof(serverAddress.sun_path) - 1); - if (connect(SERVERSOCKET, (sockaddr*)&serverAddress, SUN_LEN(&serverAddress)) < 0) { + if (connect(SERVERSOCKET, rc(&serverAddress), SUN_LEN(&serverAddress)) < 0) { log("Couldn't connect to " + socketPath + ". (4)"); return 4; } @@ -272,7 +274,7 @@ int requestIPC(std::string_view filename, std::string_view arg) { strncpy(serverAddress.sun_path, socketPath.c_str(), sizeof(serverAddress.sun_path) - 1); - if (connect(SERVERSOCKET, (sockaddr*)&serverAddress, SUN_LEN(&serverAddress)) < 0) { + if (connect(SERVERSOCKET, rc(&serverAddress), SUN_LEN(&serverAddress)) < 0) { log("Couldn't connect to " + socketPath + ". (3)"); return 3; } @@ -475,7 +477,7 @@ int main(int argc, char** argv) { const auto INSTANCES = instances(); - if (INSTANCENO < 0 || static_cast(INSTANCENO) >= INSTANCES.size()) { + if (INSTANCENO < 0 || sc(INSTANCENO) >= INSTANCES.size()) { log("no such instance\n"); return 1; } -- cgit v1.2.3