mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 07:05:30 +00:00
Fixed some GHC warnings
This commit is contained in:
parent
47f9a0cdac
commit
431035b335
|
@ -44,7 +44,6 @@ import Foreign
|
||||||
|
|
||||||
import Unicorn.Internal.Core
|
import Unicorn.Internal.Core
|
||||||
import Unicorn.Internal.Hook
|
import Unicorn.Internal.Hook
|
||||||
import Unicorn.Internal.Util
|
|
||||||
import qualified Unicorn.CPU.X86 as X86
|
import qualified Unicorn.CPU.X86 as X86
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,9 +78,9 @@ import Unicorn.Internal.Util
|
||||||
-- | Memory region mapped by 'memMap'. Retrieve the list of memory regions with
|
-- | Memory region mapped by 'memMap'. Retrieve the list of memory regions with
|
||||||
-- 'memRegions'.
|
-- 'memRegions'.
|
||||||
data MemoryRegion = MemoryRegion {
|
data MemoryRegion = MemoryRegion {
|
||||||
begin :: Word64, -- ^ Begin address of the region (inclusive)
|
mrBegin :: Word64, -- ^ Begin address of the region (inclusive)
|
||||||
end :: Word64, -- ^ End address of the region (inclusive)
|
mrEnd :: Word64, -- ^ End address of the region (inclusive)
|
||||||
perms :: [MemoryPermission] -- ^ Memory permissions of the region
|
mrPerms :: [MemoryPermission] -- ^ Memory permissions of the region
|
||||||
}
|
}
|
||||||
|
|
||||||
instance Storable MemoryRegion where
|
instance Storable MemoryRegion where
|
||||||
|
@ -91,9 +91,9 @@ instance Storable MemoryRegion where
|
||||||
<*> liftA fromIntegral ({# get uc_mem_region->end #} p)
|
<*> liftA fromIntegral ({# get uc_mem_region->end #} p)
|
||||||
<*> liftA expandMemPerms ({# get uc_mem_region->perms #} p)
|
<*> liftA expandMemPerms ({# get uc_mem_region->perms #} p)
|
||||||
poke p mr = do
|
poke p mr = do
|
||||||
{# set uc_mem_region.begin #} p (fromIntegral $ begin mr)
|
{# set uc_mem_region.begin #} p (fromIntegral $ mrBegin mr)
|
||||||
{# set uc_mem_region.end #} p (fromIntegral $ end mr)
|
{# set uc_mem_region.end #} p (fromIntegral $ mrEnd mr)
|
||||||
{# set uc_mem_region.perms #} p (combineEnums $ perms mr)
|
{# set uc_mem_region.perms #} p (combineEnums $ mrPerms mr)
|
||||||
|
|
||||||
-- | A pointer to a memory region.
|
-- | A pointer to a memory region.
|
||||||
{# pointer *uc_mem_region as MemoryRegionPtr -> MemoryRegion #}
|
{# pointer *uc_mem_region as MemoryRegionPtr -> MemoryRegion #}
|
||||||
|
@ -225,11 +225,11 @@ expandMemPerms perms =
|
||||||
else
|
else
|
||||||
checkRWE maskedPerms [ProtRead, ProtWrite, ProtExec]
|
checkRWE maskedPerms [ProtRead, ProtWrite, ProtExec]
|
||||||
where
|
where
|
||||||
checkRWE perms (prot:prots) =
|
checkRWE p (x:xs) =
|
||||||
if perms .&. (fromEnum prot) /= 0 then
|
if p .&. (fromEnum x) /= 0 then
|
||||||
prot : checkRWE perms prots
|
x : checkRWE p xs
|
||||||
else
|
else
|
||||||
checkRWE perms prots
|
checkRWE p xs
|
||||||
checkRWE _ [] =
|
checkRWE _ [] =
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue