Hi,

both Layout *lt and Geom *geom can be initialized in compile time:

diff -r 4accc080ae2e -r 2fc025a5a54f dwm.c
--- a/dwm.c     Sun Apr 20 00:13:19 2008 +0200
+++ b/dwm.c     Sun Apr 20 00:15:30 2008 +0200
@@ -239,14 +239,15 @@ Cursor cursor[CurLast];
 Cursor cursor[CurLast];
 Display *dpy;
 DC dc = {0};
-Geom *geom = NULL;
-Layout *lt = NULL;
 Window root, barwin;
 
 /* configuration, allows nested code to access above variables */
 #include "config.h"
 #define TAGSZ (LENGTH(tags) * sizeof(Bool))
 static Bool tmp[LENGTH(tags)];
+
+Layout *lt = layouts;
+Geom *geom = geoms;
 
 /* function implementations */
 
@@ -1483,7 +1484,6 @@ setup(void) {
        sh = DisplayHeight(dpy, screen);
        bh = dc.font.height + 2;
        mfact = MFACT;
-       geom = &geoms[0];
        geom->apply();
 
        /* init atoms */
@@ -1518,9 +1518,6 @@ setup(void) {
        seltags = emallocz(TAGSZ);
        prevtags = emallocz(TAGSZ);
        seltags[0] = prevtags[0] = True;
-
-       /* init layouts */
-       lt = &layouts[0];
 
        /* init bar */
        for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {


-Ph

Reply via email to