summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-08-19 18:50:47 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-08-19 18:50:47 +0200
commitb18e6840152b300f2db8ff8dca16aee0839f864b (patch)
tree67cf230e1fb380a520a9c286646730bfd142150d
parentfixed misappearance of iconified windows on SIGKILL (diff)
downloaddwm-b18e6840152b300f2db8ff8dca16aee0839f864b.tar.gz
dwm-b18e6840152b300f2db8ff8dca16aee0839f864b.zip
renamed char prop[] into buf[]
Diffstat (limited to '')
-rw-r--r--client.c24
-rw-r--r--screen.c30
2 files changed, 27 insertions, 27 deletions
diff --git a/client.c b/client.c
index 9f46a0e..c03770b 100644
--- a/client.c
+++ b/client.c
@@ -7,7 +7,7 @@
7 7
8/* static */ 8/* static */
9 9
10static char prop[128]; 10static char buf[128];
11 11
12static void 12static void
13attachstack(Client *c) { 13attachstack(Client *c) {
@@ -186,12 +186,12 @@ getprops(Client *c) {
186 unsigned int i; 186 unsigned int i;
187 Bool result = False; 187 Bool result = False;
188 188
189 if(gettextprop(c->win, dwmprops, prop, sizeof prop)) { 189 if(gettextprop(c->win, dwmprops, buf, sizeof buf)) {
190 for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) 190 for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++)
191 if((c->tags[i] = prop[i] == '1')) 191 if((c->tags[i] = buf[i] == '1'))
192 result = True; 192 result = True;
193 if(i < sizeof prop - 1 && prop[i] != '\0') 193 if(i < sizeof buf - 1 && buf[i] != '\0')
194 c->isfloating = prop[i] == '1'; 194 c->isfloating = buf[i] == '1';
195 } 195 }
196 return result; 196 return result;
197} 197}
@@ -321,13 +321,13 @@ void
321setprops(Client *c) { 321setprops(Client *c) {
322 unsigned int i; 322 unsigned int i;
323 323
324 for(i = 0; i < ntags && i < sizeof prop - 1; i++) 324 for(i = 0; i < ntags && i < sizeof buf - 1; i++)
325 prop[i] = c->tags[i] ? '1' : '0'; 325 buf[i] = c->tags[i] ? '1' : '0';
326 if(i < sizeof prop - 1) 326 if(i < sizeof buf - 1)
327 prop[i++] = c->isfloating ? '1' : '0'; 327 buf[i++] = c->isfloating ? '1' : '0';
328 prop[i] = '\0'; 328 buf[i] = '\0';
329 XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8, 329 XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8,
330 PropModeReplace, (unsigned char *)prop, i); 330 PropModeReplace, (unsigned char *)buf, i);
331} 331}
332 332
333void 333void
diff --git a/screen.c b/screen.c
index a8b093c..ec8637f 100644
--- a/screen.c
+++ b/screen.c
@@ -28,7 +28,7 @@ typedef struct {
28TAGS 28TAGS
29RULES 29RULES
30 30
31static char prop[512]; 31static char buf[512];
32static unsigned int nrules = 0; 32static unsigned int nrules = 0;
33static unsigned int nlayouts = 0; 33static unsigned int nlayouts = 0;
34static unsigned int ltidx = 0; /* default */ 34static unsigned int ltidx = 0; /* default */
@@ -57,13 +57,13 @@ static void
57setdwmprops(void) { 57setdwmprops(void) {
58 unsigned int i; 58 unsigned int i;
59 59
60 for(i = 0; i < ntags && i < sizeof prop - 1; i++) 60 for(i = 0; i < ntags && i < sizeof buf - 1; i++)
61 prop[i] = seltags[i] ? '1' : '0'; 61 buf[i] = seltags[i] ? '1' : '0';
62 if(i < sizeof prop - 1) 62 if(i < sizeof buf - 1)
63 prop[i++] = (char)ltidx + '0'; 63 buf[i++] = (char)ltidx + '0';
64 prop[i] = '\0'; 64 buf[i] = '\0';
65 XChangeProperty(dpy, root, dwmprops, XA_STRING, 8, 65 XChangeProperty(dpy, root, dwmprops, XA_STRING, 8,
66 PropModeReplace, (unsigned char *)prop, i); 66 PropModeReplace, (unsigned char *)buf, i);
67} 67}
68 68
69LAYOUTS 69LAYOUTS
@@ -81,11 +81,11 @@ applyrules(Client *c) {
81 81
82 /* rule matching */ 82 /* rule matching */
83 XGetClassHint(dpy, c->win, &ch); 83 XGetClassHint(dpy, c->win, &ch);
84 snprintf(prop, sizeof prop, "%s:%s:%s", 84 snprintf(buf, sizeof buf, "%s:%s:%s",
85 ch.res_class ? ch.res_class : "", 85 ch.res_class ? ch.res_class : "",
86 ch.res_name ? ch.res_name : "", c->name); 86 ch.res_name ? ch.res_name : "", c->name);
87 for(i = 0; i < nrules; i++) 87 for(i = 0; i < nrules; i++)
88 if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { 88 if(regs[i].propregex && !regexec(regs[i].propregex, buf, 1, &tmp, 0)) {
89 c->isfloating = rules[i].isfloating; 89 c->isfloating = rules[i].isfloating;
90 for(j = 0; regs[i].tagregex && j < ntags; j++) { 90 for(j = 0; regs[i].tagregex && j < ntags; j++) {
91 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { 91 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
@@ -219,12 +219,12 @@ void
219getdwmprops(void) { 219getdwmprops(void) {
220 unsigned int i; 220 unsigned int i;
221 221
222 if(gettextprop(root, dwmprops, prop, sizeof prop)) { 222 if(gettextprop(root, dwmprops, buf, sizeof buf)) {
223 for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) 223 for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++)
224 seltags[i] = prop[i] == '1'; 224 seltags[i] = buf[i] == '1';
225 if(i < sizeof prop - 1 && prop[i] != '\0') { 225 if(i < sizeof buf - 1 && buf[i] != '\0') {
226 if((unsigned int)(prop[i] - '0') < nlayouts) 226 if((unsigned int)(buf[i] - '0') < nlayouts)
227 ltidx = prop[i] - '0'; 227 ltidx = buf[i] - '0';
228 } 228 }
229 } 229 }
230} 230}