mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 16:47:27 -04:00
unix: consistently use tabs in //sys and //sysnb lines
There is some inconsistent use of tabs and spaces in the //sys and //sysnb lines. However, the large majority is using tabs, so use these consistently. Also change the regexp in mksyscall*.go to only accept tabs going forward. Change-Id: I78944e88b5fec11c1bd1d103cea894bc5109da56 Reviewed-on: https://go-review.googlesource.com/c/sys/+/283596 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
f992740a1b
commit
73548a7a48
+3
-5
@@ -134,17 +134,15 @@ func main() {
|
|||||||
s := bufio.NewScanner(file)
|
s := bufio.NewScanner(file)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
t := s.Text()
|
t := s.Text()
|
||||||
t = strings.TrimSpace(t)
|
nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
|
||||||
t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
|
if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
|
||||||
nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
|
|
||||||
if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line must be of the form
|
// Line must be of the form
|
||||||
// func Open(path string, mode int, perm int) (fd int, errno error)
|
// func Open(path string, mode int, perm int) (fd int, errno error)
|
||||||
// Split into name, in params, out params.
|
// Split into name, in params, out params.
|
||||||
f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t)
|
f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t)
|
||||||
if f == nil {
|
if f == nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -105,20 +105,18 @@ func main() {
|
|||||||
s := bufio.NewScanner(file)
|
s := bufio.NewScanner(file)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
t := s.Text()
|
t := s.Text()
|
||||||
t = strings.TrimSpace(t)
|
|
||||||
t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
|
|
||||||
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
||||||
pack = p[1]
|
pack = p[1]
|
||||||
}
|
}
|
||||||
nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
|
nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
|
||||||
if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
|
if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line must be of the form
|
// Line must be of the form
|
||||||
// func Open(path string, mode int, perm int) (fd int, err error)
|
// func Open(path string, mode int, perm int) (fd int, err error)
|
||||||
// Split into name, in params, out params.
|
// Split into name, in params, out params.
|
||||||
f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
||||||
if f == nil {
|
if f == nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -154,20 +154,18 @@ func main() {
|
|||||||
s := bufio.NewScanner(file)
|
s := bufio.NewScanner(file)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
t := s.Text()
|
t := s.Text()
|
||||||
t = strings.TrimSpace(t)
|
|
||||||
t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
|
|
||||||
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
||||||
pack = p[1]
|
pack = p[1]
|
||||||
}
|
}
|
||||||
nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
|
nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
|
||||||
if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
|
if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line must be of the form
|
// Line must be of the form
|
||||||
// func Open(path string, mode int, perm int) (fd int, err error)
|
// func Open(path string, mode int, perm int) (fd int, err error)
|
||||||
// Split into name, in params, out params.
|
// Split into name, in params, out params.
|
||||||
f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
||||||
if f == nil {
|
if f == nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -108,20 +108,18 @@ func main() {
|
|||||||
s := bufio.NewScanner(file)
|
s := bufio.NewScanner(file)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
t := s.Text()
|
t := s.Text()
|
||||||
t = strings.TrimSpace(t)
|
|
||||||
t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
|
|
||||||
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
|
||||||
pack = p[1]
|
pack = p[1]
|
||||||
}
|
}
|
||||||
nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
|
nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
|
||||||
if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
|
if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line must be of the form
|
// Line must be of the form
|
||||||
// func Open(path string, mode int, perm int) (fd int, err error)
|
// func Open(path string, mode int, perm int) (fd int, err error)
|
||||||
// Split into name, in params, out params.
|
// Split into name, in params, out params.
|
||||||
f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
|
||||||
if f == nil {
|
if f == nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ func direntNamlen(buf []byte) (uint64, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe() (fd1 int, fd2 int, err error)
|
//sysnb pipe() (fd1 int, fd2 int, err error)
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
if len(p) != 2 {
|
if len(p) != 2 {
|
||||||
return EINVAL
|
return EINVAL
|
||||||
@@ -120,6 +121,7 @@ func Pipe(p []int) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//sys Getdents(fd int, buf []byte) (n int, err error)
|
//sys Getdents(fd int, buf []byte) (n int, err error)
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
n, err = Getdents(fd, buf)
|
n, err = Getdents(fd, buf)
|
||||||
if err != nil || basep == nil {
|
if err != nil || basep == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user