diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-01 03:02:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-01 03:02:13 +0000 |
commit | 776f27a67f26c795ba8c27a4e69525382b9379c3 (patch) | |
tree | 0285cca6b375a23d93c20efec03cb9adec30f0e0 /libgo/runtime/go-string-to-byte-array.c | |
parent | 79e0221796bf5897204e8077afc20e34f88dab3b (diff) | |
download | gcc-776f27a67f26c795ba8c27a4e69525382b9379c3.zip gcc-776f27a67f26c795ba8c27a4e69525382b9379c3.tar.gz gcc-776f27a67f26c795ba8c27a4e69525382b9379c3.tar.bz2 |
compiler, runtime: More steps toward separating int and intgo.
From-SVN: r193059
Diffstat (limited to 'libgo/runtime/go-string-to-byte-array.c')
-rw-r--r-- | libgo/runtime/go-string-to-byte-array.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libgo/runtime/go-string-to-byte-array.c b/libgo/runtime/go-string-to-byte-array.c index 8bae54b..75fac1d 100644 --- a/libgo/runtime/go-string-to-byte-array.c +++ b/libgo/runtime/go-string-to-byte-array.c @@ -4,22 +4,21 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ -#include "go-string.h" -#include "array.h" #include "runtime.h" +#include "array.h" #include "arch.h" #include "malloc.h" struct __go_open_array -__go_string_to_byte_array (struct __go_string str) +__go_string_to_byte_array (String str) { unsigned char *data; struct __go_open_array ret; - data = (unsigned char *) runtime_mallocgc (str.__length, FlagNoPointers, 1, 0); - __builtin_memcpy (data, str.__data, str.__length); + data = (unsigned char *) runtime_mallocgc (str.len, FlagNoPointers, 1, 0); + __builtin_memcpy (data, str.str, str.len); ret.__values = (void *) data; - ret.__count = str.__length; - ret.__capacity = str.__length; + ret.__count = str.len; + ret.__capacity = str.len; return ret; } |