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 3/3] cal: set statically defined data read-only
Date: Sun,  4 Aug 2013 00:15:21 +0100	[thread overview]
Message-ID: <1375571721-30008-3-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1375571721-30008-1-git-send-email-kerolasa@iki.fi>

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

diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index c4ed1d1..d31b51d 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -197,14 +197,14 @@ struct fmt_st
 	char s[FMT_ST_LINES][FMT_ST_CHARS];
 };
 
-static int days_in_month[2][13] = {
+static const int days_in_month[2][13] = {
 	{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
 	{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
 };
 
 /* September 1752 is special, and has static assignments for both date
  * and Julian representations.  */
-static int d_sep1752[MAXDAYS / 2] = {
+static const int d_sep1752[MAXDAYS / 2] = {
 	SPACE,	SPACE,	1,	2,	14,	15,	16,
 	17,	18,	19,	20,	21,	22,	23,
 	24,	25,	26,	27,	28,	29,	30
@@ -658,7 +658,7 @@ static void yearly(int day, long year, int julian)
 static void day_array(int day, int month, long year, int *days)
 {
 	int julday, daynum, dw, dm;
-	int *sep1752;
+	const int *sep1752;
 
 	memcpy(days, empty, MAXDAYS * sizeof(int));
 	if (year == REFORMATION_YEAR && month == REFORMATION_MONTH) {
-- 
1.8.3.4


  parent reply	other threads:[~2013-08-03 23:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03 23:15 [PATCH 1/3] column: use variable lenght printf field width to wprint blanks Sami Kerola
2013-08-03 23:15 ` [PATCH 2/3] more: make output redirection more efficient Sami Kerola
2013-08-05  8:48   ` Karel Zak
2013-08-03 23:15 ` Sami Kerola [this message]
2013-08-05  8:49   ` [PATCH 3/3] cal: set statically defined data read-only Karel Zak
2013-08-05  8:48 ` [PATCH 1/3] column: use variable lenght printf field width to wprint blanks 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=1375571721-30008-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