Subject: Re: new sysctl(KERN_PROC, ...) interface (was: sysinfo(2))
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Chris G. Demetriou <cgd@netbsd.org>
List: tech-kern
Date: 04/17/2000 15:06:26
Darren Reed <darrenr@reed.wattle.id.au> writes:
> > > 	#define PTRTOINT64(foo) ((u_int64_t)(long)(foo))
> 
> I missed the original, but we should use intptr_t, not long here.
> It is architecture size dependant, of course.  IMHO, we use long
> too often where we should be using intptr_t.

Yes.  Of course, unless i'm mistaken, 'intptr_t' is a relative
newcomer, and most people haven't been educated as to the joys of its
use.

if we're going there, as far as i'm concerned:

	* we should also be switching to uintNN_t (from u_intNN_t)
          type names, and

	* we should be using c9x-style printf format cpp magic to
          arrange for types to be printed correctly w/o having to
	  resort to weird casts.


cgd	  
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.