styling change: remove uneeded parentheses around dereferenced pointer

This commit is contained in:
Bill Kolokithas 2014-02-04 22:35:54 +02:00
parent 4e1d114f4e
commit 9cdaa22e06

20
bar.c
View File

@ -155,41 +155,39 @@ parse (char *text)
xcb_fill_rect (clear_gc, 0, 0, bar_width, BAR_HEIGHT); xcb_fill_rect (clear_gc, 0, 0, bar_width, BAR_HEIGHT);
for (;;) { for (;;) {
if (*p == '\0') if (*p == '\0' || *p == '\n')
return;
if (*p == '\n')
return; return;
if (*p == '\\' && p++ && *p != '\\' && strchr (control_characters, *p)) { if (*p == '\\' && p++ && *p != '\\' && strchr (control_characters, *p)) {
switch (*p++) { switch (*p++) {
case 'f': case 'f':
xcb_set_fg (isdigit(*p) ? (*p)-'0' : 11); xcb_set_fg (isdigit(*p) ? *p-'0' : 11);
p++; p++;
break; break;
case 'b': case 'b':
xcb_set_bg (isdigit(*p) ? (*p)-'0' : 10); xcb_set_bg (isdigit(*p) ? *p-'0' : 10);
p++; p++;
break; break;
case 'u': case 'u':
xcb_set_ud (isdigit(*p) ? (*p)-'0' : 10); xcb_set_ud (isdigit(*p) ? *p-'0' : 10);
p++; p++;
break; break;
#if XINERAMA #if XINERAMA
case 's': case 's':
if ((*p) == 'r') { if (*p == 'r') {
screen = &screens[num_screens - 1]; screen = &screens[num_screens - 1];
} else if ((*p) == 'l') { } else if (*p == 'l') {
screen = &screens[0]; screen = &screens[0];
} else if ((*p) == 'n') { } else if (*p == 'n') {
if (screen == &screens[num_screens - 1]) if (screen == &screens[num_screens - 1])
break; break;
screen++; screen++;
} else if ((*p) == 'p') { } else if (*p == 'p') {
if (screen == screens) if (screen == screens)
break; break;
screen--; screen--;
} else if (isdigit(*p)) { } else if (isdigit(*p)) {
int index = (*p)-'0'; int index = *p-'0';
if (index < num_screens) { if (index < num_screens) {
screen = &screens[index]; screen = &screens[index];
} else { } else {