Sprinkle __func__ in appropriate error messages.

This commit is contained in:
okan 2016-10-24 17:39:38 +00:00
parent ffd60b3cab
commit eb43101591
5 changed files with 10 additions and 10 deletions

4
conf.c
View File

@ -138,7 +138,7 @@ conf_screen(struct screen_ctx *sc)
if (sc->xftfont == NULL) {
sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
if (sc->xftfont == NULL)
errx(1, "XftFontOpenName: %s", Conf.font);
errx(1, "%s: XftFontOpenName: %s", __func__, Conf.font);
}
for (i = 0; i < nitems(color_binds); i++) {
@ -169,7 +169,7 @@ conf_screen(struct screen_ctx *sc)
sc->menu.xftdraw = XftDrawCreate(X_Dpy, sc->menu.win, visual, colormap);
if (sc->menu.xftdraw == NULL)
errx(1, "XftDrawCreate");
errx(1, "%s: XftDrawCreate", __func__);
conf_grab_kbd(sc->rootwin);
}

View File

@ -155,7 +155,7 @@ group_movetogroup(struct client_ctx *cc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_movetogroup: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -223,7 +223,7 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_hidetoggle: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -246,7 +246,7 @@ group_only(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_only: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)

View File

@ -405,7 +405,7 @@ kbfunc_menu_exec(void *ctx, union arg *arg, enum xev xev)
label = "wm";
break;
default:
errx(1, "kbfunc_menu_exec: invalid cmd %d", cmd);
errx(1, "%s: invalid cmd %d", __func__, cmd);
/* NOTREACHED */
}
@ -456,7 +456,7 @@ kbfunc_menu_exec(void *ctx, union arg *arg, enum xev xev)
Conf.wm_argv = xstrdup(mi->text);
break;
default:
errx(1, "kb_func: egad, cmd changed value!");
errx(1, "%s: egad, cmd changed value!", __func__);
/* NOTREACHED */
}
}
@ -487,7 +487,7 @@ kbfunc_menu_ssh(void *ctx, union arg *arg, enum xev xev)
TAILQ_INIT(&menuq);
if ((fp = fopen(Conf.known_hosts, "r")) == NULL) {
warn("kbfunc_menu_ssh: %s", Conf.known_hosts);
warn("%s: %s", __func__, Conf.known_hosts);
goto menu;
}

View File

@ -101,7 +101,7 @@ screen_find(Window win)
if (sc->rootwin == win)
return(sc);
}
warnx("screen_find failure win 0x%lu\n", win);
warnx("%s: failure win 0x%lu\n", __func__, win);
return(NULL);
}

View File

@ -85,7 +85,7 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
tier--;
if (tier >= nitems(tierp))
errx(1, "search_match_client: invalid tier");
errx(1, "%s: invalid tier", __func__);
/*
* If you have a tierp, insert after it, and make it