Varible naming convention (Re: [PATCH 2/2] input: define two variable conventions for input types)
ppaalanen at gmail.com
Tue Dec 13 23:45:19 PST 2011
On Tue, 13 Dec 2011 15:00:31 -0500
Kristian Høgsberg <krh at bitplanet.net> wrote:
> Third, the proposed names are awful and there is a convention already.
> In general, the code convention in place doesn't use arbitrary
> abbreviations like "dev" but tries to use the most meaningful noun
> from the type name; for example, wlsc_input_device becomes 'device',
> wlsc_surface becomes 'surface', wlsc_data_source becomes 'source' etc.
> In cases where we have several variables referring to the same object
> as different types (wlsc_output and x11_output) we always use the most
> sub-classed type (ie x11_output *output) and refer to base class
> fields through this (eg output->base.compositor). The base type in
> this case is called base_output. See x11_output_prepare_render() for
> a full example.
Thanks for spelling it out, I didn't know there was a convention. I
will try to adhere to it from now on.
More information about the wayland-devel