diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-12-16 12:46:50 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-12-16 12:46:50 -0800 |
commit | 64e773800f70a4e9ebc0e606150beaff9b839fd9 (patch) | |
tree | c56feac0ddb745ba8a8e9ab8b65a87937937c9e0 | |
parent | 88bf1500095d7aaea9689a6d0367d6ff5c868292 (diff) |
Fix some clang warnings about implicit conversions
sessreg.c:360:43: warning: implicit conversion changes signedness:
'unsigned long' to 'off_t' (aka 'long') [-Wsign-conversion]
sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0)
~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
sessreg.c:360:25: warning: implicit conversion changes signedness: 'long' to
'unsigned long' [-Wsign-conversion]
sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0)
^~~~~~~~~~~~~~~~~~~
sessreg.c:405:7: warning: implicit conversion loses integer precision: 'size_t'
(aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
i = strlen (line);
~ ^~~~~~~~~~~~~
sessreg.c:406:9: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
if (i >= sizeof (u->ut_id))
~ ^ ~~~~~~~~~~~~~~~~~
sessreg.c:494:7: warning: implicit conversion loses integer precision: 'size_t'
(aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
i = strlen (line);
~ ^~~~~~~~~~~~~
sessreg.c:495:9: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
if (i >= sizeof (u->ut_id))
~ ^ ~~~~~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | sessreg.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -357,7 +357,7 @@ main (int argc, char **argv) if (llog != -1) { struct lastlog ll; - sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0) + sysnerr (lseek(llog, (long) (pwd->pw_uid*sizeof(ll)), 0) != -1, "seeking lastlog entry"); memset(&ll, 0, sizeof(ll)); ll.ll_time = current_time; @@ -394,7 +394,7 @@ set_utmp (struct utmp *u, char *line, char *user, char *host, time_t date, int a memset (u->ut_name, 0, sizeof (u->ut_name)); #ifdef HAVE_STRUCT_UTMP_UT_ID if (line) { - int i; + size_t i; /* * this is a bit crufty, but * follows the apparent conventions in @@ -483,7 +483,7 @@ set_utmpx (struct utmpx *u, const char *line, const char *user, memset (u->ut_user, 0, sizeof (u->ut_user)); if (line) { - int i; + size_t i; /* * this is a bit crufty, but * follows the apparent conventions in |