Fix two WARNS=6 warnings in opendir.c and telldir.c

This is in preparation for compiling these files as part of rtld (which is
built with WARNS=6). See https://reviews.freebsd.org/D20663 for more details.
This commit is contained in:
Alex Richardson 2019-06-23 10:47:07 +00:00
parent dfdc07bc43
commit 0cab2a4a53
2 changed files with 4 additions and 4 deletions

View File

@ -99,8 +99,8 @@ static int
opendir_compar(const void *p1, const void *p2)
{
return (strcmp((*(const struct dirent **)p1)->d_name,
(*(const struct dirent **)p2)->d_name));
return (strcmp((*(const struct dirent * const *)p1)->d_name,
(*(const struct dirent * const *)p2)->d_name));
}
/*

View File

@ -63,8 +63,8 @@ telldir(DIR *dirp)
* 2) Otherwise, see if it's already been recorded in the linked list
* 3) Otherwise, malloc a new one
*/
if (dirp->dd_seek < (1ul << DD_SEEK_BITS) &&
dirp->dd_loc < (1ul << DD_LOC_BITS)) {
if (dirp->dd_seek < (off_t)(1l << DD_SEEK_BITS) &&
dirp->dd_loc < (1l << DD_LOC_BITS)) {
ddloc.s.is_packed = 1;
ddloc.s.loc = dirp->dd_loc;
ddloc.s.seek = dirp->dd_seek;