New submission from Manuel M T Chakravarty <[EMAIL PROTECTED]>:
There seems to be an issue with `darcs apply' when the long comment of a
`darcs send'^H^Ht' patch contains special characters.
I am using
JustTesting chak 17 (.../src/c2hs): darcs --version
1.0.4 (unknown)
When attempting to apply the attached patch, I get the appended error
message. The patch itself must be ok, as `darcs pull'ing the same patch
works without problems.
Manuel
PS: I had a quick look at the bug tracker, but didn't see anything
similar yet.
-=- error message follows -=-
darcs: Error parsing patchinfo:
""
""
"[Only match in `checkForOneCUName' if there are no indirections"
"Jelmer Vernooij <[EMAIL PROTECTED]>**20051205172623"
""
" Without this patch, the following code:"
""
" #c"
" struct foostruct { char x; };"
" void bar2(struct foostruct **a);"
" #endc"
""
" {#pointer *foostruct as Foo newtype#}"
" test2 = {#call bar2#}"
""
" would give"
""
" foreign import ccall safe \"test-pp.h bar2\""
" bar2 :: ((Foo) -> (IO ()))"
""
" with this patch, it generates:"
""
" foreign import ccall safe \"test-pp.h bar2\""
" bar2 :: ((Pt"
----------
files: unnamed
messages: 176
nosy: chak, droundy, jelmer, tommy
status: unread
title: darcs patch: Support mapping struct and union names t... (and 2 more)]
____________________________________
Darcs issue tracker <[EMAIL PROTECTED]>
<http://bugs.darcs.net/issue46>
____________________________________--- Begin Message ---
Mon Dec 5 14:19:50 CET 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
* Support mapping struct and union names to haskell types
Mon Dec 5 18:25:12 CET 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
* Add missing ChangeLog entry
Mon Dec 5 18:26:23 CET 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
* Only match in `checkForOneCUName' if there are no indirections
Without this patch, the following code:
#c
struct foostruct { char x; };
void bar2(struct foostruct **a);
#endc
{#pointer *foostruct as Foo newtype#}
test2 = {#call bar2#}
would give
foreign import ccall safe "test-pp.h bar2"
bar2 :: ((Foo) -> (IO ()))
with this patch, it generates:
foreign import ccall safe "test-pp.h bar2"
bar2 :: ((Ptr (Foo)) -> (IO ()))
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
New patches:
[Support mapping struct and union names to haskell types
Jelmer Vernooij <[EMAIL PROTECTED]>**20051205131950] {
hunk ./c2hs/c/CTrav.hs 78
- - chaseDecl, findAndChaseDecl, checkForAlias,
+ chaseDecl, findAndChaseDecl, checkForAlias, checkForOneCUName,
hunk ./c2hs/c/CTrav.hs 690
+-- given a declaration, find the name of the struct/union type
+checkForOneCUName :: CDecl -> Maybe Ident
+checkForOneCUName decl@(CDecl specs _ _) =
+ case [ts | CTypeSpec ts <- specs] of
+ [CSUType (CStruct _ n _ _) _] -> n
+ _ -> Nothing
hunk ./c2hs/gen/GenBind.hs 137
- - checkForAlias, checkForOneAliasName, lookupEnum,
- - lookupStructUnion, lookupDeclOrTag, isPtrDeclr,
+ checkForAlias, checkForOneAliasName, checkForOneCUName,
+ lookupEnum, lookupStructUnion, lookupDeclOrTag, isPtrDeclr,
hunk ./c2hs/gen/GenBind.hs 1310
- --- * struct/union types are mapped to `()'
+-- * unknown struct/union types are mapped to `()'
hunk ./c2hs/gen/GenBind.hs 1361
- - oHsRepr <- case oalias of
+ osu = checkForOneCUName cdecl'
+ oname = if oalias == Nothing then osu else oalias
+ oHsRepr <- case oname of
}
[Add missing ChangeLog entry
Jelmer Vernooij <[EMAIL PROTECTED]>**20051205172512] {
hunk ./ChangeLog 1
+2005-12-05 Jelmer Vernooij <[EMAIL PROTECTED]>
+
+ * c2hs/gen/GenBind.hs: support mapping struct and union names to haskell
+ types
+
+ * c2hs/c/CTrav.hs: added `checkForOneCUName'
+
}
[Only match in `checkForOneCUName' if there are no indirections
Jelmer Vernooij <[EMAIL PROTECTED]>**20051205172623
Without this patch, the following code:
#c
struct foostruct { char x; };
void bar2(struct foostruct **a);
#endc
{#pointer *foostruct as Foo newtype#}
test2 = {#call bar2#}
would give
foreign import ccall safe "test-pp.h bar2"
bar2 :: ((Foo) -> (IO ()))
with this patch, it generates:
foreign import ccall safe "test-pp.h bar2"
bar2 :: ((Ptr (Foo)) -> (IO ()))
] {
hunk ./ChangeLog 2
+
+ * c2hs/c/CTrav.hs: only match in `checkForOneCUName' if there are
+ no indirections
+
+2005-12-05 Jelmer Vernooij <[EMAIL PROTECTED]>
hunk ./c2hs/c/CTrav.hs 694
- - [CSUType (CStruct _ n _ _) _] -> n
+ [CSUType (CStruct _ n _ _) _] ->
+ case declaredDeclr decl of
+ Nothing -> n
+ Just (CVarDeclr _ _ ) -> n
+ Just (CPtrDeclr [_] (CVarDeclr _ _) _) -> Nothing
}
Context:
[Log entry for Jelmer's first patch
Manuel M T Chakravarty <[EMAIL PROTECTED]>**20051205122940]
[add prettify functions for structs, enums and unions
Jelmer Vernooij <[EMAIL PROTECTED]>**20051124235456]
[Build-Depends fix
Manuel M T Chakravarty <[EMAIL PROTECTED]>**20050815014719]
[version 0.14.4
Manuel M T Chakravarty <[EMAIL PROTECTED]>**20050815014649]
[TAG version 0.14.3
Manuel M T Chakravarty <[EMAIL PROTECTED]>**20050810020052]
Patch bundle hash:
b7b0009d455ed616ffb68397f0218311a4741840
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDlHjjPa9Uoh7vUnYRAqWcAJ4yRohtKKIIS1hAK1iXyyjz6rIpcgCeNCmM
YL6J8iHouVKhdhcjgGhfFb0=
=rHPj
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel