Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/1119/10

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


64-bit fixes.
 [jmk] --rw-rw-r-- M 107020 glenda sys 12581 Nov 19 20:09 sys/src/cmd/samterm/mesg.c
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:21,27 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:21,27
	  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);
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:323,329 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:323,329
	  void
	  startfile(Text *t)
	  {
	- 	outTsv(Tstartfile, t->tag, t);		/* for 64-bit pointers */
	+ 	outTsv(Tstartfile, t->tag, (vlong)t);	/* for 64-bit pointers */
	  	setlock();
	  }
	  
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:331,337 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:331,337
	  startnewfile(int type, Text *t)
	  {
	  	t->tag = Untagged;
	- 	outTv(type, t);				/* for 64-bit pointers */
	+ 	outTv(type, (vlong)t);			/* for 64-bit pointers */
	  }
	  
	  int
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:347,361 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:347,361
	  		((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
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:410,428 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:410,428
	  }
	  
	  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();
	  }
	  
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/mesg.c:490,504 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/mesg.c:490,504
	  }
	  
	  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);
	  }
 [jmk] --rw-rw-r-- M 107020 glenda sys 3773 Nov 19 20:09 sys/src/cmd/samterm/samterm.h
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/samterm/samterm.h:169,179 - 
	/n/sourcesdump/2005/1120/plan9/sys/src/cmd/samterm/samterm.h:169,179
	  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);


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].