bindings-dsl icon indicating copy to clipboard operation
bindings-dsl copied to clipboard

Literal 32756049119281160 is out of the Int range -2147483648..2147483647

Open picca opened this issue 9 years ago • 0 comments

Hello, I try to build the othr bindings-hdf5 code and I get this error

Literal 32756049119281160 is out of the Int range -2147483648..2147483647

the cod ein the .hsc file is

-- |Information about an object
#starttype H5G_stat_t

-- |file number
#array_field fileno,    CULong

-- |object number
#array_field objno,     CULong

-- |number of hard links to object
#field nlink,           CUInt

-- |basic object type
#field type,            <H5G_obj_t>

-- |modification time
#field mtime,           <time_t>

-- |symbolic link value length
#field linklen,         <size_t>

-- |Object header information
#field ohdr,            <H5O_stat_t>
#stoptype

which produce this code in the hsc

data H5G_stat_t = H5G_stat_t{
  h5g_stat_t'fileno :: [CULong],
  h5g_stat_t'objno :: [CULong],
  h5g_stat_t'nlink :: CUInt,
  h5g_stat_t'type :: H5G_obj_t,
  h5g_stat_t'mtime :: CTime,
  h5g_stat_t'linklen :: CSize,
  h5g_stat_t'ohdr :: H5O_stat_t
} deriving (Eq,Show)
p'H5G_stat_t'fileno p = plusPtr p 0
p'H5G_stat_t'fileno :: Ptr (H5G_stat_t) -> Ptr (CULong)
p'H5G_stat_t'objno p = plusPtr p 8
p'H5G_stat_t'objno :: Ptr (H5G_stat_t) -> Ptr (CULong)
p'H5G_stat_t'nlink p = plusPtr p 16
p'H5G_stat_t'nlink :: Ptr (H5G_stat_t) -> Ptr (CUInt)
p'H5G_stat_t'type p = plusPtr p 20
p'H5G_stat_t'type :: Ptr (H5G_stat_t) -> Ptr (H5G_obj_t)
p'H5G_stat_t'mtime p = plusPtr p 24
p'H5G_stat_t'mtime :: Ptr (H5G_stat_t) -> Ptr (CTime)
p'H5G_stat_t'linklen p = plusPtr p 28
p'H5G_stat_t'linklen :: Ptr (H5G_stat_t) -> Ptr (CSize)
p'H5G_stat_t'ohdr p = plusPtr p 32
p'H5G_stat_t'ohdr :: Ptr (H5G_stat_t) -> Ptr (H5O_stat_t)
instance Storable H5G_stat_t where
  sizeOf _ = 56
  alignment _ = 4
  peek p = do
    v0 <- let s = div 32756049119281160 $ sizeOf $ (undefined :: CULong) in peekArray s (plusPtr p 0)
    v1 <- let s = div 8 $ sizeOf $ (undefined :: CULong) in peekArray s (plusPtr p 8)
    v2 <- peekByteOff p 16
    v3 <- peekByteOff p 20
    v4 <- peekByteOff p 24
    v5 <- peekByteOff p 28
    v6 <- peekByteOff p 32
    return $ H5G_stat_t v0 v1 v2 v3 v4 v5 v6
  poke p (H5G_stat_t v0 v1 v2 v3 v4 v5 v6) = do
    let s = div 8 $ sizeOf $ (undefined :: CULong)
    pokeArray (plusPtr p 0) (take s v0)
    let s = div 8 $ sizeOf $ (undefined :: CULong)
    pokeArray (plusPtr p 8) (take s v1)
    pokeByteOff p 16 v2
    pokeByteOff p 20 v3
    pokeByteOff p 24 v4
    pokeByteOff p 28 v5
    pokeByteOff p 32 v6
    return ()

My computer is a i386 arch and not an amd64

picca avatar Apr 02 '16 17:04 picca