about summary refs log tree commit diff stats
path: root/src/wrapped
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapped')
-rw-r--r--src/wrapped/wrappedlibc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 9dbd6e04..3f54350c 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2645,9 +2645,9 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot
     #endif
     if(ret!=MAP_FAILED) {
         if(emu)
-            setProtection_mmap((uintptr_t)ret, length, prot);
+            setProtection_mmap((uintptr_t)ret, length, (uint8_t)prot);
         else
-            setProtection((uintptr_t)ret, length, prot);
+            setProtection((uintptr_t)ret, length, (uint8_t)prot);
     }
     return ret;
 }
@@ -2660,7 +2660,7 @@ EXPORT void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t ne
     void* ret = mremap(old_addr, old_size, new_size, flags, new_addr);
     if(emu && (box64_log>=LOG_DEBUG || box64_dynarec_log>=LOG_DEBUG)) {printf_log(LOG_NONE, "%p\n", ret);}
     if(ret!=(void*)-1) {
-        uint32_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM;
+        uint8_t prot = getProtection((uintptr_t)old_addr)&~PROT_CUSTOM;
         if(ret==old_addr) {
             if(old_size && old_size<new_size) {
                 setProtection_mmap((uintptr_t)ret+old_size, new_size-old_size, prot);
@@ -2736,11 +2736,11 @@ EXPORT int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot)
     #endif
     if(!ret && len) {
         if(prot)
-            updateProtection((uintptr_t)addr, len, prot);
+            updateProtection((uintptr_t)addr, len, (uint8_t)prot);
         else {
             // avoid allocating detailled protection for a no prot 0
             freeProtection((uintptr_t)addr, len);
-            setProtection_mmap((uintptr_t)addr, len, prot);
+            setProtection_mmap((uintptr_t)addr, len, (uint8_t)prot);
         }
     }
     return ret;