Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0116/3

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


Avoid overflow from top bit of p[3].
 [rsc] --rw-rw-r-- M 661145 glenda sys 3063 Jan 16 20:30 sys/include/fcall.h
	/n/sourcesdump/2006/0116/plan9/sys/include/fcall.h:64,70 - 
	/n/sourcesdump/2006/0117/plan9/sys/include/fcall.h:64,70
	  #define	GBIT8(p)	((p)[0])
	  #define	GBIT16(p)	((p)[0]|((p)[1]<<8))
	  #define	GBIT32(p)	((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24))
	- #define	GBIT64(p)	((vlong)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
	+ #define	GBIT64(p)	((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
	  				((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
	  
	  #define	PBIT8(p,v)	(p)[0]=(v)


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.