Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _cmptest/testdata/libxml2/2.13.6/libxml2/debugXML.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type X_xmlShellCtxt struct {
Pctxt XPathContextPtr
Loaded c.Int
Output *c.FILE
Input c.Pointer
Input ShellReadlineFunc
}
type ShellCtxt X_xmlShellCtxt
type ShellCtxtPtr *ShellCtxt
Expand Down
4 changes: 2 additions & 2 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type CharEncodingOutputFunc func(*c.Char, *c.Int, *c.Char, *c.Int) c.Int

type X_xmlCharEncodingHandler struct {
Name *c.Char
Input c.Pointer
Output c.Pointer
Input CharEncodingInputFunc
Output CharEncodingOutputFunc
}
type CharEncodingHandler X_xmlCharEncodingHandler
type CharEncodingHandlerPtr *CharEncodingHandler
Expand Down
54 changes: 27 additions & 27 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,33 +172,33 @@ type StartElementNsSAX2Func func(c.Pointer, *Char, *Char, *Char, c.Int, **Char,
type EndElementNsSAX2Func func(c.Pointer, *Char, *Char, *Char)

type X_xmlSAXHandlerV1 struct {
InternalSubset c.Pointer
IsStandalone c.Pointer
HasInternalSubset c.Pointer
HasExternalSubset c.Pointer
ResolveEntity c.Pointer
GetEntity c.Pointer
EntityDecl c.Pointer
NotationDecl c.Pointer
AttributeDecl c.Pointer
ElementDecl c.Pointer
UnparsedEntityDecl c.Pointer
SetDocumentLocator c.Pointer
StartDocument c.Pointer
EndDocument c.Pointer
StartElement c.Pointer
EndElement c.Pointer
Reference c.Pointer
Characters c.Pointer
IgnorableWhitespace c.Pointer
ProcessingInstruction c.Pointer
Comment c.Pointer
Warning c.Pointer
Error c.Pointer
FatalError c.Pointer
GetParameterEntity c.Pointer
CdataBlock c.Pointer
ExternalSubset c.Pointer
InternalSubset InternalSubsetSAXFunc
IsStandalone IsStandaloneSAXFunc
HasInternalSubset HasInternalSubsetSAXFunc
HasExternalSubset HasExternalSubsetSAXFunc
ResolveEntity ResolveEntitySAXFunc
GetEntity GetEntitySAXFunc
EntityDecl EntityDeclSAXFunc
NotationDecl NotationDeclSAXFunc
AttributeDecl AttributeDeclSAXFunc
ElementDecl ElementDeclSAXFunc
UnparsedEntityDecl UnparsedEntityDeclSAXFunc
SetDocumentLocator SetDocumentLocatorSAXFunc
StartDocument StartDocumentSAXFunc
EndDocument EndDocumentSAXFunc
StartElement StartElementSAXFunc
EndElement EndElementSAXFunc
Reference ReferenceSAXFunc
Characters CharactersSAXFunc
IgnorableWhitespace IgnorableWhitespaceSAXFunc
ProcessingInstruction ProcessingInstructionSAXFunc
Comment CommentSAXFunc
Warning WarningSAXFunc
Error ErrorSAXFunc
FatalError FatalErrorSAXFunc
GetParameterEntity GetParameterEntitySAXFunc
CdataBlock CdataBlockSAXFunc
ExternalSubset ExternalSubsetSAXFunc
Initialized c.Uint
}
type SAXHandlerV1 X_xmlSAXHandlerV1
Expand Down
74 changes: 37 additions & 37 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const DOCB_DOCUMENT_NODE = 21

type X_xmlParserInputBuffer struct {
Context c.Pointer
Readcallback c.Pointer
Closecallback c.Pointer
Readcallback InputReadCallback
Closecallback InputCloseCallback
Encoder CharEncodingHandlerPtr
Buffer BufPtr
Raw BufPtr
Expand All @@ -24,8 +24,8 @@ type ParserInputBufferPtr *ParserInputBuffer

type X_xmlOutputBuffer struct {
Context c.Pointer
Writecallback c.Pointer
Closecallback c.Pointer
Writecallback OutputWriteCallback
Closecallback OutputCloseCallback
Encoder CharEncodingHandlerPtr
Buffer BufPtr
Conv BufPtr
Expand All @@ -46,7 +46,7 @@ type X_xmlParserInput struct {
Line c.Int
Col c.Int
Consumed c.Ulong
Free c.Pointer
Free ParserInputDeallocate
Encoding *Char
Version *Char
Flags c.Int
Expand Down Expand Up @@ -154,7 +154,7 @@ type X_xmlParserCtxt struct {
Nsdb *ParserNsData
AttrHashMax c.Uint
AttrHash *AttrHashBucket
ErrorHandler c.Pointer
ErrorHandler StructuredErrorFunc
ErrorCtxt c.Pointer
}
type ParserCtxt X_xmlParserCtxt
Expand All @@ -170,38 +170,38 @@ type SAXLocator X_xmlSAXLocator
type SAXLocatorPtr *SAXLocator

type X_xmlSAXHandler struct {
InternalSubset c.Pointer
IsStandalone c.Pointer
HasInternalSubset c.Pointer
HasExternalSubset c.Pointer
ResolveEntity c.Pointer
GetEntity c.Pointer
EntityDecl c.Pointer
NotationDecl c.Pointer
AttributeDecl c.Pointer
ElementDecl c.Pointer
UnparsedEntityDecl c.Pointer
SetDocumentLocator c.Pointer
StartDocument c.Pointer
EndDocument c.Pointer
StartElement c.Pointer
EndElement c.Pointer
Reference c.Pointer
Characters c.Pointer
IgnorableWhitespace c.Pointer
ProcessingInstruction c.Pointer
Comment c.Pointer
Warning c.Pointer
Error c.Pointer
FatalError c.Pointer
GetParameterEntity c.Pointer
CdataBlock c.Pointer
ExternalSubset c.Pointer
InternalSubset InternalSubsetSAXFunc
IsStandalone IsStandaloneSAXFunc
HasInternalSubset HasInternalSubsetSAXFunc
HasExternalSubset HasExternalSubsetSAXFunc
ResolveEntity ResolveEntitySAXFunc
GetEntity GetEntitySAXFunc
EntityDecl EntityDeclSAXFunc
NotationDecl NotationDeclSAXFunc
AttributeDecl AttributeDeclSAXFunc
ElementDecl ElementDeclSAXFunc
UnparsedEntityDecl UnparsedEntityDeclSAXFunc
SetDocumentLocator SetDocumentLocatorSAXFunc
StartDocument StartDocumentSAXFunc
EndDocument EndDocumentSAXFunc
StartElement StartElementSAXFunc
EndElement EndElementSAXFunc
Reference ReferenceSAXFunc
Characters CharactersSAXFunc
IgnorableWhitespace IgnorableWhitespaceSAXFunc
ProcessingInstruction ProcessingInstructionSAXFunc
Comment CommentSAXFunc
Warning WarningSAXFunc
Error ErrorSAXFunc
FatalError FatalErrorSAXFunc
GetParameterEntity GetParameterEntitySAXFunc
CdataBlock CdataBlockSAXFunc
ExternalSubset ExternalSubsetSAXFunc
Initialized c.Uint
X_private c.Pointer
StartElementNs c.Pointer
EndElementNs c.Pointer
Serror c.Pointer
StartElementNs StartElementNsSAX2Func
EndElementNs EndElementNsSAX2Func
Serror StructuredErrorFunc
}
type SAXHandler X_xmlSAXHandler
type SAXHandlerPtr *SAXHandler
Expand Down Expand Up @@ -559,7 +559,7 @@ type X_xmlDOMWrapCtxt struct {
X_private c.Pointer
Type c.Int
NamespaceMap c.Pointer
GetNsForNodeFunc c.Pointer
GetNsForNodeFunc DOMWrapAcquireNsFunction
}
type DOMWrapCtxt X_xmlDOMWrapCtxt
type DOMWrapCtxtPtr *DOMWrapCtxt
Expand Down
4 changes: 2 additions & 2 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/valid.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type ValidityWarningFunc func(__llgo_arg_0 c.Pointer, __llgo_arg_1 *c.Char, __ll

type X_xmlValidCtxt struct {
UserData c.Pointer
Error c.Pointer
Warning c.Pointer
Error ValidityErrorFunc
Warning ValidityWarningFunc
Node NodePtr
NodeNr c.Int
NodeMax c.Int
Expand Down
6 changes: 3 additions & 3 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/xlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ type XlinkExtendedLinkFunk func(c.Pointer, NodePtr, c.Int, *XlinkHRef, *XlinkRol
type XlinkExtendedLinkSetFunk func(c.Pointer, NodePtr, c.Int, *XlinkHRef, *XlinkRole, c.Int, *XlinkTitle, **Char)

type X_xlinkHandler struct {
Simple c.Pointer
Extended c.Pointer
Set c.Pointer
Simple XlinkSimpleLinkFunk
Extended XlinkExtendedLinkFunk
Set XlinkExtendedLinkSetFunk
}
type XlinkHandler X_xlinkHandler
type XlinkHandlerPtr *XlinkHandler
Expand Down
12 changes: 6 additions & 6 deletions _cmptest/testdata/libxml2/2.13.6/libxml2/xpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ type X_xmlXPathContext struct {
Here NodePtr
Origin NodePtr
NsHash HashTablePtr
VarLookupFunc c.Pointer
VarLookupFunc XPathVariableLookupFunc
VarLookupData c.Pointer
Extra c.Pointer
Function *Char
FunctionURI *Char
FuncLookupFunc c.Pointer
FuncLookupFunc XPathFuncLookupFunc
FuncLookupData c.Pointer
TmpNsList *NsPtr
TmpNsNr c.Int
UserData c.Pointer
Error c.Pointer
Error StructuredErrorFunc
LastError Error
DebugNode NodePtr
Dict DictPtr
Expand Down Expand Up @@ -142,7 +142,7 @@ type XPathConvertFunc func(XPathObjectPtr, c.Int) c.Int

type X_xmlXPathType struct {
Name *Char
Func c.Pointer
Func XPathConvertFunc
}
type XPathType X_xmlXPathType
type XPathTypePtr *XPathType
Expand All @@ -159,7 +159,7 @@ type XPathEvalFunc func(XPathParserContextPtr, c.Int)

type X_xmlXPathFunct struct {
Name *Char
Func c.Pointer
Func XPathEvalFunc
}
type XPathFunct X_xmlXPathFunct
type XPathFuncPtr *XPathFunct
Expand All @@ -169,7 +169,7 @@ type XPathAxisFunc func(XPathParserContextPtr, XPathObjectPtr) XPathObjectPtr

type X_xmlXPathAxis struct {
Name *Char
Func c.Pointer
Func XPathAxisFunc
}
type XPathAxis X_xmlXPathAxis
type XPathAxisPtr *XPathAxis
Expand Down
18 changes: 9 additions & 9 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/xsltInternals.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MAX_SORT = 15

type X_xsltRuntimeExtra struct {
Info c.Pointer
Deallocate c.Pointer
Deallocate libxml2.FreeFunc
Val struct {
Ptr c.Pointer
}
Expand Down Expand Up @@ -200,9 +200,9 @@ type X_xsltTransformContext struct {
Extras RuntimeExtraPtr
StyleList DocumentPtr
Sec c.Pointer
Error c.Pointer
Error libxml2.GenericErrorFunc
Errctx c.Pointer
Sortfunc c.Pointer
Sortfunc SortFunc
TmpRVT libxml2.DocPtr
PersistRVT libxml2.DocPtr
Ctxtflags c.Int
Expand Down Expand Up @@ -232,19 +232,19 @@ type X_xsltTransformContext struct {
OpCount c.Ulong
SourceDocDirty c.Int
CurrentId c.Ulong
NewLocale c.Pointer
FreeLocale c.Pointer
GenSortKey c.Pointer
NewLocale NewLocaleFunc
FreeLocale FreeLocaleFunc
GenSortKey GenSortKeyFunc
}
type TransformContext X_xsltTransformContext
type TransformContextPtr *TransformContext

type X_xsltElemPreComp struct {
Next ElemPreCompPtr
Type StyleType
Func c.Pointer
Func TransformFunction
Inst libxml2.NodePtr
Free c.Pointer
Free ElemPreCompDeallocator
}
type ElemPreComp X_xsltElemPreComp
type ElemPreCompPtr *ElemPreComp
Expand Down Expand Up @@ -287,7 +287,7 @@ type ElemPreCompDeallocator func(ElemPreCompPtr)
type X_xsltStylePreComp struct {
Next ElemPreCompPtr
Type StyleType
Func c.Pointer
Func TransformFunction
Inst libxml2.NodePtr
Stype *libxml2.Char
HasStype c.Int
Expand Down
4 changes: 2 additions & 2 deletions _cmptest/testdata/zlib/1.3.1/zlib/zlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ type ZStreamS struct {
TotalOut ULong
Msg *c.Char
State *InternalState
Zalloc c.Pointer
Zfree c.Pointer
Zalloc AllocFunc
Zfree FreeFunc
Opaque Voidpf
DataType c.Int
Adler ULong
Expand Down
2 changes: 1 addition & 1 deletion cl/internal/convert/_testdata/funcrefer/gogensig.expect
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Hooks struct {

type Stream struct {
F *c.FILE
Cb c.Pointer
Cb CallBack
}

// llgo:type C
Expand Down
8 changes: 1 addition & 7 deletions cl/internal/convert/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func (p *TypeConv) handlePointerType(t *ast.PointerType) (types.Type, error) {
}
}

// llgo with a anonymous function type current only support with pointer
if baseFuncType, ok := baseType.(*types.Signature); ok {
if p.ctx == Record {
return p.typeMap.CType("Pointer"), nil
Expand All @@ -146,13 +147,6 @@ func (p *TypeConv) handleIdentRefer(t ast.Expr) (types.Type, error) {
if err != nil {
return nil, err
}
if p.ctx == Record {
if named, ok := typ.(*types.Named); ok {
if _, ok := named.Underlying().(*types.Signature); ok {
return p.typeMap.CType("Pointer"), nil
}
}
}
return typ, nil
}
switch t := t.(type) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gogensig/testdata/lua/gogensig.expect
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Buffer struct {

type Reg struct {
Name *c.Char
Func c.Pointer
Func CFunction
}

//go:linkname Checkversion C.luaL_checkversion_
Expand Down Expand Up @@ -163,7 +163,7 @@ func Buffinitsize(L *State, B *Buffer, sz c.SizeT) *c.Char

type Stream struct {
F *c.FILE
Closef c.Pointer
Closef CFunction
}

===== lua.go =====
Expand Down
Loading