Skip to content

Commit 9008b55

Browse files
clang-format
1 parent 4a9fad8 commit 9008b55

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/helpers/MiscFunctions.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -610,20 +610,23 @@ std::vector<pid_t> getAllPIDOf(const std::string& name) {
610610
std::vector<pid_t> results;
611611

612612
#if defined(KERN_PROC_ALL)
613-
int mib[] = {
614-
CTL_KERN, KERN_PROC, KERN_PROC_ALL,
613+
int mib[] = {CTL_KERN,
614+
KERN_PROC,
615+
KERN_PROC_ALL,
615616
#if defined(__NetBSD__) || defined(__OpenBSD__)
616-
0, sizeof(KINFO_PROC), 0
617+
0,
618+
sizeof(KINFO_PROC),
619+
0
617620
#endif
618621
};
619-
u_int miblen = sizeof(mib) / sizeof(mib[0]);
620-
622+
u_int miblen = sizeof(mib) / sizeof(mib[0]);
623+
621624
size_t size = 0;
622625
if (sysctl(mib, miblen, NULL, &size, NULL, 0) == -1)
623626
return results;
624627

625628
std::vector<KINFO_PROC> kprocList(size / sizeof(KINFO_PROC));
626-
629+
627630
if (sysctl(mib, miblen, kprocList.data(), &size, NULL, 0) != -1) {
628631
for (auto& kproc : kprocList) {
629632
#if defined(__DragonFly__)
@@ -648,7 +651,7 @@ std::vector<pid_t> getAllPIDOf(const std::string& name) {
648651
if (!isNumber(dirname))
649652
continue;
650653

651-
const auto pid = std::stoll(dirname);
654+
const auto pid = std::stoll(dirname);
652655
std::string procName = getProcNameOf(pid);
653656

654657
if (procName == name)
@@ -686,14 +689,14 @@ std::string getProcNameOf(pid_t pid) {
686689
return {};
687690
#else
688691
const std::string commPath = "/proc/" + std::to_string(pid) + "/comm";
689-
CFileDescriptor fd{open(commPath.c_str(), O_RDONLY | O_CLOEXEC)};
690-
692+
CFileDescriptor fd{open(commPath.c_str(), O_RDONLY | O_CLOEXEC)};
693+
691694
if (!fd.isValid())
692695
return {};
693696

694-
char buffer[256] = {0};
695-
const auto bytesRead = read(fd.get(), buffer, sizeof(buffer) - 1);
696-
697+
char buffer[256] = {0};
698+
const auto bytesRead = read(fd.get(), buffer, sizeof(buffer) - 1);
699+
697700
if (bytesRead <= 0)
698701
return {};
699702

@@ -705,8 +708,6 @@ std::string getProcNameOf(pid_t pid) {
705708
#endif
706709
}
707710

708-
709-
710711
std::expected<int64_t, std::string> configStringToInt(const std::string& VALUE) {
711712
auto parseHex = [](const std::string& value) -> std::expected<int64_t, std::string> {
712713
try {

src/helpers/MiscFunctions.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ std::optional<std::string> cleanCmdForWorkspace(const std::string&, std
2828
float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Vector2D& p2);
2929
void logSystemInfo();
3030
std::string execAndGet(const char*);
31-
pid_t getPPIDof(pid_t pid);
32-
std::string getProcNameOf(pid_t pid);
33-
std::vector<pid_t> getAllPIDOf(const std::string& name);
31+
pid_t getPPIDof(pid_t pid);
32+
std::string getProcNameOf(pid_t pid);
33+
std::vector<pid_t> getAllPIDOf(const std::string& name);
3434
std::expected<int64_t, std::string> configStringToInt(const std::string&);
3535
Vector2D configStringToVector2D(const std::string&);
3636
std::optional<float> getPlusMinusKeywordResult(std::string in, float relative);

src/managers/KeybindManager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class CKeybindManager {
154154
static void moveWindowOutOfGroup(PHLWINDOW pWindow, const std::string& dir = "");
155155
static void moveWindowIntoGroup(PHLWINDOW pWindow, PHLWINDOW pWindowInDirection);
156156
static void switchToWindow(PHLWINDOW PWINDOWTOCHANGETO, bool preserveFocusHistory = false);
157-
static pid_t spawnRawProc(std::string, PHLWORKSPACE pInitialWorkspace);
158-
static pid_t spawnWithRules(std::string, PHLWORKSPACE pInitialWorkspace);
157+
static pid_t spawnRawProc(std::string, PHLWORKSPACE pInitialWorkspace);
158+
static pid_t spawnWithRules(std::string, PHLWORKSPACE pInitialWorkspace);
159159

160160
// -------------- Dispatchers -------------- //
161161
static SDispatchResult closeActive(std::string);

0 commit comments

Comments
 (0)