X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=c67619de7d5270cb3cc99a821af597c8a6e0f67b;hb=5528280fae23968ffd3cf0527881cabddc24cf85;hp=d22c605e66fe7805464f12e04853af05423c6783;hpb=215bdb2da3eca77ba01b70503c527baaad67c359;p=st.git diff --git a/st.c b/st.c index d22c605..c67619d 100644 --- a/st.c +++ b/st.c @@ -673,7 +673,8 @@ y2row(int y) { return LIMIT(y, 0, term.row-1); } -int tlinelen(int y) { +int +tlinelen(int y) { int i = term.col; if(term.line[y][i - 1].mode & ATTR_WRAP) @@ -2503,7 +2504,6 @@ tstrsequence(uchar c) { strreset(); strescseq.type = c; term.esc |= ESC_STR; - return; } void @@ -2585,7 +2585,6 @@ tcontrolcode(uchar ascii) { } /* only CAN, SUB, \a and C1 chars interrupt a sequence */ term.esc &= ~(ESC_STR_END|ESC_STR); - return; } /* @@ -3991,7 +3990,7 @@ run(void) { clock_gettime(CLOCK_MONOTONIC, &now); drawtimeout.tv_sec = 0; - drawtimeout.tv_nsec = (1000/xfps) * 1E6; + drawtimeout.tv_nsec = (1000 * 1E6)/ xfps; tv = &drawtimeout; dodraw = 0; @@ -4002,8 +4001,7 @@ run(void) { dodraw = 1; } deltatime = TIMEDIFF(now, last); - if(deltatime > (xev? (1000/xfps) : (1000/actionfps)) - || deltatime < 0) { + if(deltatime > 1000 / (xev ? xfps : actionfps)) { dodraw = 1; last = now; }