mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-02-04 12:41:34 +00:00
fstests: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one. This is frequently an int or ssize_t variable compared to a uint32_t or size_t. Sometimes the size_t is from a sizeof() use.
This commit is contained in:
committed by
Gedare Bloom
parent
dd4670e83d
commit
55d18c302e
@@ -107,7 +107,7 @@ static void write_to_file( const char *file, bool sync )
|
||||
rtems_test_assert( n == (ssize_t) sizeof( buf ) );
|
||||
|
||||
pos_after = lseek( fd, 0, SEEK_END );
|
||||
rtems_test_assert( pos_after == pos_before + sizeof( buf ) );
|
||||
rtems_test_assert( pos_after == pos_before + (ssize_t) sizeof( buf ) );
|
||||
|
||||
if ( sync ) {
|
||||
rv = fsync( fd );
|
||||
|
||||
@@ -612,7 +612,7 @@ block_rw_lseek (int fd, size_t pos)
|
||||
off_t actual;
|
||||
|
||||
actual = lseek (fd, pos, SEEK_SET);
|
||||
rtems_test_assert (actual == pos);
|
||||
rtems_test_assert (actual == (off_t) pos);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -648,7 +648,7 @@ block_rw_check (int fd, const char *out, char *in, size_t size)
|
||||
off_t file_size;
|
||||
|
||||
file_size = lseek (fd, 0, SEEK_END);
|
||||
rtems_test_assert (file_size == size);
|
||||
rtems_test_assert (file_size == (off_t) size);
|
||||
|
||||
block_rw_lseek (fd, 0);
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ static void symlink_test01(void )
|
||||
status=lstat(symlink_file01,&statbuf);
|
||||
rtems_test_assert(status==0);
|
||||
rtems_test_assert(S_ISLNK(statbuf.st_mode));
|
||||
rtems_test_assert(len==statbuf.st_size);
|
||||
rtems_test_assert((off_t)len==statbuf.st_size);
|
||||
|
||||
|
||||
puts("call readlink ");
|
||||
@@ -99,7 +99,7 @@ static void symlink_test01(void )
|
||||
status=lstat(symlink_file01,&statbuf);
|
||||
rtems_test_assert(status==0);
|
||||
rtems_test_assert(S_ISLNK(statbuf.st_mode));
|
||||
rtems_test_assert(len==statbuf.st_size);
|
||||
rtems_test_assert((off_t)len==statbuf.st_size);
|
||||
|
||||
puts("call readlink ");
|
||||
name_len=readlink(symlink_file01,name,sizeof(name)-1);
|
||||
@@ -119,7 +119,7 @@ static void symlink_test01(void )
|
||||
status=lstat(symlink_file01,&statbuf);
|
||||
rtems_test_assert(status==0);
|
||||
rtems_test_assert(S_ISLNK(statbuf.st_mode));
|
||||
rtems_test_assert(len==statbuf.st_size);
|
||||
rtems_test_assert((off_t)len==statbuf.st_size);
|
||||
|
||||
|
||||
puts("call readlink ");
|
||||
|
||||
Reference in New Issue
Block a user