From fb3f38da2a7d45b88c838b3ac55fe40479961790 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 6 Nov 2012 18:28:21 +0000 Subject: compiler, libgo: Fixes to prepare for 64-bit int. From-SVN: r193254 --- libgo/go/bytes/indexbyte.c | 4 ++-- libgo/go/log/syslog/syslog_c.c | 6 ++++-- libgo/go/syscall/signame.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'libgo/go') diff --git a/libgo/go/bytes/indexbyte.c b/libgo/go/bytes/indexbyte.c index 9c72e61..1f4399c 100644 --- a/libgo/go/bytes/indexbyte.c +++ b/libgo/go/bytes/indexbyte.c @@ -13,11 +13,11 @@ We deliberately don't split the stack in case it does call the library function, which shouldn't need much stack space. */ -int IndexByte (struct __go_open_array, char) +intgo IndexByte (struct __go_open_array, char) asm ("bytes.IndexByte") __attribute__ ((no_split_stack)); -int +intgo IndexByte (struct __go_open_array s, char b) { char *p; diff --git a/libgo/go/log/syslog/syslog_c.c b/libgo/go/log/syslog/syslog_c.c index 3b4cddd..d79cba3 100644 --- a/libgo/go/log/syslog/syslog_c.c +++ b/libgo/go/log/syslog/syslog_c.c @@ -6,14 +6,16 @@ #include +#include "runtime.h" + /* We need to use a C function to call the syslog function, because we can't represent a C varargs function in Go. */ -void syslog_c(int, const char*) +void syslog_c(intgo, const char*) asm ("log_syslog.syslog_c"); void -syslog_c (int priority, const char *msg) +syslog_c (intgo priority, const char *msg) { syslog (priority, "%s", msg); } diff --git a/libgo/go/syscall/signame.c b/libgo/go/syscall/signame.c index 5ff0b09..c2d3b9f 100644 --- a/libgo/go/syscall/signame.c +++ b/libgo/go/syscall/signame.c @@ -10,10 +10,10 @@ #include "arch.h" #include "malloc.h" -String Signame (int sig) asm ("syscall.Signame"); +String Signame (intgo sig) asm ("syscall.Signame"); String -Signame (int sig) +Signame (intgo sig) { const char* s = NULL; char buf[100]; @@ -27,7 +27,7 @@ Signame (int sig) if (s == NULL) { - snprintf(buf, sizeof buf, "signal %d", sig); + snprintf(buf, sizeof buf, "signal %ld", (long) sig); s = buf; } len = __builtin_strlen (s); -- cgit v1.1