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

Delta Between Two Patch Sets: src/pkg/syscall/str.go

Issue 3816043: code review 3816043: syscall: Plan 9 support for x86. (Closed)
Left Patch Set: code review 3816043: syscall, os: Plan 9 support for x86. Created 14 years, 2 months ago
Right Patch Set: diff -r a15522fba283 https://go.googlecode.com/hg/ Created 13 years, 11 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/syscall/mksysnum_plan9.sh ('k') | src/pkg/syscall/syscall_linux.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 str(val int) string { // do it here rather than with fmt to avoid dependenc y 7 func itoa(val int) string { // do it here rather than with fmt to avoid dependen cy
8 if val < 0 { 8 if val < 0 {
9 » » return "-" + str(-val) 9 » » return "-" + itoa(-val)
10 } 10 }
11 var buf [32]byte // big enough for int64 11 var buf [32]byte // big enough for int64
12 i := len(buf) - 1 12 i := len(buf) - 1
13 for val >= 10 { 13 for val >= 10 {
14 buf[i] = byte(val%10 + '0') 14 buf[i] = byte(val%10 + '0')
15 i-- 15 i--
16 val /= 10 16 val /= 10
17 } 17 }
18 buf[i] = byte(val + '0') 18 buf[i] = byte(val + '0')
19 return string(buf[i:]) 19 return string(buf[i:])
20 } 20 }
LEFTRIGHT

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