[hackers] [dwm] removing NULL-terminating **tags definition in config.h

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Fri Oct 05 23:43:49 2007

changeset: 1025:107746bd83f0
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Fri Oct 05 18:30:01 2007 +0200
summary: removing NULL-terminating **tags definition in config.h

diff -r 17a935c3017f -r 107746bd83f0 config.def.h
--- a/config.def.h Wed Oct 03 16:25:25 2007 +0200
+++ b/config.def.h Fri Oct 05 18:30:01 2007 +0200
@@ -12,7 +12,7 @@
 #define SELFGCOLOR "#ffffff"
 
 /* tagging */
-const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "www", NULL };
+const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "www" };
 Rule rules[] = {
         /* class:instance:title regex tags regex isfloating */
         { "Firefox", "www", False },
diff -r 17a935c3017f -r 107746bd83f0 dwm.c
--- a/dwm.c Wed Oct 03 16:25:25 2007 +0200
+++ b/dwm.c Fri Oct 05 18:30:01 2007 +0200
@@ -1467,7 +1467,7 @@ setup(void) {
 
         /* init tags */
         compileregs();
- for(ntags = 0; tags[ntags]; ntags++);
+ ntags = sizeof tags / sizeof tags[0];
         seltags = emallocz(sizeof(Bool) * ntags);
         seltags[0] = True;
 
Received on Fri Oct 05 2007 - 23:43:49 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:29 UTC