*: make it easier to distinquish "struct tm", pointer to one, etc

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-01-09 19:10:49 +01:00
parent 0681137972
commit dc698bb038
13 changed files with 130 additions and 121 deletions

View File

@@ -79,7 +79,6 @@ static char *build_row(char *p, unsigned *dp);
int cal_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int cal_main(int argc UNUSED_PARAM, char **argv)
{
struct tm *local_time;
struct tm zero_tm;
time_t now;
unsigned month, year, flags, i;
@@ -94,11 +93,13 @@ int cal_main(int argc UNUSED_PARAM, char **argv)
argv += optind;
if (!argv[0]) {
struct tm *ptm;
time(&now);
local_time = localtime(&now);
year = local_time->tm_year + 1900;
ptm = localtime(&now);
year = ptm->tm_year + 1900;
if (!(flags & 2)) { /* no -y */
month = local_time->tm_mon + 1;
month = ptm->tm_mon + 1;
}
} else {
if (argv[1]) {