Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Make xrealloc and xstrdup style consistent.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
64384cd
..
aba034f
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-298,13
+298,13
@@
typedef struct {
typedef union {
int i;
typedef union {
int i;
- u
nsigned
int ui;
+ uint ui;
float f;
const void *v;
} Arg;
typedef struct {
float f;
const void *v;
} Arg;
typedef struct {
- u
nsigned
int mod;
+ uint mod;
KeySym keysym;
void (*func)(const Arg *);
const Arg arg;
KeySym keysym;
void (*func)(const Arg *);
const Arg arg;
@@
-549,12
+549,10
@@
xrealloc(void *p, size_t len) {
char *
xstrdup(char *s) {
char *
xstrdup(char *s) {
- char *p = strdup(s);
-
- if (!p)
+ if((s = strdup(s)) == NULL)
die("Out of memory\n");
die("Out of memory\n");
- return
p
;
+ return
s
;
}
size_t
}
size_t
@@
-1544,8
+1542,7
@@
tsetchar(char *c, Glyph *attr, int x, int y) {
* The table is proudly stolen from rxvt.
*/
if(attr->mode & ATTR_GFX) {
* The table is proudly stolen from rxvt.
*/
if(attr->mode & ATTR_GFX) {
- if(c[0] >= 0x41 && c[0] <= 0x7e
- && vt100_0[c[0] - 0x41]) {
+ if(BETWEEN(c[0], 0x41, 0x7e) && vt100_0[c[0] - 0x41]) {
c = vt100_0[c[0] - 0x41];
}
}
c = vt100_0[c[0] - 0x41];
}
}
@@
-3076,7
+3073,7
@@
xinit(void) {
xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32,
xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32,
- PropModeReplace, (u
nsigned
char *)&thispid, 1);
+ PropModeReplace, (uchar *)&thispid, 1);
xresettitle();
XMapWindow(xw.dpy, xw.win);
xresettitle();
XMapWindow(xw.dpy, xw.win);