Skip to content

Commit

Permalink
casts to silence warnings for 64-bit time_t
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowman committed Sep 24, 2013
1 parent 0a3836a commit 38968ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion if.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ show_int(int argc, char **argv)
printf(" (last change ");
if (days)
printf("%id ", days);
printf("%02i:%02i:%02i)", hours, mins, c);
printf("%02i:%02i:%02i)", hours, mins, (int)c);
}

printf(", protocol is %s", flags & IFF_RUNNING ? "up" : "down");
Expand Down
4 changes: 2 additions & 2 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ format_time(time_t seconds)
} else {
/* standard method produces MMM:SS */
/* we avoid printf as must as possible to make this quick */
snprintf(result, sizeof(result), "%3d:%02d", seconds / 60,
seconds % 60);
snprintf(result, sizeof(result), "%3d:%02d", (int)seconds / 60,
(int)seconds % 60);
}
return (result);
}
Expand Down
2 changes: 1 addition & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ version(int argc, char **argv)
pntd = 1;
}
if (!pntd)
printf("%d second%s", c, c == 1 ? "" : "s");
printf("%d second%s", (int)c, c == 1 ? "" : "s");
printf("\n");
printf("system: %s/%s version %s\n", un.sysname, un.machine,
un.release);
Expand Down
4 changes: 2 additions & 2 deletions who.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ output(struct utmp *up)
(void)printf("00:00 ");
else if (idle < (24 * 60 * 60))
(void)printf("%02d:%02d ",
(idle / (60 * 60)),
(idle % (60 * 60)) / 60);
((int)idle / (60 * 60)),
((int)idle % (60 * 60)) / 60);
else
(void)printf(" old ");

Expand Down

0 comments on commit 38968ac

Please sign in to comment.