[hackers] [dmenu] cleaned up || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Tue, 29 Jun 2010 23:05:39 +0000 (UTC)

changeset: 330:39494f08df06
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Wed Jun 30 00:05:32 2010 +0100
files: dmenu.c
description:
cleaned up

diff -r 5c19bf03b06f -r 39494f08df06 dmenu.c
--- a/dmenu.c Tue Jun 29 19:19:20 2010 +0100
+++ b/dmenu.c Wed Jun 30 00:05:32 2010 +0100
@@ -43,7 +43,7 @@
 static void match(char *pattern);
 static void readstdin(void);
 static void run(void);
-static void setup(Bool topbar);
+static void setup(void);
 
 #include "config.h"
 #include "draw.h"
@@ -63,6 +63,7 @@
 static unsigned long normcol[ColLast];
 static unsigned long selcol[ColLast];
 static Bool running = True;
+static Bool topbar = True;
 static DC dc;
 static Display *dpy;
 static Item *allitems = NULL; /* first of all items */
@@ -475,7 +476,7 @@
 }
 
 void
-setup(Bool topbar) {
+setup(void) {
         int i, j, x, y;
 #if XINERAMA
         int n;
@@ -529,7 +530,8 @@
         else
 #endif
         {
- XGetWindowAttributes(dpy, parent, &pwa);
+ if(!XGetWindowAttributes(dpy, parent, &pwa))
+ eprint("cannot get window attributes");
                 x = 0;
                 y = topbar ? 0 : pwa.height - mh;
                 mw = pwa.width;
@@ -553,7 +555,6 @@
 int
 main(int argc, char *argv[]) {
         unsigned int i;
- Bool topbar = True;
 
         /* command line args */
         progname = argv[0];
@@ -613,7 +614,7 @@
         readstdin();
         running = grabkeyboard();
 
- setup(topbar);
+ setup();
         drawmenu();
         XSync(dpy, False);
         run();
Received on Tue Jun 29 2010 - 23:05:39 UTC

This archive was generated by hypermail 2.2.0 : Tue Jun 29 2010 - 23:12:04 UTC