From a3e52a291110ce7b866a0d11eeda1619d25f952b Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 11 Jul 2008 14:21:28 +0000 Subject: spacing, declaration lineup to be consistent throughout cwm, readability, and a bit of knf. ok oga@ --- calmwm.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index bbd045e..fe9d425 100644 --- a/calmwm.c +++ b/calmwm.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.c,v 1.22 2008/06/25 01:09:09 oga Exp $ + * $Id: calmwm.c,v 1.23 2008/07/11 14:21:28 okan Exp $ */ #include "headers.h" @@ -44,16 +44,14 @@ struct conf Conf; #define gray_height 2 static char gray_bits[] = {0x02, 0x01}; - static void _sigchld_cb(int); int main(int argc, char **argv) { - int ch; - const char *conf_file = NULL; - - char *display_name = NULL; + const char *conf_file = NULL; + char *display_name = NULL; + int ch; while ((ch = getopt(argc, argv, "c:d:")) != -1) { switch (ch) { @@ -110,8 +108,8 @@ main(int argc, char **argv) void x_setup(char *display_name) { - int i; - struct screen_ctx *sc; + struct screen_ctx *sc; + int i; TAILQ_INIT(&Screenq); @@ -140,13 +138,13 @@ x_setup(char *display_name) void x_setupscreen(struct screen_ctx *sc, u_int which) { - XColor tmp; - XGCValues gv; - Window *wins, w0, w1; - u_int nwins, i = 0; - XWindowAttributes winattr; - XSetWindowAttributes rootattr; - struct keybinding *kb; + XColor tmp; + XGCValues gv; + Window *wins, w0, w1; + XWindowAttributes winattr; + XSetWindowAttributes rootattr; + struct keybinding *kb; + u_int nwins, i; Curscreen = sc; @@ -247,8 +245,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which) char * x_screenname(int which) { - char *cp, *dstr, *sn; - size_t snlen; + char *cp, *dstr, *sn; + size_t snlen; if (which > 9) errx(1, "Can't handle more than 9 screens. If you need it, " @@ -298,9 +296,9 @@ x_errorhandler(Display *dpy, XErrorEvent *e) static void _sigchld_cb(int which) { - pid_t pid; - int save_errno = errno; - int status; + pid_t pid; + int save_errno = errno; + int status; /* Collect dead children. */ while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || @@ -313,7 +311,7 @@ _sigchld_cb(int which) __dead void usage(void) { - extern char *__progname; + extern char *__progname; fprintf(stderr, "usage: %s [-c file] [-d display]\n", __progname); exit(1); -- cgit v1.2.3-2-gb3c3