Run clang-format (#1197)

This commit is contained in:
Jōshin 2024-06-01 13:30:43 -07:00 committed by GitHub
parent ea081b262c
commit f032b5570b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
183 changed files with 1074 additions and 983 deletions

View file

@ -33,19 +33,22 @@ static inline struct Dll *dll_last(struct Dll *list) {
static inline struct Dll *dll_first(struct Dll *list) {
struct Dll *first = 0;
if (list) first = list->next;
if (list)
first = list->next;
return first;
}
static inline struct Dll *dll_next(struct Dll *list, struct Dll *e) {
struct Dll *next = 0;
if (e != list) next = e->next;
if (e != list)
next = e->next;
return next;
}
static inline struct Dll *dll_prev(struct Dll *list, struct Dll *e) {
struct Dll *prev = 0;
if (e != list->next) prev = e->prev;
if (e != list->next)
prev = e->prev;
return prev;
}

View file

@ -22,7 +22,7 @@
*/
#define asint(x) ((union pun){x}).i
#define isnan(x) (((x) & 0x7fff) > 0x7c00)
#define isnan(x) (((x)&0x7fff) > 0x7c00)
union pun {
_Float16 f;

View file

@ -49,7 +49,8 @@ void uvprintf(const char *, va_list) libcesque;
do { \
kprintf("\r\e[30;101mfatal: %s:%d: " FMT "\e[0m\n", __FILE__, __LINE__, \
##__VA_ARGS__); \
for (;;) asm volatile("cli\n\thlt"); \
for (;;) \
asm volatile("cli\n\thlt"); \
} while (0)
COSMOPOLITAN_C_END_

View file

@ -45,7 +45,7 @@
#ifdef __x86_64__
#define INVERT(x) (BANE + PHYSICAL((uintptr_t)(x)))
#define NOPAGE ((uint64_t) - 1)
#define NOPAGE ((uint64_t)-1)
#define APE_STACK_VADDR \
({ \

View file

@ -5,7 +5,8 @@
forceinline void repmovsb(void **dest, const void **src, size_t cx) {
char *di = (char *)*dest;
const char *si = (const char *)*src;
while (cx) *di++ = *si++, cx--;
while (cx)
*di++ = *si++, cx--;
*dest = di, *src = si;
}

View file

@ -4,7 +4,8 @@
forceinline void *repstosb(void *dest, unsigned char al, size_t cx) {
unsigned char *di = (unsigned char *)dest;
while (cx) *di++ = al, cx--;
while (cx)
*di++ = al, cx--;
return di;
}

View file

@ -48,7 +48,8 @@ COSMOPOLITAN_C_START_
({ \
autotype(a) FirstNonNullA = (a); \
autotype(a) FirstNonNullB = (b); \
if (!FirstNonNullA && !FirstNonNullB) abort(); \
if (!FirstNonNullA && !FirstNonNullB) \
abort(); \
FirstNonNullA ? FirstNonNullA : FirstNonNullB; \
})

View file

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/errno.h"
#include "libc/intrin/kprintf.h"
#include "libc/runtime/internal.h"
#include "libc/errno.h"
#include "libc/runtime/runtime.h"
__attribute__((__weak__)) void __stack_chk_fail(void) {

View file

@ -31,7 +31,7 @@ static __vex size_t __strlen(const char *s) {
m = __builtin_ia32_pmovmskb128(*++p == z);
return (const char *)p + __builtin_ctzl(m) - s;
#else
#define ONES ((word) - 1 / 255)
#define ONES ((word)-1 / 255)
#define BANE (ONES * (255 / 2 + 1))
typedef unsigned long mayalias word;
word w;