On Mon,  2 May 2016 22:40:15 +0100
Emmanuel Gil Peyrot <[email protected]> wrote:

> Makes it clearer that they don’t use any field specific to drm_output,
> and reduce the amount of churn from the following commits.
> 
> Signed-off-by: Emmanuel Gil Peyrot <[email protected]>
> ---
>  src/compositor-drm.c | 48 ++++++++++++++++++++++++------------------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 5938d53..1edcaab 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -232,7 +232,7 @@ static void
>  drm_output_set_cursor(struct drm_output *output);
>  
>  static void
> -drm_output_update_msc(struct drm_output *output, unsigned int seq);
> +drm_output_update_msc(struct weston_output *output_base, unsigned int seq);

Hi,

if you change the argument type, then you should also change the
function name. It would be odd for a function be named
drm_output_something() and not even take one as an argument.

Our convention for "object-oriented C" favours the naming scheme:
<class>_<method>(class *this, args...)

I think it's a nice convention in general, but there are cases where it
is awkward, like weston_view_from_global_float() I talked about with
Daniel recently.

Of course, it would be somewhat off to have a DRM-dpecific
weston_output_update_msc() in compositor-drm.c. In this particular case
I would just keep it as is.

> @@ -1367,17 +1367,17 @@ drm_output_destroy(struct weston_output *output_base)
>   * @returns Pointer to a mode from the output's mode list
>   */
>  static struct drm_mode *
> -choose_mode (struct drm_output *output, struct weston_mode *target_mode)
> +choose_mode (struct weston_output *output_base, struct weston_mode 
> *target_mode)

This one does use drm-specific fields of struct drm_mode, and those are
only applicable with a drm_output kind of weston_output. It doesn't
change much code-wise, and I'd prefer to leave it as is, if not renamed
to drm_output_choose_mode().


Thanks,
pq

Attachment: pgp7w_KXdlL7M.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to