Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
st.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding some contributors. Thanks to you all!
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
1b01353
..
0fa0c86
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-420,7
+420,6
@@
static int isfullutf8(char *, int);
static ssize_t xwrite(int, char *, size_t);
static void *xmalloc(size_t);
static void *xrealloc(void *, size_t);
static ssize_t xwrite(int, char *, size_t);
static void *xmalloc(size_t);
static void *xrealloc(void *, size_t);
-static void *xcalloc(size_t, size_t);
static void (*handler[LASTEvent])(XEvent *) = {
[KeyPress] = kpress,
static void (*handler[LASTEvent])(XEvent *) = {
[KeyPress] = kpress,
@@
-509,16
+508,6
@@
xrealloc(void *p, size_t len) {
return p;
}
return p;
}
-void *
-xcalloc(size_t nmemb, size_t size) {
- void *p = calloc(nmemb, size);
-
- if(!p)
- die("Out of memory\n");
-
- return p;
-}
-
int
utf8decode(char *s, long *u) {
uchar c;
int
utf8decode(char *s, long *u) {
uchar c;
@@
-1370,7
+1359,7
@@
treset(void) {
void
tnew(int col, int row) {
void
tnew(int col, int row) {
- memset(&term, 0, sizeof(Term));
+ term = (Term){ .c = { .attr = { .fg = defaultfg, .bg = defaultbg } } };
tresize(col, row);
term.numlock = 1;
tresize(col, row);
term.numlock = 1;
@@
-2536,8
+2525,8
@@
tresize(int col, int row) {
/* allocate any new rows */
for(/* i == minrow */; i < row; i++) {
term.dirty[i] = 1;
/* allocate any new rows */
for(/* i == minrow */; i < row; i++) {
term.dirty[i] = 1;
- term.line[i] = xcalloc(col, sizeof(Glyph));
- term.alt [i] = xcalloc(col, sizeof(Glyph));
+ term.line[i] = xmalloc(col * sizeof(Glyph));
+ term.alt[i] = xmalloc(col * sizeof(Glyph));
}
if(col > term.col) {
bp = term.tabs + term.col;
}
if(col > term.col) {
bp = term.tabs + term.col;
@@
-3111,7
+3100,7
@@
xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
winy + font->ascent,
(FcChar8 *)u8fs,
u8fblen);
winy + font->ascent,
(FcChar8 *)u8fs,
u8fblen);
- xp += CEIL(font->width * cwscale * u8fl);
+ xp += xw.cw * u8fl;
}
break;
}
break;
@@
-3121,7
+3110,7
@@
xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
u8fblen += u8cblen;
}
if(doesexist) {
u8fblen += u8cblen;
}
if(doesexist) {
- if (oneatatime);
+ if (oneatatime)
continue;
break;
}
continue;
break;
}
@@
-3184,7
+3173,7
@@
xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
xp, winy + frc[i].font->ascent,
(FcChar8 *)u8c, u8cblen);
xp, winy + frc[i].font->ascent,
(FcChar8 *)u8c, u8cblen);
- xp += CEIL(font->width * cwscale);
+ xp += xw.cw;
}
/*
}
/*
@@
-3714,7
+3703,7
@@
main(int argc, char *argv[]) {
xw.fh = (int)hr;
if(bitm & XNegative && xw.fx == 0)
xw.fx = -1;
xw.fh = (int)hr;
if(bitm & XNegative && xw.fx == 0)
xw.fx = -1;
- if(bitm & XNegative && xw.fy == 0)
+ if(bitm & YNegative && xw.fy == 0)
xw.fy = -1;
if(xw.fh != 0 && xw.fw != 0)
xw.fy = -1;
if(xw.fh != 0 && xw.fw != 0)