commit cbf43783043acd39ede85a4e82566b914078b4cb from: rsc date: Thu Apr 20 20:35:35 2006 UTC 64-bit fixes from plan 9 commit - dbbfb316fbf21fbc09635283bfc526da0f387df3 commit + cbf43783043acd39ede85a4e82566b914078b4cb blob - 09b492a6ed7e23c33372549036ebc54458561f06 blob + 01e54ac04cd839c4bba67da236241999b6c88d44 --- src/cmd/samterm/mesg.c +++ src/cmd/samterm/mesg.c @@ -22,7 +22,7 @@ int exiting; void inmesg(Hmesg, int); int inshort(int); long inlong(int); -long invlong(int); +vlong invlong(int); void hsetdot(int, long, long); void hmoveto(int, long); void hsetsnarf(int); @@ -331,7 +331,7 @@ clrlock(void) void startfile(Text *t) { - outTsv(Tstartfile, t->tag, t); /* for 64-bit pointers */ + outTsv(Tstartfile, t->tag, (vlong)t); /* for 64-bit pointers */ setlock(); } @@ -339,7 +339,7 @@ void startnewfile(int type, Text *t) { t->tag = Untagged; - outTv(type, t); /* for 64-bit pointers */ + outTv(type, (vlong)t); /* for 64-bit pointers */ } int @@ -355,15 +355,15 @@ inlong(int n) ((long)indata[n+2]<<16)|((long)indata[n+3]<<24); } -long +vlong invlong(int n) { - long l; + vlong v; - l = (indata[n+7]<<24) | (indata[n+6]<<16) | (indata[n+5]<<8) | indata[n+4]; - l = (l<<16) | (indata[n+3]<<8) | indata[n+2]; - l = (l<<16) | (indata[n+1]<<8) | indata[n]; - return l; + v = (indata[n+7]<<24) | (indata[n+6]<<16) | (indata[n+5]<<8) | indata[n+4]; + v = (v<<16) | (indata[n+3]<<8) | indata[n+2]; + v = (v<<16) | (indata[n+1]<<8) | indata[n]; + return v; } void @@ -418,19 +418,19 @@ outTsl(Tmesg type, int s1, long l1) } void -outTsv(Tmesg type, int s1, void *l1) +outTsv(Tmesg type, int s1, vlong v1) { outstart(type); outshort(s1); - outvlong(l1); + outvlong(v1); outsend(); } void -outTv(Tmesg type, void *l1) +outTv(Tmesg type, vlong v1) { outstart(type); - outvlong(l1); + outvlong(v1); outsend(); } @@ -498,15 +498,15 @@ outlong(long l) } void -outvlong(void *v) +outvlong(vlong v) { int i; - ulong l; uchar buf[8]; - l = (ulong) v; - for(i = 0; i < sizeof(buf); i++, l >>= 8) - buf[i] = l; + for(i = 0; i < sizeof(buf); i++){ + buf[i] = v; + v >>= 8; + } outcopy(8, buf); } blob - 2aca0842fff84bf00fede20056346e7aa8533199 blob + 469d566e05094498fd401f660ab7991292e69693 --- src/cmd/samterm/plan9.c +++ src/cmd/samterm/plan9.c @@ -121,7 +121,7 @@ extproc(void *argv) arg = argv; c = arg[0]; - fd = (int)arg[1]; + fd = (int)(uintptr)arg[1]; i = 0; for(;;){ @@ -190,7 +190,7 @@ extstart(void) plumbc = chancreate(sizeof(int), 0); chansetname(plumbc, "plumbc"); arg[0] = plumbc; - arg[1] = (void*)fd; + arg[1] = (void*)(uintptr)fd; proccreate(extproc, arg, STACK); atexit(removeextern); } blob - 04de4b90d64430f81635709e6c6d74825bdaebbd blob + ac564ecff9932b33cf7cb29ca27b3b25a17ebccf --- src/cmd/samterm/samterm.h +++ src/cmd/samterm/samterm.h @@ -173,12 +173,12 @@ void outTl(Tmesg, long); void outTslS(Tmesg, int, long, Rune*); void outTsll(Tmesg, int, long, long); void outTsl(Tmesg, int, long); -void outTsv(Tmesg, int, void*); -void outTv(Tmesg, void*); +void outTsv(Tmesg, int, vlong); +void outTv(Tmesg, vlong); void outstart(Tmesg); void outcopy(int, uchar*); void outshort(int); void outlong(long); -void outvlong(void*); +void outvlong(vlong); void outsend(void);