aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2013-02-19 16:04:54 +0100
committerChristoph Lohmann <20h@r-36.net>2013-02-19 16:04:54 +0100
commit0e738c3d7291675472380a25b74f0358306541e5 (patch)
tree8220df0ae82e22b6d99c52a995ba433da0cd5697
parent7f297e297ccec99a66b7af46e2b1725545ba3746 (diff)
downloadst-patched-0e738c3d7291675472380a25b74f0358306541e5.tar.bz2
st-patched-0e738c3d7291675472380a25b74f0358306541e5.tar.xz
st-patched-0e738c3d7291675472380a25b74f0358306541e5.zip
Style inquisition.
-rw-r--r--st.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/st.c b/st.c
index 8320695..19f8346 100644
--- a/st.c
+++ b/st.c
@@ -1662,7 +1662,7 @@ csihandle(void) {
1662 tmoveto(0, term.c.y-csiescseq.arg[0]); 1662 tmoveto(0, term.c.y-csiescseq.arg[0]);
1663 break; 1663 break;
1664 case 'g': /* TBC -- Tabulation clear */ 1664 case 'g': /* TBC -- Tabulation clear */
1665 switch (csiescseq.arg[0]) { 1665 switch(csiescseq.arg[0]) {
1666 case 0: /* clear current tab stop */ 1666 case 0: /* clear current tab stop */
1667 term.tabs[term.c.x] = 0; 1667 term.tabs[term.c.x] = 0;
1668 break; 1668 break;
@@ -1927,7 +1927,7 @@ techo(char *buf, int len) {
1927 if(c == '\033') { /* escape */ 1927 if(c == '\033') { /* escape */
1928 tputc("^", 1); 1928 tputc("^", 1);
1929 tputc("[", 1); 1929 tputc("[", 1);
1930 } else if (c < '\x20') { /* control code */ 1930 } else if(c < '\x20') { /* control code */
1931 if(c != '\n' && c != '\r' && c != '\t') { 1931 if(c != '\n' && c != '\r' && c != '\t') {
1932 c |= '\x40'; 1932 c |= '\x40';
1933 tputc("^", 1); 1933 tputc("^", 1);
@@ -1937,7 +1937,7 @@ techo(char *buf, int len) {
1937 break; 1937 break;
1938 } 1938 }
1939 } 1939 }
1940 if (len) 1940 if(len)
1941 tputc(buf, len); 1941 tputc(buf, len);
1942} 1942}
1943 1943
@@ -1947,7 +1947,7 @@ tputc(char *c, int len) {
1947 bool control = ascii < '\x20' || ascii == 0177; 1947 bool control = ascii < '\x20' || ascii == 0177;
1948 1948
1949 if(iofd != -1) { 1949 if(iofd != -1) {
1950 if (xwrite(iofd, c, len) < 0) { 1950 if(xwrite(iofd, c, len) < 0) {
1951 fprintf(stderr, "Error writing in %s:%s\n", 1951 fprintf(stderr, "Error writing in %s:%s\n",
1952 opt_io, strerror(errno)); 1952 opt_io, strerror(errno));
1953 close(iofd); 1953 close(iofd);
@@ -2471,8 +2471,8 @@ xunloadfonts(void) {
2471 * Free the loaded fonts in the font cache. This is done backwards 2471 * Free the loaded fonts in the font cache. This is done backwards
2472 * from the frccur. 2472 * from the frccur.
2473 */ 2473 */
2474 for (i = 0, ip = frccur; i < frclen; i++, ip--) { 2474 for(i = 0, ip = frccur; i < frclen; i++, ip--) {
2475 if (ip < 0) 2475 if(ip < 0)
2476 ip = LEN(frc) - 1; 2476 ip = LEN(frc) - 1;
2477 XftFontClose(xw.dpy, frc[ip].font); 2477 XftFontClose(xw.dpy, frc[ip].font);
2478 } 2478 }
@@ -2515,7 +2515,7 @@ xinit(void) {
2515 xw.vis = XDefaultVisual(xw.dpy, xw.scr); 2515 xw.vis = XDefaultVisual(xw.dpy, xw.scr);
2516 2516
2517 /* font */ 2517 /* font */
2518 if (!FcInit()) 2518 if(!FcInit())
2519 die("Could not init fontconfig.\n"); 2519 die("Could not init fontconfig.\n");
2520 2520
2521 usedfont = (opt_font == NULL)? font : opt_font; 2521 usedfont = (opt_font == NULL)? font : opt_font;
@@ -2718,7 +2718,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
2718 XftDrawRect(xw.draw, bg, winx, winy, width, xw.ch); 2718 XftDrawRect(xw.draw, bg, winx, winy, width, xw.ch);
2719 2719
2720 fcsets[0] = font->set; 2720 fcsets[0] = font->set;
2721 for (xp = winx; bytelen > 0;) { 2721 for(xp = winx; bytelen > 0;) {
2722 /* 2722 /*
2723 * Search for the range in the to be printed string of glyphs 2723 * Search for the range in the to be printed string of glyphs
2724 * that are in the main font. Then print that range. If 2724 * that are in the main font. Then print that range. If
@@ -2728,22 +2728,22 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
2728 u8fs = s; 2728 u8fs = s;
2729 u8fblen = 0; 2729 u8fblen = 0;
2730 u8fl = 0; 2730 u8fl = 0;
2731 for (;;) { 2731 for(;;) {
2732 u8c = s; 2732 u8c = s;
2733 u8cblen = utf8decode(s, &u8char); 2733 u8cblen = utf8decode(s, &u8char);
2734 s += u8cblen; 2734 s += u8cblen;
2735 bytelen -= u8cblen; 2735 bytelen -= u8cblen;
2736 2736
2737 doesexist = XftCharIndex(xw.dpy, font->match, u8char); 2737 doesexist = XftCharIndex(xw.dpy, font->match, u8char);
2738 if (!doesexist || bytelen <= 0) { 2738 if(!doesexist || bytelen <= 0) {
2739 if (bytelen <= 0) { 2739 if(bytelen <= 0) {
2740 if (doesexist) { 2740 if(doesexist) {
2741 u8fl++; 2741 u8fl++;
2742 u8fblen += u8cblen; 2742 u8fblen += u8cblen;
2743 } 2743 }
2744 } 2744 }
2745 2745
2746 if (u8fl > 0) { 2746 if(u8fl > 0) {
2747 XftDrawStringUtf8(xw.draw, fg, 2747 XftDrawStringUtf8(xw.draw, fg,
2748 font->match, xp, 2748 font->match, xp,
2749 winy + font->ascent, 2749 winy + font->ascent,
@@ -2757,23 +2757,23 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
2757 u8fl++; 2757 u8fl++;
2758 u8fblen += u8cblen; 2758 u8fblen += u8cblen;
2759 } 2759 }
2760 if (doesexist) 2760 if(doesexist)
2761 break; 2761 break;
2762 2762
2763 frp = frccur; 2763 frp = frccur;
2764 /* Search the font cache. */ 2764 /* Search the font cache. */
2765 for (i = 0; i < frclen; i++, frp--) { 2765 for(i = 0; i < frclen; i++, frp--) {
2766 if (frp <= 0) 2766 if(frp <= 0)
2767 frp = LEN(frc) - 1; 2767 frp = LEN(frc) - 1;
2768 2768
2769 if (frc[frp].c == u8char 2769 if(frc[frp].c == u8char
2770 && frc[frp].flags == frcflags) { 2770 && frc[frp].flags == frcflags) {
2771 break; 2771 break;
2772 } 2772 }
2773 } 2773 }
2774 2774
2775 /* Nothing was found. */ 2775 /* Nothing was found. */
2776 if (i >= frclen) { 2776 if(i >= frclen) {
2777 /* 2777 /*
2778 * Nothing was found in the cache. Now use 2778 * Nothing was found in the cache. Now use
2779 * some dozen of Fontconfig calls to get the 2779 * some dozen of Fontconfig calls to get the
@@ -2801,9 +2801,9 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
2801 */ 2801 */
2802 frccur++; 2802 frccur++;
2803 frclen++; 2803 frclen++;
2804 if (frccur >= LEN(frc)) 2804 if(frccur >= LEN(frc))
2805 frccur = 0; 2805 frccur = 0;
2806 if (frclen > LEN(frc)) { 2806 if(frclen > LEN(frc)) {
2807 frclen = LEN(frc); 2807 frclen = LEN(frc);
2808 XftFontClose(xw.dpy, frc[frccur].font); 2808 XftFontClose(xw.dpy, frc[frccur].font);
2809 } 2809 }
@@ -3085,7 +3085,7 @@ kpress(XEvent *ev) {
3085 Status status; 3085 Status status;
3086 Shortcut *bp; 3086 Shortcut *bp;
3087 3087
3088 if (IS_SET(MODE_KBDLOCK)) 3088 if(IS_SET(MODE_KBDLOCK))
3089 return; 3089 return;
3090 3090
3091 len = XmbLookupString(xw.xic, e, xstr, sizeof(xstr), &ksym, &status); 3091 len = XmbLookupString(xw.xic, e, xstr, sizeof(xstr), &ksym, &status);
@@ -3107,7 +3107,7 @@ kpress(XEvent *ev) {
3107 if(len == 0) 3107 if(len == 0)
3108 return; 3108 return;
3109 3109
3110 if (len == 1 && e->state & Mod1Mask) 3110 if(len == 1 && e->state & Mod1Mask)
3111 *cp++ = '\033'; 3111 *cp++ = '\033';
3112 3112
3113 memcpy(cp, xstr, len); 3113 memcpy(cp, xstr, len);