about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authoranselm@anselm1 <unknown>2008-04-20 18:23:59 +0100
committeranselm@anselm1 <unknown>2008-04-20 18:23:59 +0100
commit5fa559dbfc6238a911c210ae4124586c6886df23 (patch)
tree4693d4c6a64a091a4a03db00971e555720baa683
parent146ff227fe0d231bcfc59268364461ab8850c5fe (diff)
downloaddwm-5fa559dbfc6238a911c210ae4124586c6886df23.tar.gz
applied Ph's patch regarding geom and lt initialization
-rw-r--r--dwm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/dwm.c b/dwm.c
index 852f7ac..c174994 100644
--- a/dwm.c
+++ b/dwm.c
@@ -239,14 +239,14 @@ Client *stack = NULL;
 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)];
+Bool tmp[LENGTH(tags)];
+Layout *lt = layouts;
+Geom *geom = geoms;
 
 /* function implementations */
 
@@ -264,7 +264,6 @@ applyrules(Client *c) {
 		if((!r->title || strstr(c->name, r->title))
 		&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
 		&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
-		{
 			c->isfloating = r->isfloating;
 			if(r->tag) {
 				c->tags[idxoftag(r->tag)] = True;
@@ -1483,7 +1482,6 @@ setup(void) {
 	sh = DisplayHeight(dpy, screen);
 	bh = dc.font.height + 2;
 	mfact = MFACT;
-	geom = &geoms[0];
 	geom->apply();
 
 	/* init atoms */
@@ -1519,9 +1517,6 @@ setup(void) {
 	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++) {
 		w = textw(layouts[i].symbol);
@@ -1934,3 +1929,4 @@ main(int argc, char *argv[]) {
 	XCloseDisplay(dpy);
 	return 0;
 }
+
ref='#n48'>48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
                                                                    


































































                                                                              

                         

































                                                                               
                                                                                          
























                                                                                     
                       


































































































                                                                           
# $LynxId: makefile.in,v 1.64 2010/11/26 19:56:45 Doug.Kaufman Exp $
# template-makefile for Lynx src directory

SHELL		= @CONFIG_SHELL@
CDPATH		= .

@SET_MAKE@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
top_srcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= .:$(srcdir)

top_builddir	= ..

# see po/makefile
localedir	= @NLS_DATADIR@/locale

# Symbols which the configure script can set in each makefile:
CC		= @CC@
CPP		= @CPP@
CFLAGS		= @CFLAGS@
DEFS		= @DEFS@
CHARSET_DEFS	= @CHARSET_DEFS@
EXTRA_CPPFLAGS	= @EXTRA_CPPFLAGS@
CPPFLAGS	= @CPPFLAGS@

x		= @EXEEXT@
o		= .@OBJEXT@

BUILD_CC	= @BUILD_CC@
BUILD_CPP	= @BUILD_CPP@
BUILD_CFLAGS	= @BUILD_CFLAGS@
BUILD_CPPFLAGS	= @BUILD_CPPFLAGS@ @DEFS@
BUILD_EXEEXT	= @BUILD_EXEEXT@

YACC		= @YACC@

LIBS		= @LIBS@ $(RESOLVLIB) $(WAISLIB) $(SITE_LIBS)
LDFLAGS		= @EXTRA_LDFLAGS@ @LDFLAGS@

# Symbols inherited from the top-level makefile
RESOLVLIB	= # FIXME: set in parent makefile
SITE_DEFS	= # FIXME: set in parent makefile
SITE_LIBS	= # FIXME: set in parent makefile
WAISLIB		= # FIXME: set in parent makefile

WWWINC		= WWW/Library/Implementation
WWWLIB		= $(top_builddir)/WWW/Library/Implementation/libwww.a

INTLLIB		= @INTLLIBS@
INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@-I$(top_srcdir)/intl

CPP_OPTS	= $(DEFS) $(CHARSET_DEFS) \
		-DLOCALEDIR=\"$(localedir)\" \
		-I. \
		-I$(top_builddir) \
		-Ichrtrans \
		-I$(srcdir)/chrtrans \
		-I$(top_srcdir) \
		-I$(top_srcdir)/src \
		-I$(top_srcdir)/$(WWWINC) \
		$(INTLDIR_CPPFLAGS) $(SITE_DEFS) $(EXTRA_CPPFLAGS) $(CPPFLAGS)
CC_OPTS		= $(CPP_OPTS) $(CFLAGS)

LINT		= @LINT@
LINTOPTS	=

CTAGS		= @CTAGS@

COMPRESS_PROG	=@COMPRESS_PROG@
COMPRESS_EXT	=@COMPRESS_EXT@

CHARTRANS_OBJS	= UCdomap$o UCAux$o UCAuto$o
OBJS		= \
	LYebcdic$o \
	LYClean$o LYShowInfo$o LYEdit$o LYStrings$o LYMail$o \
	HTAlert$o GridText$o LYGetFile$o LYMain$o LYMainLoop$o \
	LYCurses$o LYBookmark$o LYmktime$o LYUtils$o LYOptions$o \
	LYReadCFG$o LYSearch$o LYHistory$o LYForms$o LYPrint$o \
	LYrcFile$o LYDownload$o LYNews$o LYKeymap$o HTML$o \
	HTFWriter$o HTInit$o DefaultStyle$o LYUpload$o \
	LYLeaks$o LYexit$o LYJump$o LYList$o LYCgi$o \
	LYTraversal$o LYEditmap$o LYCharSets$o LYCharUtils$o \
	LYMap$o LYCookie$o LYStyle$o LYHash$o LYPrettySrc$o \
	TRSTable$o parsdate$o $(CHARTRANS_OBJS) @EXTRA_OBJS@ @LIBOBJS@

C_SRC		= $(OBJS:$o=.c)

all: lynx$x

.SUFFIXES : $o .i

# yacc builds .c in target directory, not $(srcdir)
.c$o:
	@RULE_CC@
	@ECHO_CC@$(CC) $(CC_OPTS) -c $<

.c.i:
	@RULE_CC@
	@ECHO_CC@$(CPP) -C $(CPP_OPTS) $< >$@

lynx$x:   message do_chartrans_stuff $(top_builddir)/LYHelp.h $(OBJS) $(WWWLIB)
	@echo "Linking and creating Lynx executable"
	$(CC) $(CC_OPTS) $(LDFLAGS) -o $@  $(OBJS) $(WWWLIB) $(LDFLAGS) $(LIBS) $(INTLLIB)
	@echo "Copying Lynx executable into top-level directory"
	rm -f $(top_builddir)/$@
	cp $@ $(top_builddir)/
	@echo "Welcome to Lynx!"

message:
	@echo "Compiling Lynx sources"

do_chartrans_stuff:
	-cd chrtrans && $(MAKE) \
		SITE_DEFS="$(SITE_DEFS)" \
		BUILD_CFLAGS="$(BUILD_CFLAGS)" \
		BUILD_CPPFLAGS="$(BUILD_CPPFLAGS)" \
		BUILD_LDFLAGS="$(BUILD_LDFLAGS)" \
		BUILD_LIBS="$(BUILD_LIBS)" \
		BUILD_CC="$(BUILD_CC)" tables

lint:
	$(LINT) $(LINTOPTS) $(CPP_OPTS) $(C_SRC)  2>&1 |tee $(top_builddir)/lint.lynx

clean:
	rm -f lynx$x core *.core *.leaks *.i *$o *.bak tags TAGS test_*
	cd chrtrans && $(MAKE) clean

tags:
	$(CTAGS) *.[ch]

distclean: clean

CMN=$(top_srcdir)/WWW/Library/Implementation/

HTFWriter$o :		$(top_srcdir)/userdefs.h
HTInit$o :		$(top_srcdir)/userdefs.h
LYCharSets$o :		$(top_srcdir)/userdefs.h
LYGetFile$o :		$(top_srcdir)/userdefs.h
LYKeymap$o :		$(top_srcdir)/userdefs.h
LYLeaks$o :		$(CMN)LYLeaks.h $(CMN)HTString.h
LYMail$o :		$(top_srcdir)/userdefs.h
LYMain$o :		$(top_srcdir)/userdefs.h $(top_builddir)/lynx_cfg.h
LYMainLoop$o :		$(top_srcdir)/userdefs.h
LYOptions$o :		$(top_srcdir)/userdefs.h
LYReadCFG$o :		$(top_srcdir)/userdefs.h
LYShowInfo$o :		$(top_builddir)/cfg_defs.h
LYTraversal$o :		$(top_srcdir)/userdefs.h
LYUtils$o :		$(top_srcdir)/userdefs.h
LYmktime$o :		$(top_srcdir)/userdefs.h
LYrcFile$o :		$(top_srcdir)/userdefs.h

LYIcon$o:
	windres -i LYIcon.rc -o LYIcon$o -O coff

CHRTR= chrtrans/

TABLES= \
 $(CHRTR)cp1250_uni.h \
 $(CHRTR)cp1251_uni.h \
 $(CHRTR)cp1252_uni.h \
 $(CHRTR)cp1253_uni.h \
 $(CHRTR)cp1255_uni.h \
 $(CHRTR)cp1256_uni.h \
 $(CHRTR)cp1257_uni.h \
 $(CHRTR)cp437_uni.h \
 $(CHRTR)cp737_uni.h \
 $(CHRTR)cp775_uni.h \
 $(CHRTR)cp850_uni.h \
 $(CHRTR)cp852_uni.h \
 $(CHRTR)cp862_uni.h \
 $(CHRTR)cp864_uni.h \
 $(CHRTR)cp866_uni.h \
 $(CHRTR)cp869_uni.h \
 $(CHRTR)def7_uni.h \
 $(CHRTR)dmcs_uni.h \
 $(CHRTR)hp_uni.h \
 $(CHRTR)iso01_uni.h \
 $(CHRTR)iso02_uni.h \
 $(CHRTR)iso03_uni.h \
 $(CHRTR)iso04_uni.h \
 $(CHRTR)iso05_uni.h \
 $(CHRTR)iso06_uni.h \
 $(CHRTR)iso07_uni.h \
 $(CHRTR)iso08_uni.h \
 $(CHRTR)iso09_uni.h \
 $(CHRTR)iso10_uni.h \
 $(CHRTR)iso15_uni.h \
 $(CHRTR)koi8r_uni.h \
 $(CHRTR)mac_uni.h \
 $(CHRTR)mnem_suni.h \
 $(CHRTR)mnem2_suni.h \
 $(CHRTR)next_uni.h \
 $(CHRTR)rfc_suni.h \
 $(CHRTR)utf8_uni.h \
 $(CHRTR)viscii_uni.h

$(TABLES):
	-cd chrtrans && $(MAKE) tables

UCdomap$o :	UCdomap.c \
		chrtrans/UCkd.h \
		chrtrans/makeuctb$(BUILD_EXEEXT) \
		chrtrans/makeuctb.c \
	UCdomap.h $(CMN)UCMap.h $(TABLES) $(top_srcdir)/userdefs.h

chrtrans/makeuctb$(BUILD_EXEEXT):
	cd chrtrans; make makeuctb$(BUILD_EXEEXT)

UCAux$o : UCAux.c $(CMN)UCAux.h $(CMN)UCDefs.h
LYCookie$o : $(top_srcdir)/userdefs.h

test_mktime.o: $(srcdir)/LYmktime.c
	$(CC) -o $@ $(CC_OPTS) -DTEST_DRIVER -c $(srcdir)/LYmktime.c

# test-driver for LYmktime
test_mktime: test_mktime.o parsdate.o LYebcdic.o
	$(CC) -o $@ $(CC_OPTS) test_mktime.o parsdate.o LYebcdic.o

# update generated source (may be in ".", or srcdir)
parsdate.c : $(srcdir)/parsdate.y
	$(YACC)  $(srcdir)/parsdate.y 
	-rm -f $@
	mv y.tab.c $@

depend : $(TABLES)
	makedepend -fmakefile -- $(CC_OPTS) -- $(C_SRC)

# DO NOT DELETE THIS LINE -- make depend depends on it.