You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i made my PR to change things from String to Text, i made an effort not to remove or add any functions, so as to minimise the chance of introducing a bug. however i noticed you had two variants of this peek function in use, but they both have the same type and implementation. One should be removed - i would prefer to remove 'peekCAText' and keep 'peekCText'.
The text was updated successfully, but these errors were encountered:
oh, i'm at least wrong about their implementations being the same: peekCAString and peekCString differ in the following way:
--| Marshal a NUL terminated C string into a Haskell string.--peekCAString::CString->IOString
peekCAString cp =do
l <- lengthArray0 nUL cp
if l <=0thenreturn""else loop "" (l-1)
where
loop s i =do
xval <- peekElemOff cp i
let val = castCCharToChar xval
val `seq`if i <=0thenreturn (val:s) else loop (val:s) (i-1)
--| Marshal a NUL terminated C string into a Haskell string.--peekCString::CString->IOString
peekCString s = getForeignEncoding >>=flipGHC.peekCString s
when i made my PR to change things from String to Text, i made an effort not to remove or add any functions, so as to minimise the chance of introducing a bug. however i noticed you had two variants of this peek function in use, but they both have the same type and implementation. One should be removed - i would prefer to remove 'peekCAText' and keep 'peekCText'.
The text was updated successfully, but these errors were encountered: