[Libvir] PATCH: Fix stats overflow

Daniel Veillard veillard at redhat.com
Mon Nov 19 10:43:51 UTC 2007


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 at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list