Skip to content

Commit b91c5f1

Browse files
committed
Fix slide type cast warnings
1 parent 963048a commit b91c5f1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/os/mac/Process.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace hat::process {
3636
return header && (header->magic == mh_magic || header->magic == mh_cigam);
3737
}
3838

39-
static void for_each_segment_impl(const uintptr_t address, std::predicate<intptr_t, const segment_command_t*> auto&& callback) {
39+
static void for_each_segment_impl(const uintptr_t address, std::predicate<uintptr_t, const segment_command_t*> auto&& callback) {
4040
const uint32_t imageCount = _dyld_image_count();
4141
for (uint32_t i = 0; i < imageCount; i++) {
4242
const auto* header = reinterpret_cast<const mach_header_t*>(_dyld_get_image_header(i));
@@ -84,7 +84,7 @@ namespace hat::process {
8484

8585
std::span<std::byte> module::get_section_data(std::string_view name) const {
8686
std::span<std::byte> data{};
87-
for_each_segment_impl(this->address(), [&](intptr_t slide, const segment_command_t* seg) {
87+
for_each_segment_impl(this->address(), [&](uintptr_t slide, const segment_command_t* seg) {
8888
hat::protection prot{};
8989
if (seg->initprot & VM_PROT_READ) prot |= hat::protection::Read;
9090
if (seg->initprot & VM_PROT_WRITE) prot |= hat::protection::Write;
@@ -119,7 +119,7 @@ namespace hat::process {
119119
}
120120

121121
void module::for_each_section(const std::function<bool(std::string_view, std::span<std::byte>, hat::protection)>& callback) const {
122-
for_each_segment_impl(this->address(), [&](intptr_t slide, const segment_command_t* seg) {
122+
for_each_segment_impl(this->address(), [&](uintptr_t slide, const segment_command_t* seg) {
123123
hat::protection prot{};
124124
if (seg->initprot & VM_PROT_READ) prot |= hat::protection::Read;
125125
if (seg->initprot & VM_PROT_WRITE) prot |= hat::protection::Write;
@@ -152,7 +152,7 @@ namespace hat::process {
152152
}
153153

154154
void module::for_each_segment(const std::function<bool(std::span<std::byte>, hat::protection)>& callback) const {
155-
for_each_segment_impl(this->address(), [](intptr_t slide, const segment_command_t* seg) {
155+
for_each_segment_impl(this->address(), [](uintptr_t slide, const segment_command_t* seg) {
156156
const std::span data{
157157
reinterpret_cast<std::byte*>(seg->vmaddr + slide),
158158
seg->vmsize

0 commit comments

Comments
 (0)