[vlc-devel] [PATCH 03/14] input: name input event structs
thomas at gllm.fr
Mon Aug 20 11:13:52 CEST 2018
On Mon, Aug 20, 2018, at 11:01, Romain Vimont wrote:
> On Thu, Aug 16, 2018 at 09:54:08PM +0300, Rémi Denis-Courmont wrote:
> > Le torstaina 16. elokuuta 2018, 17.02.00 EEST Romain Vimont a écrit :
> > > Some input event structs contain enums, whose values can be accessed
> > > globally in C, but need a qualified access in C++. Since these enums are
> > > defined inside unamed union and structs, there was no way to use them
> > > from C++ code.
> > >
> > > To avoid the problem, declare named structs for every event type
> > > requiring more than one field.
> > I would have thought more natural to take the enums out.
> I prefer to extract the structs, so that we can refer to a specific
> event type without passing the whole union.
+1. If you handle each events in separate functions. I find it better to pass the corresponding struct than the whole event to such functions.
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel