Skip to content
Open
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
4 changes: 2 additions & 2 deletions _xtool/internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ func (ct *Converter) ProcessMethodAttributes(cursor clang.Cursor, fn *ast.FuncDe
}

func (ct *Converter) ProcessEnumType(cursor clang.Cursor) *ast.EnumType {
items := make([]*ast.EnumItem, 0)
items := []*ast.EnumItem{}

clangutils.VisitChildren(cursor, func(cursor, parent clang.Cursor) clang.ChildVisitResult {
if cursor.Kind == clang.CursorEnumConstantDecl {
Expand Down Expand Up @@ -737,7 +737,7 @@ func (ct *Converter) ProcessFieldList(cursor clang.Cursor) *ast.FieldList {

// Note:Public Method is considered
func (ct *Converter) ProcessMethods(cursor clang.Cursor) []*ast.FuncDecl {
methods := make([]*ast.FuncDecl, 0)
methods := []*ast.FuncDecl{}
clangutils.VisitChildren(cursor, func(subcsr, parent clang.Cursor) clang.ChildVisitResult {
if isMethod(subcsr) && subcsr.CXXAccessSpecifier() == clang.CXXPublic {
method := ct.ProcessFuncDecl(subcsr)
Expand Down
2 changes: 1 addition & 1 deletion cmd/llcppcfg/gen/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func findDepSlice(lines []string) ([]string, string) {
}

func getClangArgs(cflags string, relpath string) []string {
args := make([]string, 0)
var args []string
cflagsField := strings.Fields(cflags)
args = append(args, cflagsField...)
args = append(args, "-MM")
Expand Down
4 changes: 2 additions & 2 deletions cmd/llcppgtest/llcppgtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func RunCommand(name string, args ...string) {
}

func PkgList(r io.Reader) []string {
pkgs := make([]string, 0)
var pkgs []string
scan := bufio.NewScanner(r)
for scan.Scan() {
lineBuf := bytes.NewBufferString(scan.Text())
Expand Down Expand Up @@ -150,7 +150,7 @@ func runPkgs(pkgs []string, cfg *RunConfig) {
if cfg.runMode&withSymgVerbose != 0 {
llcppgArg = append(llcppgArg, fmt.Sprintf("-%s", VsymgFlagName))
}
runs := make([]string, 0)
var runs []string
for _, pkg := range pkgs {
dir := "./out/" + pkg
RunCommand("mkdir", "-p", dir)
Expand Down
Loading