summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-09-07 16:43:01 +0200
committervaxerski <vaxry@vaxry.net>2023-09-07 16:43:01 +0200
commit398e861b554268e43e8af64ba72c682630302ec3 (patch)
treec19313d5f375fb4c90c7ae049793bebc02764e42 /src
parent0be6b03ee972fcc4921984f3b68469a2ee121511 (diff)
internal: fix warnings
Diffstat (limited to 'src')
-rw-r--r--src/helpers/MiscFunctions.cpp6
-rw-r--r--src/helpers/MiscFunctions.hpp2
-rw-r--r--src/managers/input/InputManager.cpp1
-rw-r--r--src/protocols/ToplevelExport.cpp2
-rw-r--r--src/protocols/ToplevelExportWlrFuncs.hpp2
5 files changed, 6 insertions, 7 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 5ded4f4f..9000eff2 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -590,8 +590,8 @@ int64_t getPPIDof(int64_t pid) {
return 0;
#else
- std::string dir = "/proc/" + std::to_string(pid) + "/status";
- FILE* infile;
+ std::string dir = "/proc/" + std::to_string(pid) + "/status";
+ FILE* infile;
infile = fopen(dir.c_str(), "r");
if (!infile)
@@ -706,6 +706,6 @@ void throwError(const std::string& err) {
throw std::runtime_error(err);
}
-std::string sendToLog(uint8_t level, const std::string& s) {
+void sendToLog(uint8_t level, const std::string& s) {
Debug::log((LogLevel)level, s);
}
diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp
index 592964c9..f53ab4e8 100644
--- a/src/helpers/MiscFunctions.hpp
+++ b/src/helpers/MiscFunctions.hpp
@@ -33,7 +33,7 @@ std::vector<SCallstackFrameInfo> getBacktrace();
void throwError(const std::string& err);
// why, C++.
-std::string sendToLog(uint8_t, const std::string&);
+void sendToLog(uint8_t, const std::string&);
template <typename... Args>
std::string getFormat(const std::string& fmt, Args&&... args) {
std::string fmtdMsg;
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index b7bcdf95..dcd9b133 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -1193,7 +1193,6 @@ void CInputManager::constrainMouse(SMouse* pMouse, wlr_pointer_constraint_v1* co
if (pMouse->currentConstraint == constraint)
return;
- const auto PWINDOW = g_pCompositor->getWindowFromSurface(constraint->surface);
const auto MOUSECOORDS = getMouseCoordsInternal();
pMouse->hyprListener_commitConstraint.removeCallback();
diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp
index f5e3c310..577efef4 100644
--- a/src/protocols/ToplevelExport.cpp
+++ b/src/protocols/ToplevelExport.cpp
@@ -404,7 +404,7 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times
}
// copy pixels
- const auto PFORMAT = get_gles2_format_from_drm(format);
+ const auto PFORMAT = gles2FromDRM(format);
if (!PFORMAT) {
Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format {:x}", (uintptr_t)PFORMAT);
g_pHyprOpenGL->end();
diff --git a/src/protocols/ToplevelExportWlrFuncs.hpp b/src/protocols/ToplevelExportWlrFuncs.hpp
index c7f53341..b580d3f0 100644
--- a/src/protocols/ToplevelExportWlrFuncs.hpp
+++ b/src/protocols/ToplevelExportWlrFuncs.hpp
@@ -298,7 +298,7 @@ static const struct wlr_gles2_pixel_format formats[] = {
#endif
};
-static const struct wlr_gles2_pixel_format* get_gles2_format_from_drm(uint32_t fmt) {
+inline const struct wlr_gles2_pixel_format* gles2FromDRM(uint32_t fmt) {
for (size_t i = 0; i < sizeof(formats) / sizeof(*formats); ++i) {
if (formats[i].drm_format == fmt) {
return &formats[i];