[PATCH weston v1 07/17] tests-helper: distil the functionality from handlers

Derek Foreman derekf at osg.samsung.com
Tue Dec 9 12:36:40 PST 2014


Distill has 2 ls...

On 05/12/14 07:36 AM, Marek Chalupa wrote:
> Split out the real code from event handlers (like pointer_handle_motion,
> etc.) and put it into standalone function. We'll use it in follow-up
> patch where we will register handlers for toytoolkit clients and we'll
> use the new functions so that the code won't be duplicated.
> 
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  tests/weston-test-client-helper.c | 170 +++++++++++++++++++++++++++++---------
>  1 file changed, 130 insertions(+), 40 deletions(-)
> 
...

> +
> +static void
> +store_keyboard_modifiers(struct keyboard *keyboard, uint32_t mods_depressed,
> +			  uint32_t mods_latched, uint32_t mods_locked,
> +			  uint32_t group)
> +{
>  	keyboard->mods_depressed = mods_depressed;
>  	keyboard->mods_latched = mods_latched;
>  	keyboard->mods_locked = mods_locked;
>  	keyboard->group = group;
>  
> -	fprintf(stderr, "test-client: got keyboard modifiers %u %u %u %u\n",
> +	fprintf(stderr, "test-client: got keyboard modifiers %x %x %x %x\n",
>  		mods_depressed, mods_latched, mods_locked, group);
>  }

I personally prefer 0x%x to %x on the off chance something comes up that
could be decimal.  It can be confusing.

Is this change an important part of the patch?


More information about the wayland-devel mailing list