aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--st.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/st.c b/st.c
index 6522c9d..7dbd87a 100644
--- a/st.c
+++ b/st.c
@@ -408,6 +408,7 @@ static void ttysend(char *, size_t);
408static void ttywrite(const char *, size_t); 408static void ttywrite(const char *, size_t);
409static void tstrsequence(uchar); 409static void tstrsequence(uchar);
410 410
411static inline ushort sixd_to_16bit(int);
411static void xdraws(char *, Glyph, int, int, int, int); 412static void xdraws(char *, Glyph, int, int, int, int);
412static void xhints(void); 413static void xhints(void);
413static void xclear(int, int, int, int); 414static void xclear(int, int, int, int);
@@ -452,6 +453,8 @@ static char *getsel(void);
452static void selcopy(void); 453static void selcopy(void);
453static void selscroll(int, int); 454static void selscroll(int, int);
454static void selsnap(int, int *, int *, int); 455static void selsnap(int, int *, int *, int);
456static int x2col(int);
457static int y2row(int);
455static void getbuttoninfo(XEvent *); 458static void getbuttoninfo(XEvent *);
456static void mousereport(XEvent *); 459static void mousereport(XEvent *);
457 460
@@ -640,7 +643,7 @@ utf8validate(long *u, size_t i) {
640 return i; 643 return i;
641} 644}
642 645
643static void 646void
644selinit(void) { 647selinit(void) {
645 memset(&sel.tclick1, 0, sizeof(sel.tclick1)); 648 memset(&sel.tclick1, 0, sizeof(sel.tclick1));
646 memset(&sel.tclick2, 0, sizeof(sel.tclick2)); 649 memset(&sel.tclick2, 0, sizeof(sel.tclick2));
@@ -653,7 +656,7 @@ selinit(void) {
653 sel.xtarget = XA_STRING; 656 sel.xtarget = XA_STRING;
654} 657}
655 658
656static int 659int
657x2col(int x) { 660x2col(int x) {
658 x -= borderpx; 661 x -= borderpx;
659 x /= xw.cw; 662 x /= xw.cw;
@@ -661,7 +664,7 @@ x2col(int x) {
661 return LIMIT(x, 0, term.col-1); 664 return LIMIT(x, 0, term.col-1);
662} 665}
663 666
664static int 667int
665y2row(int y) { 668y2row(int y) {
666 y -= borderpx; 669 y -= borderpx;
667 y /= xw.ch; 670 y /= xw.ch;
@@ -669,7 +672,7 @@ y2row(int y) {
669 return LIMIT(y, 0, term.row-1); 672 return LIMIT(y, 0, term.row-1);
670} 673}
671 674
672static int tlinelen(int y) { 675int tlinelen(int y) {
673 int i = term.col; 676 int i = term.col;
674 677
675 if(term.line[y][i - 1].mode & ATTR_WRAP) 678 if(term.line[y][i - 1].mode & ATTR_WRAP)
@@ -681,7 +684,7 @@ static int tlinelen(int y) {
681 return i; 684 return i;
682} 685}
683 686
684static void 687void
685selnormalize(void) { 688selnormalize(void) {
686 int i; 689 int i;
687 690
@@ -708,7 +711,7 @@ selnormalize(void) {
708 sel.ne.x = term.col - 1; 711 sel.ne.x = term.col - 1;
709} 712}
710 713
711static inline bool 714bool
712selected(int x, int y) { 715selected(int x, int y) {
713 if(sel.type == SEL_RECTANGULAR) 716 if(sel.type == SEL_RECTANGULAR)
714 return BETWEEN(y, sel.nb.y, sel.ne.y) 717 return BETWEEN(y, sel.nb.y, sel.ne.y)
@@ -2857,7 +2860,7 @@ xresize(int col, int row) {
2857 xclear(0, 0, xw.w, xw.h); 2860 xclear(0, 0, xw.w, xw.h);
2858} 2861}
2859 2862
2860static inline ushort 2863ushort
2861sixd_to_16bit(int x) { 2864sixd_to_16bit(int x) {
2862 return x == 0 ? 0 : 0x3737 + 0x2828 * x; 2865 return x == 0 ? 0 : 0x3737 + 0x2828 * x;
2863} 2866}
@@ -3772,7 +3775,7 @@ focus(XEvent *ev) {
3772 } 3775 }
3773} 3776}
3774 3777
3775static inline bool 3778bool
3776match(uint mask, uint state) { 3779match(uint mask, uint state) {
3777 return mask == XK_ANY_MOD || mask == (state & ~ignoremod); 3780 return mask == XK_ANY_MOD || mask == (state & ~ignoremod);
3778} 3781}