Run clang-format on most sources

This commit is contained in:
Justine Tunney 2023-04-26 20:45:01 -07:00
parent 614229e3f4
commit 369f9740de
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
228 changed files with 4844 additions and 4637 deletions

View file

@ -16,11 +16,11 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/runtime/clktck.h"
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/intrin/_getauxval.internal.h"
#include "libc/runtime/clktck.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/auxv.h"

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/sysv/consts/clone.h"
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/ucontext-netbsd.internal.h"
@ -37,7 +38,6 @@
#include "libc/sock/internal.h"
#include "libc/stdalign.internal.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/clone.h"
#include "libc/sysv/consts/futex.h"
#include "libc/sysv/consts/nr.h"
#include "libc/sysv/consts/nrlinux.h"

View file

@ -70,7 +70,7 @@ static void EfiInitVga(struct mman *mm, EFI_SYSTEM_TABLE *SystemTable) {
case 0x00FF0000U:
if (le32toh(PixelInfo->ReservedMask) >= 0x01000000U &&
le32toh(PixelInfo->GreenMask) == 0x0000FF00U &&
le32toh(PixelInfo->BlueMask) == 0x000000FFU) {
le32toh(PixelInfo->BlueMask) == 0x000000FFU) {
vid_typ = PC_VIDEO_BGRX8888;
bytes_per_pix = 4;
}
@ -78,7 +78,7 @@ static void EfiInitVga(struct mman *mm, EFI_SYSTEM_TABLE *SystemTable) {
case 0x000000FFU:
if (le32toh(PixelInfo->ReservedMask) >= 0x01000000U &&
le32toh(PixelInfo->GreenMask) == 0x0000FF00U &&
le32toh(PixelInfo->BlueMask) == 0x00FF0000U) {
le32toh(PixelInfo->BlueMask) == 0x00FF0000U) {
vid_typ = PC_VIDEO_RGBX8888;
bytes_per_pix = 4;
}
@ -86,7 +86,7 @@ static void EfiInitVga(struct mman *mm, EFI_SYSTEM_TABLE *SystemTable) {
case 0x0000F800U:
if (le32toh(PixelInfo->ReservedMask) <= 0x0000FFFFU &&
le32toh(PixelInfo->GreenMask) == 0x000007E0U &&
le32toh(PixelInfo->BlueMask) == 0x0000001FU) {
le32toh(PixelInfo->BlueMask) == 0x0000001FU) {
vid_typ = PC_VIDEO_BGR565;
bytes_per_pix = 2;
}
@ -94,7 +94,7 @@ static void EfiInitVga(struct mman *mm, EFI_SYSTEM_TABLE *SystemTable) {
case 0x00007C00U:
if (le32toh(PixelInfo->ReservedMask) <= 0x0000FFFFU &&
le32toh(PixelInfo->GreenMask) == 0x000003E0U &&
le32toh(PixelInfo->BlueMask) == 0x0000001FU) {
le32toh(PixelInfo->BlueMask) == 0x0000001FU) {
vid_typ = PC_VIDEO_BGR555;
bytes_per_pix = 2;
}
@ -172,12 +172,12 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle,
(0x7e000 - 0x79000 + sizeof(struct EfiArgs) + 4095) / 4096, &Address);
Address = IMAGE_BASE_PHYSICAL;
SystemTable->BootServices->AllocatePages(
AllocateAddress, EfiRuntimeServicesData,
((_end - _base) + 4095) / 4096, &Address);
AllocateAddress, EfiRuntimeServicesData, ((_end - _base) + 4095) / 4096,
&Address);
mm = (struct mman *)0x0500;
SystemTable->BootServices->SetMem(mm, sizeof(*mm), 0);
SystemTable->BootServices->SetMem((void *)0x79000,
0x7e000 - 0x79000 + sizeof(struct EfiArgs), 0);
SystemTable->BootServices->SetMem(
(void *)0x79000, 0x7e000 - 0x79000 + sizeof(struct EfiArgs), 0);
SystemTable->BootServices->CopyMem((void *)IMAGE_BASE_PHYSICAL, _base,
_end - _base);
@ -215,8 +215,7 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle,
case EfiLoaderData:
case EfiBootServicesCode:
case EfiBootServicesData:
if (Desc->PhysicalStart != 0)
break;
if (Desc->PhysicalStart != 0) break;
/* fallthrough */
case EfiConventionalMemory:
mm->e820[j].addr = Desc->PhysicalStart;

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/calls/calls.h"
#include "libc/intrin/bits.h"
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/symbols.internal.h"

View file

@ -39,9 +39,9 @@ struct mman {
struct { /* 0x1d48 — starting cursor pos. */
unsigned short y, x;
} pc_video_curs_info;
unsigned short pc_video_char_height; /* 0x1d4c — character height (useful
for setting cursor shape
in text mode) */
unsigned short pc_video_char_height; /* 0x1d4c — character height (useful
for setting cursor shape
in text mode) */
};
COSMOPOLITAN_C_END_

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/sysv/consts/mremap.h"
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/dce.h"
@ -30,7 +31,6 @@
#include "libc/runtime/memtrack.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/mremap.h"
#include "libc/sysv/errfuns.h"
#define IP(X) (intptr_t)(X)

View file

@ -16,6 +16,7 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/sysv/consts/msync.h"
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/calls/cp.internal.h"
@ -24,7 +25,6 @@
#include "libc/dce.h"
#include "libc/intrin/strace.internal.h"
#include "libc/macros.internal.h"
#include "libc/sysv/consts/msync.h"
/**
* Synchronize memory mapping changes to disk.

View file

@ -18,4 +18,6 @@
*/
#include "libc/runtime/internal.h"
void __stack_chk_fail_local(void) { __stack_chk_fail(); }
void __stack_chk_fail_local(void) {
__stack_chk_fail();
}

View file

@ -7,7 +7,7 @@
#define LITERALLY(NAME) $NAME
/* clang-format on */
#else
#define SYMBOLIC(NAME) NAME
#define SYMBOLIC(NAME) NAME
#define LITERALLY(NAME) NAME
#endif

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/runtime/sysconf.h"
#include "libc/runtime/clktck.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/sysconf.h"
#include "libc/sysv/consts/limits.h"
#include "libc/sysv/consts/rlimit.h"