[PATCH weston v2 2/4] Moved helper macro to a discrete include file.

Pekka Paalanen ppaalanen at gmail.com
Tue Jun 16 02:48:50 PDT 2015


On Mon, 15 Jun 2015 15:37:08 -0700
"Jon A. Cruz" <jonc at osg.samsung.com> wrote:

> To help reduce code duplication and also 'kitchen-sink' includes
> the ARRAY_LENGTH macro was moved to a stand-alone file and
> referenced from the sources consuming it. Other macros will be
> added in subsequent passes.
> 
> Signed-off-by: Jon A. Cruz <jonc at osg.samsung.com>
> ---
>  Makefile.am                        |  1 +

>  37 files changed, 83 insertions(+), 19 deletions(-)
>  create mode 100644 shared/helpers.h
> 
> diff --git a/Makefile.am b/Makefile.am
> index 5819b19..261798c 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -189,6 +189,7 @@ westoninclude_HEADERS =				\
>  	src/timeline-object.h			\
>  	shared/matrix.h				\
>  	shared/config-parser.h			\
> +	shared/helpers.h			\
>  	shared/zalloc.h				\
>  	shared/platform.h

Hi,

now that helpers.h is installed, it probably shouldn't contain
plain-named things like ARRAY_LENGTH, MIN, or container_of. This will
be even more important in the future with libweston. Rather than put
those in a namespace and modify a ton of code, I'd rather see this file
not installed.

You also forgot to update all SOURCES variables in Makefile.am for this
new source file.

> diff --git a/shared/helpers.h b/shared/helpers.h
> new file mode 100644
> index 0000000..7502ff3
> --- /dev/null
> +++ b/shared/helpers.h
> @@ -0,0 +1,48 @@
> +/*
> + * Copyright © 2015 Samsung Electronics Co., Ltd
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining
> + * a copy of this software and associated documentation files (the
> + * "Software"), to deal in the Software without restriction, including
> + * without limitation the rights to use, copy, modify, merge, publish,
> + * distribute, sublicense, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> +  *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
> + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
> + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
> + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> + * SOFTWARE.
> + */

This license text is incomplete now that the license series has landed.


Thanks,
pq


More information about the wayland-devel mailing list