[PATCH] coding-style: Don't encourage virXXXPtr typedefs

Michal Privoznik posted 1 patch 3 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/112f6fe12ceb7a859ac5564cc2512d1383bfd0d4.1615837222.git.mprivozn@redhat.com
docs/coding-style.rst | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
[PATCH] coding-style: Don't encourage virXXXPtr typedefs
Posted by Michal Privoznik 3 years, 1 month ago
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>
---
 docs/coding-style.rst | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/docs/coding-style.rst b/docs/coding-style.rst
index 22de86a657..470c61860f 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;
 
-- 
2.26.2