cpukit/libdl: 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:
Joel Sherrill
2026-01-30 09:18:58 -06:00
parent 7499713116
commit 80365c94a7
2 changed files with 3 additions and 3 deletions

View File

@@ -1134,7 +1134,7 @@ rtems_rtl_obj_archive_find_obj (int fd,
*osize = 0;
}
while (*ooffset < fsize)
while (*ooffset < (int64_t)fsize)
{
/*
* Clean up any existing data.

View File

@@ -115,7 +115,7 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache,
if (cache->fd == fd)
{
if (offset >= cache->file_size)
if (offset >= (int64_t)cache->file_size)
{
rtems_rtl_set_error (EINVAL, "offset past end of file: offset=%i size=%i",
(int) offset, (int) cache->file_size);
@@ -154,7 +154,7 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache,
* Is any part of the data in the cache ?
*/
if ((offset >= cache->offset) &&
(offset < (cache->offset + cache->level)))
(offset < (int64_t)(cache->offset + cache->level)))
{
size_t size;