]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
coding-style: Don't encourage virXXXPtr typedefs
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Mar 2021 17:49:45 +0000 (18:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 16 Mar 2021 08:15:40 +0000 (09:15 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/coding-style.rst

index c43d20c7b27402b16be52aca1fe8b879b13c1c82..19055e43abe3b3adf9cba6b73fd0a9ee86ff5898 100644 (file)
@@ -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;