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

@ -45,13 +45,10 @@ ssize_t sys_readv_vga(struct Fd *fd, const struct iovec *iov, int iovlen) {
void *input = iov[i].iov_base;
size_t len = iov[i].iov_len;
res = _TtyRead(&_vga_tty, input, len);
if (res < 0)
break;
if (res < 0) break;
redd += res;
if (redd != len)
return redd;
if (redd != len) return redd;
}
if (!redd)
return res;
if (!redd) return res;
return redd;
}

View file

@ -39,10 +39,10 @@
#undef KLOGTTY
#define MAYUNROLLLOOPS unrollloops
#define COLOR TtyCanvasColor
#define BPP 32
#define MAPCOLOR TtyGraphMapColor
#define DIRTY TtyGraphDirty
#define COLOR TtyCanvasColor
#define BPP 32
#define MAPCOLOR TtyGraphMapColor
#define DIRTY TtyGraphDirty
#undef UPDATE
#define RESETDIRTY TtyGraphResetDirty
#define DRAWBITMAP TtyGraphDrawBitmap

File diff suppressed because it is too large Load diff

View file

@ -25,9 +25,9 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
#include "libc/dce.h"
#include "libc/vga/vga.internal.h"
#include "libc/runtime/pc.internal.h"
#include "libc/str/str.h"
#include "libc/vga/vga.internal.h"
struct Tty _vga_tty;
@ -58,8 +58,8 @@ void _vga_reinit(struct Tty *tty, unsigned short starty, unsigned short startx,
* Initialize our tty structure from the current screen geometry, screen
* contents, cursor position, & character dimensions.
*/
_StartTty(tty, vid_type, height, width, stride, starty, startx,
chr_ht, chr_wid, vid_buf, init_flags);
_StartTty(tty, vid_type, height, width, stride, starty, startx, chr_ht,
chr_wid, vid_buf, init_flags);
}
textstartup void _vga_init(void) {

View file

@ -76,11 +76,13 @@
#undef VGA_PERSNICKETY_STATUS
/* Flags which are passed to _StartTty(). */
#define kTtyAllocWcs 0x01 /* allocate Unicode character array
(if VGA_USE_WCS also defined) */
#define kTtyKlog 0x02 /* the system might be in an abnormal
state, & we are setting up the tty
to show system messages */
#define kTtyAllocWcs \
0x01 /* allocate Unicode character array \
(if VGA_USE_WCS also defined) */
#define kTtyKlog \
0x02 /* the system might be in an abnormal \
state, & we are setting up the tty \
to show system messages */
/**
* Flags for Tty::pr. These govern properties of individual character cells.
@ -250,7 +252,7 @@ void _TtyBgr555Update(struct Tty *);
void _TtyGraphDrawChar(struct Tty *, size_t, size_t, wchar_t);
void _TtyGraphEraseLineCells(struct Tty *, size_t, size_t, size_t);
void _TtyGraphMoveLineCells(struct Tty *, size_t, size_t, size_t, size_t,
size_t);
size_t);
/*
* Routines that implement emergency or system console output in graphical
@ -260,17 +262,17 @@ void _TtyKlog16Update(struct Tty *);
void _TtyKlog16DrawChar(struct Tty *, size_t, size_t, wchar_t);
void _TtyKlog16EraseLineCells(struct Tty *, size_t, size_t, size_t);
void _TtyKlog16MoveLineCells(struct Tty *, size_t, size_t, size_t, size_t,
size_t);
size_t);
void _TtyKlog32Update(struct Tty *);
void _TtyKlog32DrawChar(struct Tty *, size_t, size_t, wchar_t);
void _TtyKlog32EraseLineCells(struct Tty *, size_t, size_t, size_t);
void _TtyKlog32MoveLineCells(struct Tty *, size_t, size_t, size_t, size_t,
size_t);
size_t);
/* High-level teletypewriter routines. */
void _StartTty(struct Tty *, unsigned char, unsigned short, unsigned short,
unsigned short, unsigned short, unsigned short,
unsigned char, unsigned char, void *, unsigned);
unsigned short, unsigned short, unsigned short, unsigned char,
unsigned char, void *, unsigned);
ssize_t _TtyRead(struct Tty *, void *, size_t);
ssize_t _TtyWrite(struct Tty *, const void *, size_t);
ssize_t _TtyWriteInput(struct Tty *, const void *, size_t);

View file

@ -37,13 +37,10 @@ ssize_t sys_writev_vga(struct Fd *fd, const struct iovec *iov, int iovlen) {
void *output = iov[i].iov_base;
size_t len = iov[i].iov_len;
res = _TtyWrite(&_vga_tty, output, len);
if (res < 0)
break;
if (res < 0) break;
wrote += res;
if (res != len)
return wrote;
if (res != len) return wrote;
}
if (!wrote)
return res;
if (!wrote) return res;
return wrote;
}