Skip to content

Commit

Permalink
bump library
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Jun 20, 2024
1 parent 0e92e7c commit 774c0ce
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 68 deletions.
96 changes: 50 additions & 46 deletions gengo/bind/ARImpRec/ARImpRec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gengo/bind/ARImpRec/ARImpRec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestGetProcName(t *testing.T) {
//GetProcName()
// GetProcName()
}

func TestARImpRec(t *testing.T) {
Expand Down
17 changes: 10 additions & 7 deletions gengo/bind/demo/libdemo.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gengo/clang/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (o *Options) ClangCommand(opt ...string) ([]byte, error) {

return stream.RunCommandArgs(cmd.Args...).Output.Bytes(), nil

//cmd.Args = append(cmd.Args, "2>&1")
// cmd.Args = append(cmd.Args, "2>&1")
mylog.Trace("commands", strings.Join(cmd.Args, " "))
Stdout := &bytes.Buffer{}
Stderr := &bytes.Buffer{}
Expand Down Expand Up @@ -84,6 +84,6 @@ func Parse(opt *Options) (ast Node, layout *LayoutMap, err error) {
return nil
})
mylog.Check(errg.Wait())
stream.RunCommand("clang -E -dM " + opt.Sources[0] + " > macros.log") //2>&1
stream.RunCommand("clang -E -dM " + opt.Sources[0] + " > macros.log") // 2>&1
return ast, layout, nil
}
16 changes: 8 additions & 8 deletions gengo/clang/layout_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func (r *RecordLayout) UnmarshalString(data string) error {

switch {
case strings.Contains(data, "__NSConstantString_tag"):
//mylog.Warning("skip unmarshal RecordLayout", data)
//return nil
// mylog.Warning("skip unmarshal RecordLayout", data)
// return nil
}

first := true
Expand All @@ -87,7 +87,7 @@ func (r *RecordLayout) UnmarshalString(data string) error {
before = strings.TrimSpace(before)
if before == "" {
after = strings.TrimSpace(after)
//mylog.Check2(fmt.Sscanf(after, "[sizeof=%d, align=%d]", &r.Size, &r.Align))
// mylog.Check2(fmt.Sscanf(after, "[sizeof=%d, align=%d]", &r.Size, &r.Align))
mylog.Check2(fmt.Sscanf(after, "[sizeof=%d, align=%d", &r.Size, &r.Align))
break
}
Expand All @@ -109,12 +109,12 @@ func (r *RecordLayout) UnmarshalString(data string) error {
after = strings.TrimSpace(after)

// Parse name and type
name := "" //todo test
name := "" // todo test

typen := after
//save strut type todo test
// save strut type todo test
if strings.HasPrefix(typen, "struct ") {
//typen = "struct "
// typen = "struct "
}
if lastSpace := strings.LastIndex(after, " "); lastSpace != -1 {
// If the last space is followed by a closing parenthesis, then it is part of the type.
Expand All @@ -128,7 +128,7 @@ func (r *RecordLayout) UnmarshalString(data string) error {
}

if name == "" {
//continue
// continue
}

// Create node
Expand All @@ -147,7 +147,7 @@ func (r *RecordLayout) UnmarshalString(data string) error {
})
}
}
//mylog.Json("layout", r.layout.Fields)
// mylog.Json("layout", r.layout.Fields)
// Group fields
r.regroup()
return nil
Expand Down
5 changes: 3 additions & 2 deletions gengo/gengo/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package gengo

import (
"fmt"
"github.com/ddkwork/golibrary/mylog"
"go/token"
"strconv"
"strings"

"github.com/ddkwork/golibrary/mylog"

"github.com/can1357/gengo/clang"
"github.com/dave/dst"
)
Expand Down Expand Up @@ -641,7 +642,7 @@ func (mod Module) EmitFrom(ast clang.Node, layouts *clang.LayoutMap) {

// Define typedefs.
clang.Visit(ast, func(td *clang.TypedefDecl) bool {
//mylog.Warning(td.Name, td.Type.QualType)
// mylog.Warning(td.Name, td.Type.QualType)
mod.EmitTypedef(td)
return true
})
Expand Down
2 changes: 1 addition & 1 deletion gengo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (

require (
github.com/dave/dst v0.27.3
github.com/ddkwork/golibrary v0.0.65
github.com/ddkwork/golibrary v0.0.66
github.com/valyala/fastjson v1.6.4
golang.org/x/sync v0.7.0
)
2 changes: 2 additions & 0 deletions gengo/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/ddkwork/golibrary v0.0.62 h1:1FykFpwByIEtR6l7tm7sa2MmZDjuoMEcZwY3tB1J
github.com/ddkwork/golibrary v0.0.62/go.mod h1:aLG0o5decT3ocB5SWY94n55ynRpVcL8OInSo2p0o5UA=
github.com/ddkwork/golibrary v0.0.65 h1:/WyTQzoVywAlCbNQgVhnoPXQ91NS6KclXvUBLc1ZDlQ=
github.com/ddkwork/golibrary v0.0.65/go.mod h1:/55gYXaVeq2QkSTCaBk3sL0yzbg+DDPr9u3AvyFJblU=
github.com/ddkwork/golibrary v0.0.66 h1:8tsV0lUHZ0sfoqFTl6fF43GL4Kt+ttB0vyLc7LVbrEg=
github.com/ddkwork/golibrary v0.0.66/go.mod h1:/55gYXaVeq2QkSTCaBk3sL0yzbg+DDPr9u3AvyFJblU=
github.com/ebitengine/purego v0.7.1 h1:6/55d26lG3o9VCZX8lping+bZcmShseiqlh2bnUDiPA=
github.com/ebitengine/purego v0.7.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.4

require (
github.com/ddkwork/app v0.0.0-20240618181015-bd28c7f7b739
github.com/ddkwork/golibrary v0.0.65
github.com/ddkwork/golibrary v0.0.66
github.com/richardwilkes/unison v0.71.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ github.com/ddkwork/app v0.0.0-20240618181015-bd28c7f7b739 h1:XyAjgR84qIQeLh7BHYN
github.com/ddkwork/app v0.0.0-20240618181015-bd28c7f7b739/go.mod h1:1WX5EAXe8SfAOk6vdmxEKXv7xeIWlMMJB0/rydlFJWE=
github.com/ddkwork/golibrary v0.0.65 h1:/WyTQzoVywAlCbNQgVhnoPXQ91NS6KclXvUBLc1ZDlQ=
github.com/ddkwork/golibrary v0.0.65/go.mod h1:/55gYXaVeq2QkSTCaBk3sL0yzbg+DDPr9u3AvyFJblU=
github.com/ddkwork/golibrary v0.0.66 h1:8tsV0lUHZ0sfoqFTl6fF43GL4Kt+ttB0vyLc7LVbrEg=
github.com/ddkwork/golibrary v0.0.66/go.mod h1:/55gYXaVeq2QkSTCaBk3sL0yzbg+DDPr9u3AvyFJblU=
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ=
Expand Down

0 comments on commit 774c0ce

Please sign in to comment.