fix the missmatch between Int and CInt in the Haskell binding to the word alignment API. This was causing problems on 64-bit machines

This commit is contained in:
krasimir
2015-02-18 17:05:35 +00:00
parent f3f47c7761
commit 4ff6728993

View File

@@ -1,4 +1,4 @@
{-# LANGUAGE ExistentialQuantification, DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification, DeriveDataTypeable, ScopedTypeVariables #-}
------------------------------------------------- -------------------------------------------------
-- | -- |
-- Maintainer : Krasimir Angelov -- Maintainer : Krasimir Angelov
@@ -459,8 +459,8 @@ alignWords lang e = unsafePerformIO $
c_phrase <- (#peek PgfAlignmentPhrase, phrase) ptr c_phrase <- (#peek PgfAlignmentPhrase, phrase) ptr
phrase <- peekCString c_phrase phrase <- peekCString c_phrase
n_fids <- (#peek PgfAlignmentPhrase, n_fids) ptr n_fids <- (#peek PgfAlignmentPhrase, n_fids) ptr
fids <- peekArray (fromIntegral (n_fids :: CInt)) (ptr `plusPtr` (#offset PgfAlignmentPhrase, fids)) (fids :: [CInt]) <- peekArray (fromIntegral (n_fids :: CInt)) (ptr `plusPtr` (#offset PgfAlignmentPhrase, fids))
return (phrase, fids) return (phrase, map fromIntegral fids)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Helper functions -- Helper functions