Formatted using clang-format

master
Jef Roosens 2020-12-01 16:17:46 +01:00
parent 47a6d63f6d
commit 1df9f84dcb
8 changed files with 4006 additions and 4423 deletions

View File

@ -7,7 +7,7 @@ endif()
# =====COMPILER===== # =====COMPILER=====
set(CMAKE_C_COMPILER "clang-10") set(CMAKE_C_COMPILER "clang-11")
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)

View File

@ -9,10 +9,9 @@
extern char *argv0; extern char *argv0;
/* use main(int argc, char *argv[]) */ /* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ #define ARGBEGIN \
argv[0] && argv[0][0] == '-'\ for (argv0 = *argv, argv++, argc--; \
&& argv[0][1];\ argv[0] && argv[0][0] == '-' && argv[0][1]; argc--, argv++) { \
argc--, argv++) {\
char argc_; \ char argc_; \
char **argv_; \ char **argv_; \
int brk_; \ int brk_; \
@ -22,29 +21,28 @@ extern char *argv0;
break; \ break; \
} \ } \
int i_; \ int i_; \
for (i_ = 1, brk_ = 0, argv_ = argv;\ for (i_ = 1, brk_ = 0, argv_ = argv; argv[0][i_] && !brk_; i_++) { \
argv[0][i_] && !brk_;\
i_++) {\
if (argv_ != argv) \ if (argv_ != argv) \
break; \ break; \
argc_ = argv[0][i_]; \ argc_ = argv[0][i_]; \
switch (argc_) switch (argc_)
#define ARGEND }\ #define ARGEND \
} \
} }
#define ARGC() argc_ #define ARGC() argc_
#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ #define EARGF(x) \
((x), abort(), (char *)0) :\ ((argv[0][i_ + 1] == '\0' && argv[1] == NULL) \
(brk_ = 1, (argv[0][i_+1] != '\0')?\ ? ((x), abort(), (char *)0) \
(&argv[0][i_+1]) :\ : (brk_ = 1, (argv[0][i_ + 1] != '\0') ? (&argv[0][i_ + 1]) \
(argc--, argv++, argv[0]))) : (argc--, argv++, argv[0])))
#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\ #define ARGF() \
(char *)0 :\ ((argv[0][i_ + 1] == '\0' && argv[1] == NULL) \
(brk_ = 1, (argv[0][i_+1] != '\0')?\ ? (char *)0 \
(&argv[0][i_+1]) :\ : (brk_ = 1, (argv[0][i_ + 1] != '\0') ? (&argv[0][i_ + 1]) \
(argc--, argv++, argv[0]))) : (argc--, argv++, argv[0])))
#endif #endif

View File

@ -122,7 +122,6 @@ static const char *colorname[] = {
"#555555", "#555555",
}; };
/* /*
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, reverse cursor
@ -466,7 +465,6 @@ static uint selmasks[] = {
* Printable characters in ASCII, used to estimate the advance width * Printable characters in ASCII, used to estimate the advance width
* of single wide characters. * of single wide characters.
*/ */
static char ascii_printable[] = static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?"
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~"; "`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -122,7 +122,6 @@ static const char *colorname[] = {
"#555555", "#555555",
}; };
/* /*
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, reverse cursor
@ -466,7 +465,6 @@ static uint selmasks[] = {
* Printable characters in ASCII, used to estimate the advance width * Printable characters in ASCII, used to estimate the advance width
* of single wide characters. * of single wide characters.
*/ */
static char ascii_printable[] = static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?"
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~"; "`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -8,10 +8,10 @@
#define DIVCEIL(n, d) (((n) + ((d)-1)) / (d)) #define DIVCEIL(n, d) (((n) + ((d)-1)) / (d))
#define DEFAULT(a, b) (a) = (a) ? (a) : (b) #define DEFAULT(a, b) (a) = (a) ? (a) : (b)
#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ #define ATTRCMP(a, b) \
(a).bg != (b).bg) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ #define TIMEDIFF(t1, t2) \
(t1.tv_nsec-t2.tv_nsec)/1E6) ((t1.tv_sec - t2.tv_sec) * 1000 + (t1.tv_nsec - t2.tv_nsec) / 1E6)
#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
#define TRUECOLOR(r, g, b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) #define TRUECOLOR(r, g, b) (1 << 24 | (r) << 16 | (g) << 8 | (b))

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,8 @@ enum win_mode {
MODE_MOUSEMANY = 1 << 15, MODE_MOUSEMANY = 1 << 15,
MODE_BRCKTPASTE = 1 << 16, MODE_BRCKTPASTE = 1 << 16,
MODE_NUMLOCK = 1 << 17, MODE_NUMLOCK = 1 << 17,
MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\ MODE_MOUSE =
|MODE_MOUSEMANY, MODE_MOUSEBTN | MODE_MOUSEMOTION | MODE_MOUSEX10 | MODE_MOUSEMANY,
}; };
void xbell(void); void xbell(void);

565
src/x.c

File diff suppressed because it is too large Load Diff