public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 02/13] cal: rename ascii_wnum() to ascii_weeknum()
Date: Sun, 10 Nov 2013 18:23:29 +0000	[thread overview]
Message-ID: <1384107820-498-3-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1384107820-498-1-git-send-email-kerolasa@iki.fi>

Week is not long word, so it does not need to be enshorted and made more
difficult to understand.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 misc-utils/cal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index f82d02e..bcc1580 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -249,7 +249,7 @@ struct cal_control {
 /* function prototypes */
 static int leap_year(long year);
 static char *ascii_day(char *, int, const struct cal_control *ctl);
-static char *ascii_wnum(char *p, int wn, const struct cal_control *ctl);
+static char *ascii_weeknum(char *p, int wn, const struct cal_control *ctl);
 static int center_str(const char* src, char* dest, size_t dest_size, size_t width);
 static void center(const char *, size_t, int);
 static void day_array(int, int, long, int *, const struct cal_control *ctl);
@@ -558,7 +558,7 @@ static int do_monthly(int day, int month, long year, struct fmt_st *out,
 				if (xd != SPACE) {
 					int wn = week_number(xd & ~TODAY_FLAG,
 							month, year, ctl);
-					p = ascii_wnum(p, wn, ctl);
+					p = ascii_weeknum(p, wn, ctl);
 					break;
 				} else if (col+1 == DAYS_IN_WEEK)
 					p += sprintf(p,"   ");
@@ -679,7 +679,7 @@ static char *append_weeknum(char *p, int *dp,
 		if (xd != SPACE) {
 			int weeknum = week_number(xd & ~TODAY_FLAG,
 					       month + cal + 1, year, ctl);
-			p = ascii_wnum(p, weeknum, ctl);
+			p = ascii_weeknum(p, weeknum, ctl);
 			break;
 		} else if (col+1 == DAYS_IN_WEEK)
 			p += sprintf(p,"   ");
@@ -965,7 +965,7 @@ static char *ascii_day(char *p, int day, const struct cal_control *ctl)
 	return p;
 }
 
-static char *ascii_wnum(char *p, int weeknum, const struct cal_control *ctl)
+static char *ascii_weeknum(char *p, int weeknum, const struct cal_control *ctl)
 {
 	if ((ctl->weektype & WEEK_NUM_MASK) == weeknum)
 		p += sprintf(p,"%s",Senter);
-- 
1.8.4.2


  parent reply	other threads:[~2013-11-10 18:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 18:23 [PATCH 00/13] pull: cal: code revisit part I try II Sami Kerola
2013-11-10 18:23 ` [PATCH 01/13] cal: use control structure for run time configuration Sami Kerola
2013-11-10 18:23 ` Sami Kerola [this message]
2013-11-10 18:23 ` [PATCH 03/13] cal: add input variable names to function prototypes Sami Kerola
2013-11-10 18:23 ` [PATCH 04/13] cal: make day_in_week() use same variable names as other functions Sami Kerola
2013-11-10 18:23 ` [PATCH 05/13] cal: simplify ascii_weeknum() function Sami Kerola
2013-11-10 18:23 ` [PATCH 06/13] cal: determine output width at beginning of run and reuse result Sami Kerola
2013-11-10 18:23 ` [PATCH 07/13] tests: cal: take account week numbers when determing month lenght Sami Kerola
2013-11-10 18:23 ` [PATCH 08/13] cal: make user request to be part of read-only control struct Sami Kerola
2013-11-10 18:23 ` [PATCH 09/13] tests: cal: do not let --week=<num> to adjust requested month Sami Kerola
2013-11-10 18:23 ` [PATCH 10/13] cal: determine how many header lines are needed at initialization Sami Kerola
2013-11-10 18:23 ` [PATCH 11/13] cal: add month contents structure Sami Kerola
2013-11-10 18:23 ` [PATCH 12/13] cal: use month contents structure for --three printing Sami Kerola
2013-12-06 10:07   ` Karel Zak
2013-11-10 18:23 ` [PATCH 13/13] cal: use month contents structure for --year printing Sami Kerola
2013-12-06 10:02 ` [PATCH 00/13] pull: cal: code revisit part I try II Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384107820-498-3-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox