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 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.

Note that I'm not talking just about humans either: some tooling also
struggles a bit with the additional layer of indirection.

-- 
Andrea Bolognani / Red Hat / Virtualization




[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