X-Git-Url: https://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/a48473fd8dfd9c8caa5eb9475d899c9b3b518523..70f5db0f88fcc7525dd3b71fc1408cb6e9cb36f5:/xmenu.c diff --git a/xmenu.c b/xmenu.c index 9aa3fb6..4407229 100644 --- a/xmenu.c +++ b/xmenu.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) /* open connection to server and set X variables */ if ((dpy = XOpenDisplay(NULL)) == NULL) - errx(1, "cannot open display"); + errx(1, "could not open display"); screen = DefaultScreen(dpy); visual = DefaultVisual(dpy, screen); rootwin = RootWindow(dpy, screen); @@ -256,9 +256,8 @@ parsefonts(const char *s) i = 0; while (isspace(*p)) p++; - while (i < sizeof buf && *p != '\0' && *p != ',') { + while (i < sizeof buf && *p != '\0' && *p != ',') buf[i++] = *p++; - } if (i >= sizeof buf) errx(1, "font name too long"); if (*p == ',') @@ -268,7 +267,7 @@ parsefonts(const char *s) if ((dc.pattern = FcNameParse((FcChar8 *)buf)) == NULL) errx(1, "the first font in the cache must be loaded from a font string"); if ((dc.fonts[nfont++] = XftFontOpenName(dpy, screen, buf)) == NULL) - errx(1, "cannot load font"); + errx(1, "could not load font"); } } @@ -277,7 +276,7 @@ static void ealloccolor(const char *s, XftColor *color) { if(!XftColorAllocName(dpy, visual, colormap, s, color)) - errx(1, "cannot allocate color: %s", s); + errx(1, "could not allocate color: %s", s); } /* query monitor information and cursor position */ @@ -301,7 +300,7 @@ initmonitor(void) if ((info = XineramaQueryScreens(dpy, &nmons)) != NULL) { int selmon = 0; - if (!mflag || (mflag && (config.monitor < 0 || config.monitor >= nmons))) { + if (!mflag || config.monitor < 0 || config.monitor >= nmons) { for (i = 0; i < nmons; i++) { if (BETWEEN(cursx, info[i].x_org, info[i].x_org + info[i].width) && BETWEEN(cursy, info[i].y_org, info[i].y_org + info[i].height)) { @@ -515,7 +514,7 @@ buildmenutree(unsigned level, const char *label, const char *output, char *file) menu = menu->parent, i++) ; if (menu == NULL) - errx(1, "reached NULL menu"); + errx(1, "improper indentation detected"); /* find last item in the new menu */ for (item = menu->list; item->next != NULL; item = item->next) @@ -865,7 +864,7 @@ grabpointer(void) return; nanosleep(&ts, NULL); } - errx(1, "cannot grab keyboard"); + errx(1, "could not grab pointer"); } /* try to grab keyboard, we may have to wait for another process to ungrab */ @@ -881,7 +880,7 @@ grabkeyboard(void) return; nanosleep(&ts, NULL); } - errx(1, "cannot grab keyboard"); + errx(1, "could not grab keyboard"); } /* load and scale icon */ @@ -895,7 +894,7 @@ loadicon(const char *file) icon = imlib_load_image(file); if (icon == NULL) - errx(1, "cannot load icon %s", file); + errx(1, "could not load icon %s", file); imlib_context_set_image(icon);