From 2f507a2f71101e2ff3d3e30012d498893aa725f4 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Fri, 3 Oct 2025 23:47:12 +0200 Subject: [PATCH] clang-format -i --- src/paracomm.c | 4 +--- src/polio-main.c | 3 +-- src/polmon.cc | 35 ++++++++++++++--------------------- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/paracomm.c b/src/paracomm.c index bebeb8f..77186c0 100644 --- a/src/paracomm.c +++ b/src/paracomm.c @@ -122,6 +122,4 @@ int paracomm_send(uint8_t b) { return 0; } -uint8_t paracomm_busy() { - return mosi_state != 0 || miso_state != 0; -} +uint8_t paracomm_busy() { return mosi_state != 0 || miso_state != 0; } diff --git a/src/polio-main.c b/src/polio-main.c index 225b5e8..4a3cc39 100644 --- a/src/polio-main.c +++ b/src/polio-main.c @@ -84,14 +84,13 @@ uint8_t pararecv(uint8_t* buf, uint8_t size) { } memcpy(buf, parabuf, size); if (size < parasize) { - memcpy(parabuf, parabuf+size, parasize - size); + memcpy(parabuf, parabuf + size, parasize - size); } parasize -= size; return size; } - int main() { dosdbt(); parasize = 0; diff --git a/src/polmon.cc b/src/polmon.cc index 1e6f55d..1f984fd 100644 --- a/src/polmon.cc +++ b/src/polmon.cc @@ -179,16 +179,15 @@ void tofatname(const char* name, char* fatname) { uint16_t __readfile__(const char* name, uint16_t addr) { register uint16_t ret asm("ax"); - asm volatile( - "push %2 \n\t" - "push %1 \n\t" - "mov $04, %%ah \n\t" - "int $0x80 \n\t" - "pop %%cx \n\t" - "pop %%cx \n\t" - : "=r"(ret) - : "r"(name), "r"(addr) - : "bx", "cx", "dx", "memory", "cc"); + asm volatile("push %2 \n\t" + "push %1 \n\t" + "mov $04, %%ah \n\t" + "int $0x80 \n\t" + "pop %%cx \n\t" + "pop %%cx \n\t" + : "=r"(ret) + : "r"(name), "r"(addr) + : "bx", "cx", "dx", "memory", "cc"); return ret; } @@ -203,7 +202,7 @@ uint16_t LaunchFile(const char* name, uint8_t argc, uint16_t* argv) { // call 0x100 // retf // XXX: if you change kAddress, the trampoline needs to be updated - constexpr uint8_t kTrampoline[] = { 0xe8, 0xfd, 0x00, 0xcb }; + constexpr uint8_t kTrampoline[] = {0xe8, 0xfd, 0x00, 0xcb}; char fatname[11]; tofatname(name, fatname); @@ -220,8 +219,7 @@ uint16_t LaunchFile(const char* name, uint8_t argc, uint16_t* argv) { register uint16_t ac asm("ax") = argc; register uint16_t av asm("dx") = kArgvAddress; - asm volatile( - "mov %2, %%cx \n\t" + asm volatile("mov %2, %%cx \n\t" "mov %%cx, %%ds \n\t" "mov %%cx, %%es \n\t" "cli \n\t" @@ -238,7 +236,7 @@ uint16_t LaunchFile(const char* name, uint8_t argc, uint16_t* argv) { "pop %%sp \n\t" "mov %%cx, %%ss \n\t" "sti" - : "+r" (ac), "+r" (av) + : "+r"(ac), "+r"(av) : "i"(kSegment), "i"(kAddress) : "bx", "cx", "memory", "cc"); @@ -344,9 +342,7 @@ bool ParseCommand(const char* buf, uint16_t& cur_addr, uint16_t& cur_seg) { return dump; } -void DisplayPrompt() { - puts("> "); -} +void DisplayPrompt() { puts("> "); } [[noreturn]] void polmon() { @@ -403,7 +399,4 @@ int main() { polmon(); } -__attribute__((section(".init"), used)) -void _start() { - main(); -} +__attribute__((section(".init"), used)) void _start() { main(); }