64-bit fixes from plan 9
This commit is contained in:
parent
dbbfb316fb
commit
cbf4378304
3 changed files with 23 additions and 23 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue