summaryrefslogtreecommitdiff
path: root/libgo/runtime/go-strcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-strcmp.c')
-rw-r--r--libgo/runtime/go-strcmp.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libgo/runtime/go-strcmp.c b/libgo/runtime/go-strcmp.c
index 8e6cb1834a2..bcc270bf8a5 100644
--- a/libgo/runtime/go-strcmp.c
+++ b/libgo/runtime/go-strcmp.c
@@ -4,23 +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 "runtime.h"
-int
-__go_strcmp(struct __go_string s1, struct __go_string s2)
+intgo
+__go_strcmp(String s1, String s2)
{
int i;
- i = __builtin_memcmp(s1.__data, s2.__data,
- (s1.__length < s2.__length
- ? s1.__length
- : s2.__length));
+ i = __builtin_memcmp(s1.str, s2.str,
+ (s1.len < s2.len ? s1.len : s2.len));
if (i != 0)
return i;
- if (s1.__length < s2.__length)
+ if (s1.len < s2.len)
return -1;
- else if (s1.__length > s2.__length)
+ else if (s1.len > s2.len)
return 1;
else
return 0;