diff options
author | Sami Kerola | 2013-08-04 01:15:21 +0200 |
---|---|---|
committer | Karel Zak | 2013-08-05 10:47:51 +0200 |
commit | 1beb933efde7bcb6b65122a5b88bdde2bf451dc6 (patch) | |
tree | 8441c9dcc40c22de1861947f65015cdfd594e70b /misc-utils/cal.c | |
parent | more: make output redirection more efficient (diff) | |
download | kernel-qcow2-util-linux-1beb933efde7bcb6b65122a5b88bdde2bf451dc6.tar.gz kernel-qcow2-util-linux-1beb933efde7bcb6b65122a5b88bdde2bf451dc6.tar.xz kernel-qcow2-util-linux-1beb933efde7bcb6b65122a5b88bdde2bf451dc6.zip |
cal: set statically defined data read-only
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/cal.c')
-rw-r--r-- | misc-utils/cal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c index c4ed1d1fe..d31b51d0b 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) { |