1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Cast pointers to intptr_t instead of or before casting to long.

Fixed bitrot in K&R support (suword() now takes a long word).
Didn't fix corresponding bitrot in store.9 and fetch.9.

The correct types for the store and fetch families are problematic.
The `word' functions are unfortunately named and need to be split
to handle ints/longs/object pointers/function pointers.  Storing
argv[] as longs is quite broken when longs are longer than pointers,
but usually works because it clobbers variables that will soon be
reinitialized.
This commit is contained in:
Bruce Evans 1998-07-15 05:21:48 +00:00
parent 7cd99438f8
commit c2da0fd903
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37657

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
* $Id: init_main.c,v 1.93 1998/05/28 09:30:15 phk Exp $
* $Id: init_main.c,v 1.94 1998/06/07 17:11:32 dfr Exp $
*/
#include "opt_devfs.h"
@ -605,10 +605,10 @@ start_init(p)
/*
* Move out the arg pointers.
*/
uap = (char **)((long)ucp & ~(NBPW-1));
(void)suword((caddr_t)--uap, 0); /* terminator */
(void)suword((caddr_t)--uap, (long)arg1);
(void)suword((caddr_t)--uap, (long)arg0);
uap = (char **)((intptr_t)ucp & ~(NBPW-1));
(void)suword((caddr_t)--uap, (long)0); /* terminator */
(void)suword((caddr_t)--uap, (long)(intptr_t)arg1);
(void)suword((caddr_t)--uap, (long)(intptr_t)arg0);
/*
* Point at the arguments.