Skip to content

Commit

Permalink
refactor: adjusts shared pointers typings
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroMAdorno4 committed Oct 20, 2024
1 parent 856e161 commit 2ac0b20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int getParamValue(const char* paramName)
return **paramPtr;
}

const std::string& getWorkspaceFromMonitor(PHLMONITOR monitor, const std::string& workspace)
const std::string& getWorkspaceFromMonitor(const PHLMONITOR& monitor, const std::string& workspace)
{
// if the workspace is "empty", we expect the new ID to be the first available ID on the given monitor (not the first ID in the global list)
if (workspace == "empty") {
Expand Down Expand Up @@ -210,7 +210,7 @@ void splitChangeMonitor(const std::string& value)
changeMonitor(false, value);
}

void mapMonitor(PHLMONITOR monitor) // NOLINT(readability-convert-member-functions-to-static)
void mapMonitor(const PHLMONITOR& monitor) // NOLINT(readability-convert-member-functions-to-static)
{
if (monitor->activeMonitorRule.disabled) {
Debug::log(INFO, "[split-monitor-workspaces] Skipping disabled monitor {}", monitor->szName);
Expand Down Expand Up @@ -254,7 +254,7 @@ void mapMonitor(PHLMONITOR monitor) // NOLINT(readability-convert-member-functio
}
}

void unmapMonitor(PHLMONITOR monitor)
void unmapMonitor(const PHLMONITOR& monitor)
{
int workspaceIndex = monitor->ID * g_workspaceCount + 1;

Expand Down Expand Up @@ -314,7 +314,7 @@ void reload()

void monitorAddedCallback(void* /*unused*/, SCallbackInfo& /*unused*/, std::any param)
{ // NOLINT(performance-unnecessary-value-param)
PHLMONITOR monitor = std::any_cast<PHLMONITOR>(param);
auto monitor = std::any_cast<PHLMONITOR>(param);
if (monitor == nullptr) {
Debug::log(WARN, "[split-monitor-workspaces] Monitor added callback called with nullptr?");
return;
Expand All @@ -324,7 +324,7 @@ void monitorAddedCallback(void* /*unused*/, SCallbackInfo& /*unused*/, std::any

void monitorRemovedCallback(void* /*unused*/, SCallbackInfo& /*unused*/, std::any param) // NOLINT(performance-unnecessary-value-param)
{
PHLMONITOR monitor = std::any_cast<PHLMONITOR>(param);
auto monitor = std::any_cast<PHLMONITOR>(param);
if (monitor == nullptr) {
Debug::log(WARN, "[split-monitor-workspaces] Monitor removed callback called with nullptr?");
return;
Expand Down

0 comments on commit 2ac0b20

Please sign in to comment.