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

Re: [Libvir] PATCH: Fix stats overflow



On Mon, Nov 19, 2007 at 05:07:56AM +0100, Daniel Hokka Zakrisson wrote:
> Daniel P. Berrange wrote:
> > ...
> > +        if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) {
> > ...
> 
> Why not make that 1ULL?

  well honnestly I find the (unsigned long long) cast is good because it
makes the emphasis on the fact you must be careful to not use 1 directly,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


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