From 8055b1c00a102f5419e40f5eddfb6ee8be693f33 Mon Sep 17 00:00:00 2001 From: phonetic112 <73647246+phonetic112@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:23:23 -0400 Subject: [PATCH] misc: Fix build warnings (#6486) --- hyprpm/src/core/PluginManager.cpp | 7 ++++--- src/helpers/MiscFunctions.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp index f9e9664a..e8c6e251 100644 --- a/hyprpm/src/core/PluginManager.cpp +++ b/hyprpm/src/core/PluginManager.cpp @@ -24,9 +24,10 @@ using namespace Hyprutils::String; static std::string execAndGet(std::string cmd) { cmd += " 2>&1"; - std::array buffer; - std::string result; - const std::unique_ptr pipe(popen(cmd.c_str(), "r"), pclose); + std::array buffer; + std::string result; + using PcloseType = int (*)(FILE*); + const std::unique_ptr pipe(popen(cmd.c_str(), "r"), static_cast(pclose)); if (!pipe) return ""; diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 346a3ffa..821f3231 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -580,9 +580,10 @@ float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Ve // Execute a shell command and get the output std::string execAndGet(const char* cmd) { - std::array buffer; - std::string result; - const std::unique_ptr pipe(popen(cmd, "r"), pclose); + std::array buffer; + std::string result; + using PcloseType = int (*)(FILE*); + const std::unique_ptr pipe(popen(cmd, "r"), static_cast(pclose)); if (!pipe) { Debug::log(ERR, "execAndGet: failed in pipe"); return "";