diff options
| author | Rob Pike <r@golang.org> | 2008-10-07 10:03:34 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2008-10-07 10:03:34 -0700 |
| commit | 7ee60b174dd92edca7e608dc06ec4f1b2d0eb79f (patch) | |
| tree | 0645a52783aff93344e73f29b5a4b614f39d47c8 /src | |
| parent | 74e2e087e25dcbd5828cd1bf436e5ef74c1e009c (diff) | |
| download | go-7ee60b174dd92edca7e608dc06ec4f1b2d0eb79f.tar.xz | |
sys.stringtorune doesn't need a length parameter.
R=rsc
DELTA=7 (0 added, 0 deleted, 7 changed)
OCL=16600
CL=16630
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/gc/sys.go | 2 | ||||
| -rw-r--r-- | src/cmd/gc/sysimport.c | 4 | ||||
| -rw-r--r-- | src/runtime/rune.c | 4 | ||||
| -rw-r--r-- | src/runtime/runtime.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/gc/sys.go b/src/cmd/gc/sys.go index 37c523d992..8e2e6ac76d 100644 --- a/src/cmd/gc/sys.go +++ b/src/cmd/gc/sys.go @@ -76,7 +76,7 @@ export func goexit(); export func readfile(string) (string, bool); // read file into string; boolean status export func writefile(string, string) (bool); // write string into file; boolean status export func bytestorune(*byte, int32, int32) (int32, int32); // convert bytes to runes -export func stringtorune(string, int32, int32) (int32, int32); // convert bytes to runes +export func stringtorune(string, int32) (int32, int32); // convert bytes to runes export func exit(int32); diff --git a/src/cmd/gc/sysimport.c b/src/cmd/gc/sysimport.c index c3b7cbfc1f..1ef5d20be0 100644 --- a/src/cmd/gc/sysimport.c +++ b/src/cmd/gc/sysimport.c @@ -1,4 +1,4 @@ -char *sysimport = +char *sysimport = "package sys\n" "type sys.any any\n" "type sys.uint32 uint32\n" @@ -66,7 +66,7 @@ char *sysimport = "export func sys.readfile (? sys.string) (? sys.string, ? sys.bool)\n" "export func sys.writefile (? sys.string, ? sys.string) (? sys.bool)\n" "export func sys.bytestorune (? *sys.uint8, ? sys.int32, ? sys.int32) (? sys.int32, ? sys.int32)\n" - "export func sys.stringtorune (? sys.string, ? sys.int32, ? sys.int32) (? sys.int32, ? sys.int32)\n" + "export func sys.stringtorune (? sys.string, ? sys.int32) (? sys.int32, ? sys.int32)\n" "export func sys.exit (? sys.int32)\n" "\n" "$$\n"; diff --git a/src/runtime/rune.c b/src/runtime/rune.c index d705a5e36f..5738ca3646 100644 --- a/src/runtime/rune.c +++ b/src/runtime/rune.c @@ -235,9 +235,9 @@ sys·bytestorune(byte *str, int32 off, int32 length, int32 outrune, int32 outcou } void -sys·stringtorune(string str, int32 off, int32 length, int32 outrune, int32 outcount) +sys·stringtorune(string str, int32 off, int32 outrune, int32 outcount) { - outcount = charntorune(&outrune, str->str + off, length); + outcount = charntorune(&outrune, str->str + off, str->len - off); FLUSH(&outrune); FLUSH(&outcount); } diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index f590472439..f182aebae7 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -293,4 +293,4 @@ void sys·intstring(int64, string); */ void sys·readfile(string, string, bool); void sys·bytestorune(byte*, int32, int32, int32, int32); -void sys·stringtorune(string, int32, int32, int32, int32); +void sys·stringtorune(string, int32, int32, int32); |
