mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-28 15:53:06 +08:00
cpukit/dev: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one. This addresses warnings that only occurred on 64-bit targets. For the ones which only appeared on 64-bit targets, the cause was frequently a mismatch when comparing a combination off_t, ssize_t, and int.
This commit is contained in:
@@ -328,7 +328,7 @@ static int rtems_flashdev_check_offset_region(
|
||||
)
|
||||
{
|
||||
if ( ( rtems_flashdev_is_region_defined( iop ) ) &&
|
||||
( offset > rtems_flashdev_get_region_size( flash, iop ) ) ) {
|
||||
( offset > (int64_t) rtems_flashdev_get_region_size( flash, iop ) ) ) {
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
}
|
||||
return 0;
|
||||
@@ -506,7 +506,7 @@ static off_t rtems_flashdev_lseek(
|
||||
}
|
||||
|
||||
if ( ( rtems_flashdev_is_region_defined(iop) ) &&
|
||||
( tmp_offset > rtems_flashdev_get_region_size( flash, iop ) ) ) {
|
||||
( tmp_offset > (int64_t) rtems_flashdev_get_region_size( flash, iop ) ) ) {
|
||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user