mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 18:08:54 +02:00
girepository: Fix -Wsign-conversion warnings in macOS library code
The members of `struct segment_command` appear to have type `uint32_t`, so definitely need casting to the machine’s integer pointer type before doing pointer arithmetic on them. See https://developer.apple.com/documentation/kernel/segment_command Tested only on macOS CI as I don’t have access to a macOS machine. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
@@ -198,13 +198,13 @@ gi_repository_get_library_path_macos (void)
|
||||
if (cmd->cmd == LC_SEGMENT)
|
||||
{
|
||||
struct segment_command *seg = (struct segment_command *) cmd;
|
||||
if (((intptr_t) ptr >= (seg->vmaddr + offset)) && ((intptr_t) ptr < (seg->vmaddr + offset + seg->vmsize)))
|
||||
if (((intptr_t) ptr >= ((intptr_t) seg->vmaddr + offset)) && ((intptr_t) ptr < ((intptr_t) seg->vmaddr + offset + (intptr_t) seg->vmsize)))
|
||||
return _dyld_get_image_name (i);
|
||||
}
|
||||
if (cmd->cmd == LC_SEGMENT_64)
|
||||
{
|
||||
struct segment_command_64 *seg = (struct segment_command_64 *) cmd;
|
||||
if (((uintptr_t ) ptr >= (seg->vmaddr + offset)) && ((uintptr_t ) ptr < (seg->vmaddr + offset + seg->vmsize)))
|
||||
if (((intptr_t) ptr >= ((intptr_t) seg->vmaddr + offset)) && ((intptr_t) ptr < ((intptr_t) seg->vmaddr + offset + (intptr_t) seg->vmsize)))
|
||||
return _dyld_get_image_name (i);
|
||||
}
|
||||
/* Jump to the next command */
|
||||
|
Reference in New Issue
Block a user