summaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2014-06-26 12:37:06 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-06-26 12:37:06 +0200
commit77569526c0166e6364bb635fceb8eeabd58ce683 (patch)
treef38c6555363cd6432a4cacdbe88bd372e99a8af6 /st.c
parentFixed wrong nanosecond factor 10E6. (diff)
downloadst-77569526c0166e6364bb635fceb8eeabd58ce683.tar.gz
st-77569526c0166e6364bb635fceb8eeabd58ce683.zip
Remove CEIL macro
This macro was not correct in some cases, and it was used only in one place, where we did'nt get any benefit in performance of in size, so the macro is removed and ceilf is used instead of it. The only function needed from math.h is ceilf, so this patch defines the prototype of it instead of including math.h.
Diffstat (limited to '')
-rw-r--r--st.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/st.c b/st.c
index f9c9f7a..2b6b717 100644
--- a/st.c
+++ b/st.c
@@ -77,7 +77,6 @@ char *argv0;
77#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg) 77#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
78#define IS_SET(flag) ((term.mode & (flag)) != 0) 78#define IS_SET(flag) ((term.mode & (flag)) != 0)
79#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6) 79#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6)
80#define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
81#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) 80#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
82 81
83#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) 82#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
@@ -2892,6 +2891,7 @@ xloadfonts(char *fontstr, double fontsize) {
2892 FcPattern *pattern; 2891 FcPattern *pattern;
2893 FcResult r_sz, r_psz; 2892 FcResult r_sz, r_psz;
2894 double fontval; 2893 double fontval;
2894 float ceilf(float);
2895 2895
2896 if(fontstr[0] == '-') { 2896 if(fontstr[0] == '-') {
2897 pattern = XftXlfdParse(fontstr, False, False); 2897 pattern = XftXlfdParse(fontstr, False, False);
@@ -2937,8 +2937,8 @@ xloadfonts(char *fontstr, double fontsize) {
2937 } 2937 }
2938 2938
2939 /* Setting character width and height. */ 2939 /* Setting character width and height. */
2940 xw.cw = CEIL(dc.font.width * cwscale); 2940 xw.cw = ceilf(dc.font.width * cwscale);
2941 xw.ch = CEIL(dc.font.height * chscale); 2941 xw.ch = ceilf(dc.font.height * chscale);
2942 2942
2943 FcPatternDel(pattern, FC_SLANT); 2943 FcPatternDel(pattern, FC_SLANT);
2944 FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); 2944 FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);