mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 08:05:59 +01:00
misc: Fix build warnings (#6486)
This commit is contained in:
parent
5de273a144
commit
8055b1c00a
2 changed files with 8 additions and 6 deletions
|
@ -26,7 +26,8 @@ static std::string execAndGet(std::string cmd) {
|
||||||
cmd += " 2>&1";
|
cmd += " 2>&1";
|
||||||
std::array<char, 128> buffer;
|
std::array<char, 128> buffer;
|
||||||
std::string result;
|
std::string result;
|
||||||
const std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
|
using PcloseType = int (*)(FILE*);
|
||||||
|
const std::unique_ptr<FILE, PcloseType> pipe(popen(cmd.c_str(), "r"), static_cast<PcloseType>(pclose));
|
||||||
if (!pipe)
|
if (!pipe)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,8 @@ float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Ve
|
||||||
std::string execAndGet(const char* cmd) {
|
std::string execAndGet(const char* cmd) {
|
||||||
std::array<char, 128> buffer;
|
std::array<char, 128> buffer;
|
||||||
std::string result;
|
std::string result;
|
||||||
const std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
|
using PcloseType = int (*)(FILE*);
|
||||||
|
const std::unique_ptr<FILE, PcloseType> pipe(popen(cmd, "r"), static_cast<PcloseType>(pclose));
|
||||||
if (!pipe) {
|
if (!pipe) {
|
||||||
Debug::log(ERR, "execAndGet: failed in pipe");
|
Debug::log(ERR, "execAndGet: failed in pipe");
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in a new issue