From 82f5ca1ef05970fc271dc7e1cacaed8e27f65910 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 6 Aug 2013 21:49:03 +1000 Subject: [PATCH] runtime: change int32 to intgo in findnull and findnullw Update #6046. This CL just does findnull and findnullw. There are other functions to fix but doing them a few at a time will help isolate any (unlikely) breakages these changes bring up in architectures I can't test myself. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12520043 --- src/pkg/runtime/env_plan9.c | 3 ++- src/pkg/runtime/env_posix.c | 3 ++- src/pkg/runtime/os_plan9.c | 3 ++- src/pkg/runtime/os_plan9_386.c | 2 +- src/pkg/runtime/os_plan9_amd64.c | 2 +- src/pkg/runtime/print.c | 2 +- src/pkg/runtime/runtime.c | 2 +- src/pkg/runtime/runtime.h | 4 ++-- src/pkg/runtime/string.goc | 8 ++++---- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/pkg/runtime/env_plan9.c b/src/pkg/runtime/env_plan9.c index 0483d7eef57..599319c7550 100644 --- a/src/pkg/runtime/env_plan9.c +++ b/src/pkg/runtime/env_plan9.c @@ -8,7 +8,8 @@ byte* runtime·getenv(int8 *s) { - int32 fd, len, n, r; + int32 fd, n, r; + intgo len; byte file[128]; byte *p; diff --git a/src/pkg/runtime/env_posix.c b/src/pkg/runtime/env_posix.c index 8333811fb8e..58da0850855 100644 --- a/src/pkg/runtime/env_posix.c +++ b/src/pkg/runtime/env_posix.c @@ -11,7 +11,8 @@ Slice syscall·envs; byte* runtime·getenv(int8 *s) { - int32 i, j, len; + int32 i, j; + intgo len; byte *v, *bs; String* envv; int32 envc; diff --git a/src/pkg/runtime/os_plan9.c b/src/pkg/runtime/os_plan9.c index e8e116f4882..52460c7c81c 100644 --- a/src/pkg/runtime/os_plan9.c +++ b/src/pkg/runtime/os_plan9.c @@ -194,7 +194,8 @@ runtime·goexitsall(int8 *status) int32 runtime·postnote(int32 pid, int8* msg) { - int32 fd, len; + int32 fd; + intgo len; uint8 buf[128]; uint8 tmp[16]; uint8 *p, *q; diff --git a/src/pkg/runtime/os_plan9_386.c b/src/pkg/runtime/os_plan9_386.c index a174771db34..0844d726b59 100644 --- a/src/pkg/runtime/os_plan9_386.c +++ b/src/pkg/runtime/os_plan9_386.c @@ -32,7 +32,7 @@ runtime·sighandler(void *v, int8 *s, G *gp) Ureg *ureg; uintptr *sp; SigTab *sig, *nsig; - int32 len, i; + intgo len, i; if(!s) return NCONT; diff --git a/src/pkg/runtime/os_plan9_amd64.c b/src/pkg/runtime/os_plan9_amd64.c index 30f31e99693..58822ff8484 100644 --- a/src/pkg/runtime/os_plan9_amd64.c +++ b/src/pkg/runtime/os_plan9_amd64.c @@ -40,7 +40,7 @@ runtime·sighandler(void *v, int8 *s, G *gp) Ureg *ureg; uintptr *sp; SigTab *sig, *nsig; - int32 len, i; + intgo i, len; if(!s) return NCONT; diff --git a/src/pkg/runtime/print.c b/src/pkg/runtime/print.c index 5b601599bc9..92207623550 100644 --- a/src/pkg/runtime/print.c +++ b/src/pkg/runtime/print.c @@ -12,7 +12,7 @@ static void vprintf(int8*, byte*); // write to goroutine-local buffer if diverting output, // or else standard error. static void -gwrite(void *v, int32 n) +gwrite(void *v, intgo n) { if(g == nil || g->writebuf == nil) { runtime·write(2, v, n); diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index a0e9a194c6d..7f693589f63 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -393,7 +393,7 @@ void runtime·parsedebugvars(void) { byte *p; - int32 i, n; + intgo i, n; p = runtime·getenv("GODEBUG"); if(p == nil) diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index e48b58a70e8..ff3ecfaaaff 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -717,8 +717,8 @@ extern DebugVars runtime·debug; */ int32 runtime·strcmp(byte*, byte*); byte* runtime·strstr(byte*, byte*); -int32 runtime·findnull(byte*); -int32 runtime·findnullw(uint16*); +intgo runtime·findnull(byte*); +intgo runtime·findnullw(uint16*); void runtime·dump(byte*, int32); int32 runtime·runetochar(byte*, int32); int32 runtime·charntorune(int32*, uint8*, int32); diff --git a/src/pkg/runtime/string.goc b/src/pkg/runtime/string.goc index 15d690a921d..dccb97128a5 100644 --- a/src/pkg/runtime/string.goc +++ b/src/pkg/runtime/string.goc @@ -10,10 +10,10 @@ package runtime String runtime·emptystring; -int32 +intgo runtime·findnull(byte *s) { - int32 l; + intgo l; if(s == nil) return 0; @@ -22,10 +22,10 @@ runtime·findnull(byte *s) return l; } -int32 +intgo runtime·findnullw(uint16 *s) { - int32 l; + intgo l; if(s == nil) return 0;