Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Side by Side Diff: src/pkg/syscall/syscall_darwin_386.go

Issue 180049: code review 180049: 1) Change default gofmt default settings for (Closed)
Patch Set: code review 180049: 1) Change default gofmt default settings for Created 15 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/syscall/syscall_darwin.go ('k') | src/pkg/syscall/syscall_darwin_amd64.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package syscall 5 package syscall
6 6
7 func Getpagesize() int» { return 4096 } 7 func Getpagesize() int { return 4096 }
8 8
9 func TimespecToNsec(ts Timespec) int64» { return int64(ts.Sec)*1e9 + int64(ts.Ns ec) } 9 func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nse c) }
10 10
11 func NsecToTimespec(nsec int64) (ts Timespec) { 11 func NsecToTimespec(nsec int64) (ts Timespec) {
12 » ts.Sec = int32(nsec / 1e9); 12 » ts.Sec = int32(nsec / 1e9)
13 » ts.Nsec = int32(nsec % 1e9); 13 » ts.Nsec = int32(nsec % 1e9)
14 » return; 14 » return
15 } 15 }
16 16
17 func TimevalToNsec(tv Timeval) int64» { return int64(tv.Sec)*1e9 + int64(tv.Us ec)*1e3 } 17 func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec) *1e3 }
18 18
19 func NsecToTimeval(nsec int64) (tv Timeval) { 19 func NsecToTimeval(nsec int64) (tv Timeval) {
20 » nsec += 999;» // round up to microsecond 20 » nsec += 999 // round up to microsecond
21 » tv.Usec = int32(nsec % 1e9 / 1e3); 21 » tv.Usec = int32(nsec % 1e9 / 1e3)
22 » tv.Sec = int32(nsec / 1e9); 22 » tv.Sec = int32(nsec / 1e9)
23 » return; 23 » return
24 } 24 }
25 25
26 //sys gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) 26 //sys gettimeofday(tp *Timeval) (sec int32, usec int32, errno int)
27 func Gettimeofday(tv *Timeval) (errno int) { 27 func Gettimeofday(tv *Timeval) (errno int) {
28 // The tv passed to gettimeofday must be non-nil 28 // The tv passed to gettimeofday must be non-nil
29 // but is otherwise unused. The answers come back 29 // but is otherwise unused. The answers come back
30 // in the two registers. 30 // in the two registers.
31 » sec, usec, err := gettimeofday(tv); 31 » sec, usec, err := gettimeofday(tv)
32 » tv.Sec = int32(sec); 32 » tv.Sec = int32(sec)
33 » tv.Usec = int32(usec); 33 » tv.Usec = int32(usec)
34 » return err; 34 » return err
35 } 35 }
36 36
37 func SetKevent(k *Kevent_t, fd, mode, flags int) { 37 func SetKevent(k *Kevent_t, fd, mode, flags int) {
38 » k.Ident = uint32(fd); 38 » k.Ident = uint32(fd)
39 » k.Filter = int16(mode); 39 » k.Filter = int16(mode)
40 » k.Flags = uint16(flags); 40 » k.Flags = uint16(flags)
41 } 41 }
OLDNEW
« no previous file with comments | « src/pkg/syscall/syscall_darwin.go ('k') | src/pkg/syscall/syscall_darwin_amd64.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b