diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-04 15:48:36 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-14 11:08:14 +0100 |
commit | 41c33eeb44d1b1a4b476810757f7b91032950439 (patch) | |
tree | 2f38da227b9f554d0eab35fdb7c8cfd18e9d88d2 /src/day.c | |
parent | 14b6ae79a25106501a30693889b1c03abd56c8c1 (diff) | |
download | calcurse-41c33eeb44d1b1a4b476810757f7b91032950439.zip |
Use a global configuration variable
This is one of the few valid use cases for a global variable. No need to
make it pseudo-local and pass it from one function to another.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/day.c')
-rw-r--r-- | src/day.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -688,7 +688,7 @@ update_desc (char **desc) } static void -update_rept (struct rpt **rpt, const long start, struct conf *conf) +update_rept (struct rpt **rpt, const long start) { const int SINGLECHAR = 2; int ch, newfreq, date_entered; @@ -749,10 +749,10 @@ update_rept (struct rpt **rpt, const long start, struct conf *conf) do { snprintf (outstr, BUFSIZ, "Enter the new ending date: [%s] or '0'", - DATEFMT_DESC (conf->input_datefmt)); + DATEFMT_DESC (conf.input_datefmt)); status_mesg (_(outstr), ""); timstr = - date_sec2date_str ((*rpt)->until, DATEFMT (conf->input_datefmt)); + date_sec2date_str ((*rpt)->until, DATEFMT (conf.input_datefmt)); if (updatestring (win[STA].p, &timstr, 0, 1) != GETSTRING_VALID) { mem_free (timstr); @@ -770,8 +770,8 @@ update_rept (struct rpt **rpt, const long start, struct conf *conf) struct date new_date; int newmonth, newday, newyear; - if (parse_date (timstr, conf->input_datefmt, - &newyear, &newmonth, &newday, calendar_get_slctd_day ())) + if (parse_date (timstr, conf.input_datefmt, &newyear, &newmonth, + &newday, calendar_get_slctd_day ())) { t = start; lt = localtime (&t); @@ -791,7 +791,7 @@ update_rept (struct rpt **rpt, const long start, struct conf *conf) else { snprintf (outstr, BUFSIZ, msg_fmts, - DATEFMT_DESC (conf->input_datefmt)); + DATEFMT_DESC (conf.input_datefmt)); status_mesg (msg_wrong_date, _(outstr)); wgetch (win[STA].p); date_entered = 0; @@ -808,7 +808,7 @@ update_rept (struct rpt **rpt, const long start, struct conf *conf) /* Edit an already existing item. */ void -day_edit_item (struct conf *conf) +day_edit_item (void) { #define STRT '1' #define END '2' @@ -842,7 +842,7 @@ day_edit_item (struct conf *conf) update_desc (&re->mesg); break; case '2': - update_rept (&re->rpt, re->day, conf); + update_rept (&re->rpt, re->day); break; default: return; @@ -875,7 +875,7 @@ day_edit_item (struct conf *conf) break; case REPT: need_check_notify = 1; - update_rept (&ra->rpt, ra->start, conf); + update_rept (&ra->rpt, ra->start); break; case KEY_GENERIC_CANCEL: return; @@ -1134,7 +1134,7 @@ day_view_note (char *pager) /* Pipe an appointment or event to an external program. */ void -day_pipe_item (struct conf *conf) +day_pipe_item (void) { char cmd[BUFSIZ] = ""; int pout; |