]> git.ipfire.org Git - thirdparty/libvirt.git/commit
docs: hacking: Add good practices for shortening conditional expressions
authorPeter Krempa <pkrempa@redhat.com>
Thu, 9 May 2019 10:20:42 +0000 (12:20 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 22 May 2019 12:46:29 +0000 (14:46 +0200)
commit27dfb0280ff87f61978befc1f7dd72b7d3ab93d9
tree2edc6823115b81cf346080f255706b50963758e8
parentbe432131ee66401bff275c66b44fe4c631b57a01
docs: hacking: Add good practices for shortening conditional expressions

Document that checking if a integer is (non-)zero should (not must)
avoid the shortened form that C allows as it may confuse readers into
overlooking the other possible values which might be interresting to
handle.

While pointers have distinct values from the point of view of the code
we only care whether it's non-NULL and thus it's documented it's okay
to shorten those.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Eric Blake <eblake@redhat.com>
docs/hacking.html.in