From 61a71c65ace5124cb26a074715280537e6e34d00 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:51:36 +0200 Subject: internal: Formatter rework (#3186) --- src/protocols/TextInputV1.cpp | 2 +- src/protocols/ToplevelExport.cpp | 8 ++++---- src/protocols/WaylandProtocol.cpp | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/TextInputV1.cpp b/src/protocols/TextInputV1.cpp index 5117a382..9156da12 100644 --- a/src/protocols/TextInputV1.cpp +++ b/src/protocols/TextInputV1.cpp @@ -140,7 +140,7 @@ static void destroyTI(wl_resource* resource) { void CTextInputV1ProtocolManager::createTI(wl_client* client, wl_resource* resource, uint32_t id) { const auto PTI = m_pClients.emplace_back(std::make_unique()).get(); - Debug::log(LOG, "New TI V1 at %lx", PTI); + Debug::log(LOG, "New TI V1 at {:x}", (uintptr_t)PTI); PTI->client = client; PTI->resourceCaller = resource; diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index 0efe063c..f5e3c310 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -149,14 +149,14 @@ void CToplevelExportProtocolManager::captureToplevel(wl_client* client, wl_resou PFRAME->pWindow = pWindow; if (!PFRAME->pWindow) { - Debug::log(ERR, "Client requested sharing of window handle %lx which does not exist!", PFRAME->pWindow); + Debug::log(ERR, "Client requested sharing of window handle {:x} which does not exist!", (uintptr_t)PFRAME->pWindow); hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource); removeFrame(PFRAME); return; } if (!PFRAME->pWindow->m_bIsMapped || PFRAME->pWindow->isHidden()) { - Debug::log(ERR, "Client requested sharing of window handle %lx which is not shareable!", PFRAME->pWindow); + Debug::log(ERR, "Client requested sharing of window handle {:x} which is not shareable!", (uintptr_t)PFRAME->pWindow); hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource); removeFrame(PFRAME); return; @@ -223,7 +223,7 @@ void CToplevelExportProtocolManager::copyFrame(wl_client* client, wl_resource* r } if (!PFRAME->pWindow->m_bIsMapped || PFRAME->pWindow->isHidden()) { - Debug::log(ERR, "Client requested sharing of window handle %lx which is not shareable (2)!", PFRAME->pWindow); + Debug::log(ERR, "Client requested sharing of window handle {:x} which is not shareable (2)!", (uintptr_t)PFRAME->pWindow); hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource); removeFrame(PFRAME); return; @@ -406,7 +406,7 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times // copy pixels const auto PFORMAT = get_gles2_format_from_drm(format); if (!PFORMAT) { - Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format %lx", PFORMAT); + Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format {:x}", (uintptr_t)PFORMAT); g_pHyprOpenGL->end(); wlr_buffer_end_data_ptr_access(frame->buffer); if (frame->overlayCursor) diff --git a/src/protocols/WaylandProtocol.cpp b/src/protocols/WaylandProtocol.cpp index 6ff08227..4600126c 100644 --- a/src/protocols/WaylandProtocol.cpp +++ b/src/protocols/WaylandProtocol.cpp @@ -22,14 +22,14 @@ CWaylandResource::CWaylandResource(wl_client* client, const wl_interface* wlInte m_liResourceDestroy.notify = resourceDestroyNotify; wl_resource_add_destroy_listener(m_pWLResource, &m_liResourceDestroy); - Debug::log(TRACE, "[wl res %lx] created", m_pWLResource); + Debug::log(TRACE, "[wl res {:x}] created", (uintptr_t)m_pWLResource); } void CWaylandResource::markDefunct() { if (m_bDefunct) return; - Debug::log(TRACE, "[wl res %lx] now defunct", m_pWLResource); + Debug::log(TRACE, "[wl res {:x}] now defunct", (uintptr_t)m_pWLResource); m_bDefunct = true; wl_resource_set_user_data(m_pWLResource, nullptr); } @@ -40,7 +40,7 @@ CWaylandResource::~CWaylandResource() { wl_list_remove(&m_liResourceDestroy.link); wl_list_init(&m_liResourceDestroy.link); - Debug::log(TRACE, "[wl res %lx] destroying (wl_resource_destroy will be %s)", m_pWLResource, (DESTROY ? "sent" : "not sent")); + Debug::log(TRACE, "[wl res {:x}] destroying (wl_resource_destroy will be {})", (uintptr_t)m_pWLResource, (DESTROY ? "sent" : "not sent")); if (DESTROY) wl_resource_destroy(m_pWLResource); @@ -62,17 +62,17 @@ uint32_t CWaylandResource::version() { void CWaylandResource::setImplementation(const void* impl, wl_resource_destroy_func_t df) { RASSERT(good(), "Attempted to call setImplementation() on a bad resource"); - RASSERT(!m_bImplementationSet, "Wayland Resource %lx already has an implementation, cannot re-set!", m_pWLResource); + RASSERT(!m_bImplementationSet, "Wayland Resource {:x} already has an implementation, cannot re-set!", (uintptr_t)m_pWLResource); wl_resource_set_implementation(m_pWLResource, impl, this, df); - Debug::log(TRACE, "[wl res %lx] set impl to %lx", m_pWLResource, impl); + Debug::log(TRACE, "[wl res {:x}] set impl to {:x}", (uintptr_t)m_pWLResource, (uintptr_t)impl); m_bImplementationSet = true; } void CWaylandResource::setData(void* data) { - Debug::log(TRACE, "[wl res %lx] set data to %lx", m_pWLResource, data); + Debug::log(TRACE, "[wl res {:x}] set data to {:x}", (uintptr_t)m_pWLResource, (uintptr_t)data); m_pData = data; } @@ -96,14 +96,14 @@ IWaylandProtocol::IWaylandProtocol(const wl_interface* iface, const int& ver, co m_pGlobal = wl_global_create(g_pCompositor->m_sWLDisplay, iface, ver, this, &bindManagerInternal); if (!m_pGlobal) { - Debug::log(ERR, "[proto %s] could not create a global", name.c_str()); + Debug::log(ERR, "[proto {}] could not create a global", name); return; } m_liDisplayDestroy.notify = displayDestroyInternal; wl_display_add_destroy_listener(g_pCompositor->m_sWLDisplay, &m_liDisplayDestroy); - Debug::log(LOG, "[proto %s] started", name.c_str()); + Debug::log(LOG, "[proto {}] started", name); } IWaylandProtocol::~IWaylandProtocol() { -- cgit v1.2.3