mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-01 12:23:48 -07:00
refactor: Use new hyprutils casts (#11377)
This commit is contained in:
@@ -72,7 +72,7 @@ class CTestKeyboard : public IKeyboard {
|
||||
|
||||
void sendKey(uint32_t key, bool pressed) {
|
||||
auto event = IKeyboard::SKeyEvent{
|
||||
.timeMs = static_cast<uint32_t>(Time::millis(Time::steadyNow())),
|
||||
.timeMs = sc<uint32_t>(Time::millis(Time::steadyNow())),
|
||||
.keycode = key,
|
||||
.state = pressed ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED,
|
||||
};
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include <csignal>
|
||||
#include <cerrno>
|
||||
#include <print>
|
||||
#include <hyprutils/memory/Casts.hpp>
|
||||
using namespace Hyprutils::Memory;
|
||||
|
||||
static int getUID() {
|
||||
const auto UID = getuid();
|
||||
@@ -95,7 +97,7 @@ std::string getFromSocket(const std::string& cmd) {
|
||||
|
||||
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<sockaddr*>(&serverAddress), SUN_LEN(&serverAddress)) < 0) {
|
||||
std::println("Couldn't connect to {}. (3)", socketPath);
|
||||
return "";
|
||||
}
|
||||
|
Reference in New Issue
Block a user