Re: [PATCH] docs: Format bit shift notation for bitwise flag enums

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

 



On Thu, Jan 24, 2019 at 03:43:15PM +0100, Peter Krempa wrote:
> Big number itself does not make much sense in some cases. Format the
> bitshift format as well.
> 
> Changes our web page docs from:
> 
> VIR_MIGRATE_POSTCOPY = 32768 : Setting the VIR_MIGRATE_POSTCOPY...
> VIR_MIGRATE_TLS      = 65536 : Setting the VIR_MIGRATE_TLS flag...
> 
> to:
> 
> VIR_MIGRATE_POSTCOPY = 32768 (1<<15) : Setting the VIR_MIGRATE_POSTCOPY...
> VIR_MIGRATE_TLS      = 65536 (1<<16) : Setting the VIR_MIGRATE_TLS flag...

I tend to question why we are reporting the value in the docs at all.

The whole point of enums/constants is that developers should never care
about the actual. They should exclusively use the names.

So if anything I'd suggest we remove the existing numbers from the docs,
instead of adding the bitshift values.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux