diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-06 18:28:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-11-06 18:28:21 +0000 |
commit | fb3f38da2a7d45b88c838b3ac55fe40479961790 (patch) | |
tree | 89ff7fdde0dc578287fb6c80a46652eaf78f3ddf /libgo/runtime | |
parent | 855a44ee8f73b4c53a0bad7780baa85d043b890f (diff) | |
download | gcc-fb3f38da2a7d45b88c838b3ac55fe40479961790.zip gcc-fb3f38da2a7d45b88c838b3ac55fe40479961790.tar.gz gcc-fb3f38da2a7d45b88c838b3ac55fe40479961790.tar.bz2 |
compiler, libgo: Fixes to prepare for 64-bit int.
From-SVN: r193254
Diffstat (limited to 'libgo/runtime')
-rw-r--r-- | libgo/runtime/cpuprof.c | 2 | ||||
-rw-r--r-- | libgo/runtime/go-new-map.c | 5 | ||||
-rw-r--r-- | libgo/runtime/go-rune.c | 2 | ||||
-rw-r--r-- | libgo/runtime/go-string.h | 2 | ||||
-rw-r--r-- | libgo/runtime/go-traceback.c | 4 | ||||
-rw-r--r-- | libgo/runtime/proc.c | 4 | ||||
-rw-r--r-- | libgo/runtime/runtime.h | 4 | ||||
-rw-r--r-- | libgo/runtime/string.goc | 2 |
8 files changed, 13 insertions, 12 deletions
diff --git a/libgo/runtime/cpuprof.c b/libgo/runtime/cpuprof.c index 23af18b..3b7f572 100644 --- a/libgo/runtime/cpuprof.c +++ b/libgo/runtime/cpuprof.c @@ -124,7 +124,7 @@ static uintptr eod[3] = {0, 1, 0}; static void LostProfileData(void) { } -extern void runtime_SetCPUProfileRate(int32) +extern void runtime_SetCPUProfileRate(intgo) __asm__("runtime.SetCPUProfileRate"); // SetCPUProfileRate sets the CPU profiling rate. diff --git a/libgo/runtime/go-new-map.c b/libgo/runtime/go-new-map.c index 096856e..c289bc0 100644 --- a/libgo/runtime/go-new-map.c +++ b/libgo/runtime/go-new-map.c @@ -106,10 +106,11 @@ __go_map_next_prime (uintptr_t n) struct __go_map * __go_new_map (const struct __go_map_descriptor *descriptor, uintptr_t entries) { - intgo ientries; + int32 ientries; struct __go_map *ret; - ientries = (intgo) entries; + /* The master library limits map entries to int32, so we do too. */ + ientries = (int32) entries; if (ientries < 0 || (uintptr_t) ientries != entries) runtime_panicstring ("map size out of range"); diff --git a/libgo/runtime/go-rune.c b/libgo/runtime/go-rune.c index ba6d86c..4c65e21 100644 --- a/libgo/runtime/go-rune.c +++ b/libgo/runtime/go-rune.c @@ -14,7 +14,7 @@ characters used from STR. */ int -__go_get_rune (const unsigned char *str, size_t len, int *rune) +__go_get_rune (const unsigned char *str, size_t len, int32 *rune) { int c, c1, c2, c3, l; diff --git a/libgo/runtime/go-string.h b/libgo/runtime/go-string.h index f4c149b..7fee1da 100644 --- a/libgo/runtime/go-string.h +++ b/libgo/runtime/go-string.h @@ -26,6 +26,6 @@ __go_ptr_strings_equal (const String *ps1, const String *ps2) return __go_strings_equal (*ps1, *ps2); } -extern int __go_get_rune (const unsigned char *, size_t, int *); +extern int __go_get_rune (const unsigned char *, size_t, int32 *); #endif /* !defined(LIBGO_GO_STRING_H) */ diff --git a/libgo/runtime/go-traceback.c b/libgo/runtime/go-traceback.c index 4d5b61a..2927351 100644 --- a/libgo/runtime/go-traceback.c +++ b/libgo/runtime/go-traceback.c @@ -29,13 +29,13 @@ runtime_printtrace (uintptr *pcbuf, int32 c) { String fn; String file; - int line; + intgo line; if (__go_file_line (pcbuf[i], &fn, &file, &line) && runtime_showframe (fn.str)) { runtime_printf ("%S\n", fn); - runtime_printf ("\t%S:%d\n", file, line); + runtime_printf ("\t%S:%D\n", file, (int64) line); } } } diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index 43071e5..b6254a7 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -610,11 +610,11 @@ runtime_goroutinetrailer(G *g) if(g != nil && g->gopc != 0 && g->goid != 1) { String fn; String file; - int line; + intgo line; if(__go_file_line(g->gopc - 1, &fn, &file, &line)) { runtime_printf("created by %S\n", fn); - runtime_printf("\t%S:%d\n", file, line); + runtime_printf("\t%S:%D\n", file, (int64) line); } } } diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index e6281ea..72e1eb2 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -341,7 +341,7 @@ int32 runtime_ncpu; /* * common functions and data */ -int32 runtime_findnull(const byte*); +intgo runtime_findnull(const byte*); void runtime_dump(byte*, int32); /* @@ -614,7 +614,7 @@ extern uintptr runtime_stacks_sys; struct backtrace_state; extern struct backtrace_state *__go_get_backtrace_state(void); -extern _Bool __go_file_line(uintptr, String*, String*, int *); +extern _Bool __go_file_line(uintptr, String*, String*, intgo *); extern byte* runtime_progname(); int32 getproccount(void); diff --git a/libgo/runtime/string.goc b/libgo/runtime/string.goc index d3f0c2d..240ab0b 100644 --- a/libgo/runtime/string.goc +++ b/libgo/runtime/string.goc @@ -54,7 +54,7 @@ func stringiter(s String, k int) (retk int) { out: } -func stringiter2(s String, k int) (retk int, retv int) { +func stringiter2(s String, k int) (retk int, retv int32) { if(k >= s.len) { // retk=0 is end of iteration retk = 0; |