--- config.def.h | 3 +-- st.c | 45 ++++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/config.def.h b/config.def.h index 64e75b8..5375c1c 100644 --- a/config.def.h +++ b/config.def.h _AT_@ -30,7 +30,7 @@ static unsigned int doubleclicktimeout = 300; static unsigned int tripleclicktimeout = 600; /* alt screens */ -static bool allowaltscreen = true; +static int allowaltscreen = 1; /* frames per second st should at maximum draw to the screen */ static unsigned int xfps = 120; _AT_@ -381,4 +381,3 @@ static Key key[] = { static uint selmasks[] = { [SEL_RECTANGULAR] = Mod1Mask, }; - diff --git a/st.c b/st.c index 0260562..7423840 100644 --- a/st.c +++ b/st.c _AT_@ -6,7 +6,6 @@ #include <locale.h> #include <pwd.h> #include <stdarg.h> -#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> _AT_@ -231,7 +230,7 @@ typedef struct { int col; /* nb col */ Line *line; /* screen */ Line *alt; /* alternate screen */ - bool *dirty; /* dirtyness of lines */ + int *dirty; /* dirtyness of lines */ XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */ TCursor c; /* cursor */ int top; /* top scroll limit */ _AT_@ -241,8 +240,8 @@ typedef struct { char trantbl[4]; /* charset table translation */ int charset; /* current charset */ int icharset; /* selected charset for sequence */ - bool numlock; /* lock numbers in keyboard */ - bool *tabs; + int numlock; /* lock numbers in keyboard */ + int *tabs; } Term; /* Purely graphic info */ _AT_@ -258,7 +257,7 @@ typedef struct { Visual *vis; XSetWindowAttributes attrs; int scr; - bool isfixed; /* is fixed geometry? */ + int isfixed; /* is fixed geometry? */ int l, t; /* left and top offset */ int gm; /* geometry mask */ int tw, th; /* tty width and height */ _AT_@ -302,7 +301,7 @@ typedef struct { char *primary, *clipboard; Atom xtarget; - bool alt; + int alt; struct timespec tclick1; struct timespec tclick2; } Selection; _AT_@ -403,14 +402,14 @@ static void tsetscroll(int, int); static void tswapscreen(void); static void tsetdirt(int, int); static void tsetdirtattr(int); -static void tsetmode(bool, bool, int *, int); +static void tsetmode(int, int, int *, int); static void tfulldirt(void); static void techo(Rune); static void tcontrolcode(uchar ); static void tdectest(char ); static int32_t tdefcolor(int *, int *, int); static void tdeftran(char); -static inline bool match(uint, uint); +static inline int match(uint, uint); static void ttynew(void); static void ttyread(void); static void ttyresize(void); _AT_@ -459,7 +458,7 @@ static void selrequest(XEvent *); static void selinit(void); static void selnormalize(void); -static inline bool selected(int, int); +static inline int selected(int, int); static char *getsel(void); static void selcopy(Time); static void selscroll(int, int); _AT_@ -734,10 +733,10 @@ selnormalize(void) { sel.ne.x = term.col - 1; } -bool +int selected(int x, int y) { if(sel.mode == SEL_EMPTY) - return false; + return 0; if(sel.type == SEL_RECTANGULAR) return BETWEEN(y, sel.nb.y, sel.ne.y) _AT_@ -751,7 +750,7 @@ selected(int x, int y) { void selsnap(int *x, int *y, int direction) { int newx, newy, xt, yt; - bool delim, prevdelim; + int delim, prevdelim; Glyph *gp, *prevgp; switch(sel.snap) { _AT_@ -1456,7 +1455,7 @@ tfulldirt(void) { void tcursor(int mode) { static TCursor c[2]; - bool alt = IS_SET(MODE_ALTSCREEN); + int alt = IS_SET(MODE_ALTSCREEN); if(mode == CURSOR_SAVE) { c[alt] = term.c; _AT_@ -1915,9 +1914,9 @@ tsetscroll(int t, int b) { } void -tsetmode(bool priv, bool set, int *args, int narg) { +tsetmode(int priv, int set, int *args, int narg) { int *lim, mode; - bool alt; + int alt; for(lim = args + narg; args < lim; ++args) { if(priv) { _AT_@ -2683,7 +2682,7 @@ eschandle(uchar ascii) { void tputc(Rune u) { char c[UTF_SIZ]; - bool control; + int control; int width, len; Glyph *gp; _AT_@ -2807,7 +2806,7 @@ tresize(int col, int row) { int i; int minrow = MIN(row, term.row); int mincol = MIN(col, term.col); - bool *bp; + int *bp; TCursor c; if(col < 1 || row < 1) { _AT_@ -2903,7 +2902,7 @@ sixd_to_16bit(int x) { return x == 0 ? 0 : 0x3737 + 0x2828 * x; } -bool +int xloadcolor(int i, const char *name, Color *ncolor) { XRenderColor color = { .alpha = 0xffff }; _AT_@ -2928,7 +2927,7 @@ xloadcolor(int i, const char *name, Color *ncolor) { void xloadcols(void) { int i; - static bool loaded; + static int loaded; Color *cp; if(loaded) { _AT_@ -2943,7 +2942,7 @@ xloadcols(void) { else die("Could not allocate color %d\n", i); } - loaded = true; + loaded = 1; } int _AT_@ -3663,7 +3662,7 @@ drawregion(int x1, int y1, int x2, int y2) { int i, x, y, ox, numspecs; Glyph base, new; XftGlyphFontSpec* specs; - bool ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN); + int ena_sel = (sel.ob.x != -1) && (sel.alt == IS_SET(MODE_ALTSCREEN)); if(!(xw.state & WIN_VISIBLE)) return; _AT_@ -3756,7 +3755,7 @@ focus(XEvent *ev) { } } -bool +int match(uint mask, uint state) { return mask == XK_ANY_MOD || mask == (state & ~ignoremod); } _AT_@ -4024,7 +4023,7 @@ main(int argc, char *argv[]) { ARGBEGIN { case 'a': - allowaltscreen = false; + allowaltscreen = 0; break; case 'c': opt_class = EARGF(usage()); -- 1.8.5.5 --Multipart=_Wed__8_Jul_2015_20_45_23_+0200_.YLrupkOLV48Y1fT Content-Type: text/x-diff; name="0003-Align-struct-members.patch" Content-Disposition: attachment; filename="0003-Align-struct-members.patch" Content-Transfer-Encoding: 7bitReceived on Mon Sep 17 2001 - 00:00:00 CEST
This archive was generated by hypermail 2.3.0 : Wed Jul 08 2015 - 21:00:10 CEST