mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-13 22:49:11 +00:00
Run clang-format (#1197)
This commit is contained in:
parent
ea081b262c
commit
f032b5570b
183 changed files with 1074 additions and 983 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -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 \
|
||||
({ \
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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; \
|
||||
})
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue