gc unused cmd 'flags' variable

This commit is contained in:
okan 2012-12-19 15:21:34 +00:00
parent c565b790ed
commit dc1e3a8843
3 changed files with 3 additions and 5 deletions

View File

@ -257,7 +257,6 @@ TAILQ_HEAD(mousebinding_q, mousebinding);
struct cmd { struct cmd {
TAILQ_ENTRY(cmd) entry; TAILQ_ENTRY(cmd) entry;
int flags;
char image[MAXPATHLEN]; char image[MAXPATHLEN];
#define CMD_MAXLABELLEN 256 #define CMD_MAXLABELLEN 256
char label[CMD_MAXLABELLEN]; char label[CMD_MAXLABELLEN];
@ -437,7 +436,7 @@ int parse_config(const char *, struct conf *);
void conf_bindname(struct conf *, char *, char *); void conf_bindname(struct conf *, char *, char *);
void conf_clear(struct conf *); void conf_clear(struct conf *);
void conf_client(struct client_ctx *); void conf_client(struct client_ctx *);
void conf_cmd_add(struct conf *, char *, char *, int); void conf_cmd_add(struct conf *, char *, char *);
void conf_color(struct conf *, struct screen_ctx *); void conf_color(struct conf *, struct screen_ctx *);
void conf_font(struct conf *, struct screen_ctx *); void conf_font(struct conf *, struct screen_ctx *);
void conf_gap(struct conf *, struct screen_ctx *); void conf_gap(struct conf *, struct screen_ctx *);

3
conf.c
View File

@ -36,7 +36,7 @@ static void conf_unbind(struct conf *, struct keybinding *);
/* Add an command menu entry to the end of the menu */ /* Add an command menu entry to the end of the menu */
void void
conf_cmd_add(struct conf *c, char *image, char *label, int flags) conf_cmd_add(struct conf *c, char *image, char *label)
{ {
/* "term" and "lock" have special meanings. */ /* "term" and "lock" have special meanings. */
@ -46,7 +46,6 @@ conf_cmd_add(struct conf *c, char *image, char *label, int flags)
(void)strlcpy(c->lockpath, image, sizeof(c->lockpath)); (void)strlcpy(c->lockpath, image, sizeof(c->lockpath));
else { else {
struct cmd *cmd = xmalloc(sizeof(*cmd)); struct cmd *cmd = xmalloc(sizeof(*cmd));
cmd->flags = flags;
(void)strlcpy(cmd->image, image, sizeof(cmd->image)); (void)strlcpy(cmd->image, image, sizeof(cmd->image));
(void)strlcpy(cmd->label, label, sizeof(cmd->label)); (void)strlcpy(cmd->label, label, sizeof(cmd->label));
TAILQ_INSERT_TAIL(&c->cmdq, cmd, entry); TAILQ_INSERT_TAIL(&c->cmdq, cmd, entry);

View File

@ -126,7 +126,7 @@ main : FONTNAME STRING {
conf->snapdist = $2; conf->snapdist = $2;
} }
| COMMAND STRING string { | COMMAND STRING string {
conf_cmd_add(conf, $3, $2, 0); conf_cmd_add(conf, $3, $2);
free($2); free($2);
free($3); free($3);
} }