bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vm_size_t is unsigned, so libps should use unsigned ints.


From: James Morrison
Subject: Re: vm_size_t is unsigned, so libps should use unsigned ints.
Date: Thu, 30 May 2002 20:22:12 -0700 (PDT)

--- Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> wrote:
> On Sun, May 26, 2002 at 04:04:44PM -0400, James A Morrison wrote:
> >   I had noticed that ps and pptop would show the virtual size of some of my
> > processes to be some large negative number, which seems wrong, so here is
> the
> > patch I use to get only positive number for the resident size and the
> virtual
> > size.
> 
> This patch is partially wrong and not complete, please make a new patch which
> fixes (at least :) the following points:
> 
> * Check what is up with all the other values using ps_emit_nice_int:
>   Some of them surely are candidates to be uints as well, but check
>   each one individually.

 Nothing else used ps_emit_nice_int.  To print int's there is also 
ps_emit_int and ps_emit_nz_int.  ps_emit_nice_int only handled positive values,
it was also only used by functions that should use size_t's.

> * Don't rename ps_emit_nice_int, but provide ps_emit_nice_uint as a new
>   function used by all from above.  Seems we need a second sprint_frac_value
>   function for uint's, too.  I say maybe because the analysis above might
>   lead to a result where all types are either uint, or are int but without
> any
>   valid negative numbers.  If the latter is the case, an assert() and a cast
>   to uint will do.

  I don't like this.  After looking at both sprint_frac_value and 
ps_emit_nice_int I think they should both use size_t's.

> * Your changelog doesn't match the patch.  If you rename a function, you
>   should do:
>   (foo_old): Renamed to ...
>   (foo_new): ... this.  New function.
>   Or something like that.  But see above, probably should not be renamed at
> all.
> 

 I can fix this.

> Thanks for spotting this,
> Marcus
> 
> -- 
> `Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
> Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
> Marcus.Brinkmann@ruhr-uni-bochum.de
> http://www.marcus-brinkmann.de


=====
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone referring to this as 'Open Source' shall be eaten by a GNU

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]