diff options
author | rsc <devnull@localhost> | 2006-04-20 20:35:35 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-04-20 20:35:35 +0000 |
commit | cbf43783043acd39ede85a4e82566b914078b4cb (patch) | |
tree | dd443245b63d2a3e005ea7143fb1fde6070e1b71 /src/cmd/samterm | |
parent | dbbfb316fbf21fbc09635283bfc526da0f387df3 (diff) | |
download | plan9port-cbf43783043acd39ede85a4e82566b914078b4cb.tar.gz plan9port-cbf43783043acd39ede85a4e82566b914078b4cb.tar.bz2 plan9port-cbf43783043acd39ede85a4e82566b914078b4cb.zip |
64-bit fixes from plan 9
Diffstat (limited to 'src/cmd/samterm')
-rw-r--r-- | src/cmd/samterm/mesg.c | 36 | ||||
-rw-r--r-- | src/cmd/samterm/plan9.c | 4 | ||||
-rw-r--r-- | src/cmd/samterm/samterm.h | 6 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/cmd/samterm/mesg.c b/src/cmd/samterm/mesg.c index 09b492a6..01e54ac0 100644 --- a/src/cmd/samterm/mesg.c +++ b/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); } diff --git a/src/cmd/samterm/plan9.c b/src/cmd/samterm/plan9.c index 2aca0842..469d566e 100644 --- a/src/cmd/samterm/plan9.c +++ b/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); } diff --git a/src/cmd/samterm/samterm.h b/src/cmd/samterm/samterm.h index 04de4b90..ac564ecf 100644 --- a/src/cmd/samterm/samterm.h +++ b/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); |