Re: RFC: do we want/need the "Ptr" typedefs for internal code ?

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

 



On 3/9/21 1:23 PM, Andrea Bolognani wrote:
On Tue, 2021-03-09 at 17:44 +0000, Daniel P. Berrangé wrote:
One of the conventions we have had since the early days of libvirt is
that every struct typedef, has a corresponding "Ptr" typedef too.

For example

     typedef struct _virDomainDef virDomainDef;
     typedef virDomainDef *virDomainDefPtr;

Periodically someone has questioned what the purpose of these Ptr
typedefs is, and we've not had an compelling answer, other than
that's what we've always done.

[...]

Does anyone have suggestions for how these "Ptr" typedefs are
benefiting libvirt ? Would anyone miss them ?

I consider them pointless obfuscation and would love to see them go.

Yep. I've never seen the point either (especially after we realized the problem with const pointers several years ago); I just followed along blindly because that was the convention and I figured *someone* must have a special place in their heart for them. I wouldn't bat an eye if they were removed.




[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