max -> nitems

This commit is contained in:
okan 2013-07-16 14:04:44 +00:00
parent ae4ab06559
commit ca416b6b82
3 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ enum color {
CWM_COLOR_MENU_BG, CWM_COLOR_MENU_BG,
CWM_COLOR_MENU_FONT, CWM_COLOR_MENU_FONT,
CWM_COLOR_MENU_FONT_SEL, CWM_COLOR_MENU_FONT_SEL,
CWM_COLOR_MAX CWM_COLOR_NITEMS
}; };
struct geom { struct geom {
@ -223,7 +223,7 @@ struct screen_ctx {
struct geom work; /* workable area, gap-applied */ struct geom work; /* workable area, gap-applied */
struct gap gap; struct gap gap;
struct cycle_entry_q mruq; struct cycle_entry_q mruq;
XftColor xftcolor[CWM_COLOR_MAX]; XftColor xftcolor[CWM_COLOR_NITEMS];
XftDraw *xftdraw; XftDraw *xftdraw;
XftFont *xftfont; XftFont *xftfont;
int xinerama_no; int xinerama_no;
@ -297,7 +297,7 @@ struct conf {
#define CONF_SNAPDIST 0 #define CONF_SNAPDIST 0
int snapdist; int snapdist;
struct gap gap; struct gap gap;
char *color[CWM_COLOR_MAX]; char *color[CWM_COLOR_NITEMS];
char termpath[MAXPATHLEN]; char termpath[MAXPATHLEN];
char lockpath[MAXPATHLEN]; char lockpath[MAXPATHLEN];
char known_hosts[MAXPATHLEN]; char known_hosts[MAXPATHLEN];

2
conf.c
View File

@ -288,7 +288,7 @@ conf_clear(struct conf *c)
free(mb); free(mb);
} }
for (i = 0; i < CWM_COLOR_MAX; i++) for (i = 0; i < CWM_COLOR_NITEMS; i++)
free(c->color[i]); free(c->color[i]);
free(c->font); free(c->font);

View File

@ -597,7 +597,7 @@ parse_config(const char *filename, struct conf *xconf)
(void)strlcpy(xconf->lockpath, conf->lockpath, (void)strlcpy(xconf->lockpath, conf->lockpath,
sizeof(xconf->lockpath)); sizeof(xconf->lockpath));
for (i = 0; i < CWM_COLOR_MAX; i++) for (i = 0; i < CWM_COLOR_NITEMS; i++)
xconf->color[i] = conf->color[i]; xconf->color[i] = conf->color[i];
xconf->font = conf->font; xconf->font = conf->font;