[hackers] [sbase] cal: Removed unused "day" variable || Greg Reagle
commit 83616df6fcede3fb7518af4dd0f93a8b1b3e44e2
Author: Greg Reagle <greg.reagle_AT_umbc.edu>
Date: Tue Jan 6 15:14:56 2015 -0500
cal: Removed unused "day" variable
diff --git a/cal.1 b/cal.1
index a679350..c215340 100644
--- a/cal.1
+++ b/cal.1
_AT_@ -14,8 +14,7 @@ cal \- print calendar
.IR firstday ]
.RB [ \-n
.IR nmonths ]
-.RB [ [ [
-.IR day ]
+.RB [ [
.IR month ]
.IR year ]
.SH DESCRIPTION
diff --git a/cal.c b/cal.c
index 28e58fe..53c6022 100644
--- a/cal.c
+++ b/cal.c
_AT_@ -56,7 +56,7 @@ printgrid(int year, int month, int fday, int line)
}
static void
-drawcal(int year, int month, int day, int ncols, int nmons, int fday)
+drawcal(int year, int month, int ncols, int nmons, int fday)
{
char *smon[] = {" January", " February", " March", " April",
" May", " June", " July", " August",
_AT_@ -103,14 +103,14 @@ static void
usage(void)
{
eprintf("usage: %s [-1] [-3] [-m] [-s] [-y] [-c columns]"
- " [-f firstday] [-n nmonths] [ [ [day] month] year]\n",
+ " [-f firstday] [-n nmonths] [ [month] year]\n",
argv0);
}
int
main(int argc, char *argv[])
{
- int year, month, day, ncols, nmons, fday;
+ int year, month, ncols, nmons, fday;
struct tm *ltime;
time_t now;
_AT_@ -118,7 +118,6 @@ main(int argc, char *argv[])
ltime = localtime(&now);
year = ltime->tm_year + 1900;
month = ltime->tm_mon + 1;
- day = ltime->tm_mday;
fday = 0;
ncols = 3;
_AT_@ -160,9 +159,6 @@ main(int argc, char *argv[])
} ARGEND;
switch (argc) {
- case 3:
- day = estrtol(argv[0], 0);
- argv++;
case 2:
month = estrtol(argv[0], 0);
argv++;
_AT_@ -179,7 +175,7 @@ main(int argc, char *argv[])
usage();
}
- drawcal(year, month-1, day, ncols, nmons, fday);
+ drawcal(year, month-1, ncols, nmons, fday);
return 0;
}
Received on Wed Jan 07 2015 - 04:21:18 CET
This archive was generated by hypermail 2.3.0
: Wed Jan 07 2015 - 04:24:16 CET