From bb863b8f310d84aca399ed34321dd2cce646cf74 Mon Sep 17 00:00:00 2001 From: Jasson Date: Thu, 11 Jul 2024 17:27:18 -0400 Subject: [PATCH] Fix formating --- src/helpers/MiscFunctions.cpp | 8 ++------ src/macros.hpp | 3 +-- src/managers/PointerManager.cpp | 3 +-- src/managers/input/InputManager.cpp | 3 +-- src/managers/input/TextInput.cpp | 9 +++------ src/protocols/Tablet.cpp | 3 +-- src/render/Renderbuffer.cpp | 3 +-- 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index aa034254..712e4e50 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -649,13 +649,9 @@ void matrixProjection(float mat[9], int w, int h, wl_output_transform tr) { int64_t getPPIDof(int64_t pid) { #if defined(KERN_PROC_PID) int mib[] = { - CTL_KERN, - KERN_PROC, - KERN_PROC_PID, - (int)pid, + CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)pid, #if defined(__NetBSD__) || defined(__OpenBSD__) - sizeof(KINFO_PROC), - 1, + sizeof(KINFO_PROC), 1, #endif }; u_int miblen = sizeof(mib) / sizeof(mib[0]); diff --git a/src/macros.hpp b/src/macros.hpp index 67f6301b..f1393cbd 100644 --- a/src/macros.hpp +++ b/src/macros.hpp @@ -40,8 +40,7 @@ #define STICKS(a, b) abs((a) - (b)) < 2 -#define HYPRATOM(name) \ - { name, 0 } +#define HYPRATOM(name) {name, 0} #define RASSERT(expr, reason, ...) \ if (!(expr)) { \ diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index e34aa54b..7090645f 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -235,8 +235,7 @@ void CPointerManager::setCursorBuffer(wlr_buffer* buf, const Vector2D& hotspot, currentCursorImage.size = {buf->width, buf->height}; currentCursorImage.pBuffer = wlr_buffer_lock(buf); - currentCursorImage.hyprListener_destroyBuffer.initCallback( - &buf->events.destroy, [this](void* owner, void* data) { resetCursorImage(); }, this, "CPointerManager"); + currentCursorImage.hyprListener_destroyBuffer.initCallback(&buf->events.destroy, [this](void* owner, void* data) { resetCursorImage(); }, this, "CPointerManager"); } currentCursorImage.hotspot = hotspot; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 9180e9cd..b2bbd577 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1624,8 +1624,7 @@ void CInputManager::newSwitch(wlr_input_device* pDevice) { Debug::log(LOG, "New switch with name \"{}\" added", pDevice->name); - PNEWDEV->hyprListener_destroy.initCallback( - &pDevice->events.destroy, [&](void* owner, void* data) { destroySwitch((SSwitchDevice*)owner); }, PNEWDEV, "SwitchDevice"); + PNEWDEV->hyprListener_destroy.initCallback(&pDevice->events.destroy, [&](void* owner, void* data) { destroySwitch((SSwitchDevice*)owner); }, PNEWDEV, "SwitchDevice"); const auto PSWITCH = wlr_switch_from_input_device(pDevice); diff --git a/src/managers/input/TextInput.cpp b/src/managers/input/TextInput.cpp index 4c7ffe6e..635a8b01 100644 --- a/src/managers/input/TextInput.cpp +++ b/src/managers/input/TextInput.cpp @@ -41,14 +41,11 @@ void CTextInput::initCallbacks() { g_pInputManager->m_sIMERelay.removeTextInput(this); }); } else { - hyprListener_textInputEnable.initCallback( - &pV1Input->sEnable, [this](void* owner, void* data) { onEnabled(); }, this, "textInput"); + hyprListener_textInputEnable.initCallback(&pV1Input->sEnable, [this](void* owner, void* data) { onEnabled(); }, this, "textInput"); - hyprListener_textInputCommit.initCallback( - &pV1Input->sCommit, [this](void* owner, void* data) { onCommit(); }, this, "textInput"); + hyprListener_textInputCommit.initCallback(&pV1Input->sCommit, [this](void* owner, void* data) { onCommit(); }, this, "textInput"); - hyprListener_textInputDisable.initCallback( - &pV1Input->sDisable, [this](void* owner, void* data) { onDisabled(); }, this, "textInput"); + hyprListener_textInputDisable.initCallback(&pV1Input->sDisable, [this](void* owner, void* data) { onDisabled(); }, this, "textInput"); hyprListener_textInputDestroy.initCallback( &pV1Input->sDestroy, diff --git a/src/protocols/Tablet.cpp b/src/protocols/Tablet.cpp index 518ea5bd..7b62f245 100644 --- a/src/protocols/Tablet.cpp +++ b/src/protocols/Tablet.cpp @@ -215,8 +215,7 @@ void CTabletToolV2Resource::queueFrame() { if (frameSource) return; - frameSource = wl_event_loop_add_idle( - g_pCompositor->m_sWLEventLoop, [](void* data) { ((CTabletToolV2Resource*)data)->sendFrame(false); }, this); + frameSource = wl_event_loop_add_idle(g_pCompositor->m_sWLEventLoop, [](void* data) { ((CTabletToolV2Resource*)data)->sendFrame(false); }, this); } void CTabletToolV2Resource::sendFrame(bool removeSource) { diff --git a/src/render/Renderbuffer.cpp b/src/render/Renderbuffer.cpp index b55a921b..3f591d13 100644 --- a/src/render/Renderbuffer.cpp +++ b/src/render/Renderbuffer.cpp @@ -58,8 +58,7 @@ CRenderbuffer::CRenderbuffer(wlr_buffer* buffer, uint32_t format) : m_pWlrBuffer glBindFramebuffer(GL_FRAMEBUFFER, 0); - hyprListener_destroyBuffer.initCallback( - &buffer->events.destroy, [this](void* owner, void* data) { g_pHyprRenderer->onRenderbufferDestroy(this); }, this, "CRenderbuffer"); + hyprListener_destroyBuffer.initCallback(&buffer->events.destroy, [this](void* owner, void* data) { g_pHyprRenderer->onRenderbufferDestroy(this); }, this, "CRenderbuffer"); } CRenderbuffer::CRenderbuffer(SP buffer, uint32_t format) : m_pHLBuffer(buffer), m_uDrmFormat(format) {