Skip to content

Commit bdff58a

Browse files
typelessclaude
andcommitted
Apply clang-format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 56d94ab commit bdff58a

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

include/pup/platform/process.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ struct AsyncProcess final {
7676
std::intptr_t stderr_fd = -1;
7777

7878
[[nodiscard]]
79-
auto active() const -> bool { return pid != -1; }
79+
auto active() const -> bool
80+
{
81+
return pid != -1;
82+
}
8083
};
8184

8285
struct SpawnOptions final {
@@ -96,7 +99,8 @@ struct PollableFd final {
9699
std::size_t slot_index;
97100
};
98101

99-
enum class Signal { Terminate, Kill };
102+
enum class Signal { Terminate,
103+
Kill };
100104

101105
[[nodiscard]]
102106
auto spawn_async(SpawnOptions const& opts) -> Result<AsyncProcess>;

src/platform/process-posix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ auto poll_fds(PollableFd* fds, std::size_t count, int timeout_ms) -> int
451451

452452
// Build pollfd array on stack for typical sizes, heap for large
453453
constexpr auto stack_limit = std::size_t { 64 };
454-
pollfd stack_buf[stack_limit]; // NOLINT(modernize-avoid-c-arrays)
454+
pollfd stack_buf[stack_limit]; // NOLINT(modernize-avoid-c-arrays)
455455
auto* pfds = count <= stack_limit ? stack_buf : new pollfd[count]; // NOLINT
456456

457457
for (auto i = std::size_t { 0 }; i < count; ++i) {

src/platform/process-win32.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ auto spawn_async(SpawnOptions const& opts) -> Result<AsyncProcess>
434434
CloseHandle(pi.hThread);
435435

436436
return AsyncProcess {
437-
.pid = reinterpret_cast<std::intptr_t>(pi.hProcess), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
438-
.stdout_fd = reinterpret_cast<std::intptr_t>(stdout_read), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
439-
.stderr_fd = reinterpret_cast<std::intptr_t>(stderr_read), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
437+
.pid = reinterpret_cast<std::intptr_t>(pi.hProcess), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
438+
.stdout_fd = reinterpret_cast<std::intptr_t>(stdout_read), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
439+
.stderr_fd = reinterpret_cast<std::intptr_t>(stderr_read), // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
440440
};
441441
}
442442

@@ -448,7 +448,7 @@ auto poll_fds(PollableFd* fds, std::size_t count, int timeout_ms) -> int
448448
}
449449

450450
// Save original fds for restoration on ready
451-
std::intptr_t stack_originals[64]; // NOLINT(modernize-avoid-c-arrays)
451+
std::intptr_t stack_originals[64]; // NOLINT(modernize-avoid-c-arrays)
452452
auto* originals = count <= 64 ? stack_originals : new std::intptr_t[count]; // NOLINT
453453
for (std::size_t i = 0; i < count; ++i) {
454454
originals[i] = fds[i].fd;
@@ -478,12 +478,16 @@ auto poll_fds(PollableFd* fds, std::size_t count, int timeout_ms) -> int
478478
}
479479

480480
if (found > 0) {
481-
if (count > 64) { delete[] originals; } // NOLINT
481+
if (count > 64) {
482+
delete[] originals;
483+
} // NOLINT
482484
return found;
483485
}
484486

485487
if (!infinite && GetTickCount64() >= deadline) {
486-
if (count > 64) { delete[] originals; } // NOLINT
488+
if (count > 64) {
489+
delete[] originals;
490+
} // NOLINT
487491
return 0;
488492
}
489493

0 commit comments

Comments
 (0)