summaryrefslogtreecommitdiff
path: root/src/syscall/mksyscall_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/mksyscall_windows.go')
-rw-r--r--src/syscall/mksyscall_windows.go24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/syscall/mksyscall_windows.go b/src/syscall/mksyscall_windows.go
index ea9ee4551..1cdd6b4d2 100644
--- a/src/syscall/mksyscall_windows.go
+++ b/src/syscall/mksyscall_windows.go
@@ -158,7 +158,6 @@ func (p *Param) SyscallArgList() []string {
case p.Type[0] == '*':
s = fmt.Sprintf("unsafe.Pointer(%s)", p.Name)
case p.Type == "string":
- p.fn.use(p.tmpVar())
s = fmt.Sprintf("unsafe.Pointer(%s)", p.tmpVar())
case p.Type == "bool":
s = p.tmpVar()
@@ -304,7 +303,6 @@ type Fn struct {
Params []*Param
Rets *Rets
PrintTrace bool
- Used []string
dllname string
dllfuncname string
src string
@@ -312,15 +310,6 @@ type Fn struct {
curTmpVarIdx int // insure tmp variables have uniq names
}
-func (f *Fn) use(v string) {
- for _, e := range f.Used {
- if e == v {
- return
- }
- }
- f.Used = append(f.Used, v)
-}
-
// extractParams parses s to extract function parameters.
func extractParams(s string, f *Fn) ([]*Param, error) {
s = trim(s)
@@ -339,7 +328,7 @@ func extractParams(s string, f *Fn) ([]*Param, error) {
}
}
ps[i] = &Param{
- Name: sanitizeName(trim(b[0])),
+ Name: trim(b[0]),
Type: trim(b[1]),
fn: f,
tmpVarIdx: -1,
@@ -348,13 +337,6 @@ func extractParams(s string, f *Fn) ([]*Param, error) {
return ps, nil
}
-func sanitizeName(n string) string {
- if n == "use" {
- return "use_"
- }
- return n
-}
-
// extractSection extracts text out of string s starting after start
// and ending just before end. found return value will indicate success,
// and prefix, body and suffix will contain correspondent parts of string s.
@@ -698,7 +680,7 @@ var (
{{define "funcbody"}}
func {{.Name}}({{.ParamList}}) {{if .Rets.List}}{{.Rets.List}} {{end}}{
{{template "tmpvars" .}} {{template "syscall" .}}
-{{template "used" .}}{{template "seterror" .}}{{template "printtrace" .}} return
+{{template "seterror" .}}{{template "printtrace" .}} return
}
{{end}}
@@ -707,8 +689,6 @@ func {{.Name}}({{.ParamList}}) {{if .Rets.List}}{{.Rets.List}} {{end}}{
{{define "syscall"}}{{.Rets.SetReturnValuesCode}}{{.Syscall}}(proc{{.DLLFuncName}}.Addr(), {{.ParamCount}}, {{.SyscallParamList}}){{end}}
-{{define "used"}}{{range .Used}}use(unsafe.Pointer({{.}}));{{end}}{{end}}
-
{{define "seterror"}}{{if .Rets.SetErrorCode}} {{.Rets.SetErrorCode}}
{{end}}{{end}}