From: Michal Privoznik Date: Mon, 15 Mar 2021 17:49:45 +0000 (+0100) Subject: coding-style: Don't encourage virXXXPtr typedefs X-Git-Tag: v7.2.0-rc1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ccbed6afbba856805483a719e5b5862cc38cb55;p=thirdparty%2Flibvirt.git coding-style: Don't encourage virXXXPtr typedefs We don't like virXXXPtr typedefs really and they are going away shortly, possibly. Do not encourage new code to put in the typedefs. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/docs/coding-style.rst b/docs/coding-style.rst index c43d20c7b2..19055e43ab 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -53,13 +53,10 @@ Struct type names All structs should have a 'vir' prefix in their typedef name, and each following word should have its first letter in uppercase. The struct name should be the same as the typedef - name with a leading underscore. A second typedef should be - given for a pointer to the struct with a 'Ptr' suffix. - + name with a leading underscore. :: typedef struct _virHashTable virHashTable; - typedef virHashTable *virHashTablePtr; struct _virHashTable { ... }; @@ -426,11 +423,11 @@ Conditional expressions For readability reasons new code should avoid shortening comparisons to 0 for numeric types. Boolean and pointer -comparisions may be shortened. All long forms are okay: +comparisons may be shortened. All long forms are okay: :: - virFooPtr foos = NULL; + virFoo *foos = NULL; size nfoos = 0; bool hasFoos = false;