From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 19/19] cal: fix few type mismatches
Date: Sun, 2 Jun 2013 18:51:25 +0100 [thread overview]
Message-ID: <1370195485-27907-20-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1370195485-27907-1-git-send-email-kerolasa@iki.fi>
Sloppiness from commit e44fe4712140774b677de466affc31e0581ee335.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
misc-utils/cal.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index befadbe..d6fb32c 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -237,7 +237,7 @@ static char * ascii_day(char *, int);
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 *);
-static int day_in_week(int, int, int);
+static int day_in_week(int, int, long);
static int day_in_year(int, int, long);
static void yearly(int, long, int);
static int do_monthly(int, int, long, struct fmt_st*, int);
@@ -469,11 +469,11 @@ static int do_monthly(int day, int month, long year,
snprintf(lineout, sizeof(lineout), _("%s"), full_month[month - 1]);
center_str(lineout, out->s[pos], ARRAY_SIZE(out->s[pos]), width);
pos++;
- snprintf(lineout, sizeof(lineout), _("%lu"), year);
+ snprintf(lineout, sizeof(lineout), _("%ld"), year);
center_str(lineout, out->s[pos], ARRAY_SIZE(out->s[pos]), width);
pos++;
} else {
- snprintf(lineout, sizeof(lineout), _("%s %lu"),
+ snprintf(lineout, sizeof(lineout), _("%s %ld"),
full_month[month - 1], year);
center_str(lineout, out->s[pos], ARRAY_SIZE(out->s[pos]), width);
pos++;
@@ -514,7 +514,7 @@ static int two_header_lines(int month, long year)
char lineout[FMT_ST_CHARS];
size_t width = (julian ? J_WEEK_LEN : WEEK_LEN) - 1;
size_t len;
- snprintf(lineout, sizeof(lineout), "%lu", year);
+ snprintf(lineout, sizeof(lineout), "%ld", year);
len = strlen(lineout);
len += strlen(full_month[month - 1]) + 1;
if (width < len)
@@ -602,7 +602,7 @@ static void yearly(int day, long year, int julian)
sep_len = HEAD_SEP;
week_len = WEEK_LEN;
}
- snprintf(lineout, sizeof(lineout), "%lu", year);
+ snprintf(lineout, sizeof(lineout), "%ld", year);
/* 2013-04-28: The -1 near sep_len makes year header to be
* aligned exactly how it has been aligned for long time, but it
* is unexplainable. */
@@ -699,7 +699,7 @@ static int day_in_year(int day, int month, long year)
* 3 Sep. 1752 through 13 Sep. 1752, and returns invalid weekday
* during the period of 11 days.
*/
-static int day_in_week(int d, int m, int y)
+static int day_in_week(int d, int m, long y)
{
static const int reform[] = {
SUNDAY, WEDNESDAY, TUESDAY, FRIDAY, SUNDAY, WEDNESDAY,
--
1.8.3
next prev parent reply other threads:[~2013-06-02 17:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-02 17:51 [PATCH 00/19] pull: various clean ups and couple bug fixes Sami Kerola
2013-06-02 17:51 ` [PATCH 01/19] lib: remove unused code Sami Kerola
2013-06-02 17:51 ` [PATCH 02/19] lscpu: add max MHz value to make cpu governor effects more visible Sami Kerola
2013-06-02 17:51 ` [PATCH 03/19] docs: add lscpu max mhz to manual and bash completion Sami Kerola
2013-06-02 17:51 ` [PATCH 04/19] sfdisk: use libc error printing function, and symbolic exit values Sami Kerola
2013-06-07 10:20 ` Karel Zak
2013-06-02 17:51 ` [PATCH 05/19] sfdisk: clean up usage() functions Sami Kerola
2013-06-02 17:51 ` [PATCH 06/19] sfdisk: use program_invocation_short_name to determine program name Sami Kerola
2013-06-02 17:51 ` [PATCH 07/19] docs: correct sfdisk --activate instructions Sami Kerola
2013-06-02 17:51 ` [PATCH 08/19] sfdisk: remove --unhide and related functions Sami Kerola
2013-06-02 17:51 ` [PATCH 09/19] sfdisk: replace my_warn() with warnx() Sami Kerola
2013-06-02 17:51 ` [PATCH 10/19] rev: stop adding new line at the end when input does not have it Sami Kerola
2013-06-02 17:51 ` [PATCH 11/19] rev: simplify new line detection and impossible test Sami Kerola
2013-06-02 17:51 ` [PATCH 12/19] rev: reduce stream checking when closing read-only file descriptor Sami Kerola
2013-06-02 17:51 ` [PATCH 13/19] dmesg: make time format parsing to use enum bit field Sami Kerola
2013-06-03 8:45 ` Karel Zak
2013-06-02 17:51 ` [PATCH 14/19] dmesg: add --time-format option Sami Kerola
2013-06-02 17:51 ` [PATCH 15/19] dmesg: add iso-8601 time format Sami Kerola
2013-06-02 17:51 ` [PATCH 16/19] docs: add --time-format option and ISO-8601 format to manual Sami Kerola
2013-06-02 17:51 ` [PATCH 17/19] dmesg: make usage() a little bit shorter Sami Kerola
2013-06-03 8:56 ` Karel Zak
2013-06-02 17:51 ` [PATCH 18/19] dmesg: more deterministic boot time detection Sami Kerola
2013-06-03 9:35 ` Karel Zak
2013-06-02 17:51 ` Sami Kerola [this message]
2013-06-07 10:28 ` [PATCH 00/19] pull: various clean ups and couple bug fixes Karel Zak
2013-06-07 15:45 ` Sami Kerola
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=1370195485-27907-20-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