aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/menu/drw.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-06-08 14:58:18 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-06-08 14:58:18 -0700
commitac78d59c80b627a5332ac64a7d4359389c4251fa (patch)
treeeb7a1c77a688a703442d4bcf604e97aba1566105 /sys/cmd/menu/drw.c
parent75eece6dd52aa49705bf59a6f5b6197b7a14f5db (diff)
small fixes
Diffstat (limited to 'sys/cmd/menu/drw.c')
-rw-r--r--sys/cmd/menu/drw.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/cmd/menu/drw.c b/sys/cmd/menu/drw.c
index 40dae08..162fe40 100644
--- a/sys/cmd/menu/drw.c
+++ b/sys/cmd/menu/drw.c
@@ -1,11 +1,5 @@
/* See LICENSE file for copyright and license details. */
-#include <u.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xft/Xft.h>
-
-#include "drw.h"
-#include "util.h"
+#include "menu.h"
#define UTF_INVALID 0xFFFD
#define UTF_SIZ 4
@@ -28,7 +22,7 @@ static size_t
utf8validate(long *u, size_t i)
{
if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF))
- *u = UTF_INVALID;
+ *u = RuneErr;
for (i = 1; *u > utfmax[i]; ++i)
;
return i;
@@ -40,7 +34,7 @@ utf8decode(const char *c, long *u, size_t clen)
size_t i, j, len, type;
long udecoded;
- *u = UTF_INVALID;
+ *u = RuneErr;
if (!clen)
return 0;
udecoded = utf8decodebyte(c[0], &len);
@@ -128,7 +122,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
return NULL;
}
} else {
- die("no font specified.");
+ fatal("no font specified.");
}
/* Do not allow using color fonts. This is a workaround for a BadLength
@@ -200,7 +194,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen),
clrname, dest))
- die("error, cannot allocate color '%s'", clrname);
+ fatal("error, cannot allocate color '%s'", clrname);
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
@@ -343,7 +337,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
if (!drw->fonts->pattern) {
/* Refer to the comment in xfont_create for more information. */
- die("the first font in the cache must be loaded from a font string.");
+ fatal("the first font in the cache must be loaded from a font string.");
}
fcpattern = FcPatternDuplicate(drw->fonts->pattern);