[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Various syntax-check fixes.



On 10/23/2009 07:01 AM, Chris Lalancette wrote:
> Make a pass over the syntax-check files, tightening up regex's,
> un-ignoring certain files, and cleaning things up.
> 
> Signed-off-by: Chris Lalancette <clalance redhat com>
> ---
>  .x-sc_prohibit_VIR_ERR_NO_MEMORY  |   13 +++++--------
>  .x-sc_prohibit_gethostby          |    5 ++---
>  .x-sc_prohibit_strcmp_and_strncmp |    7 +++++++
>  .x-sc_prohibit_strncpy            |    2 +-
>  .x-sc_require_config_h            |    1 -
>  Makefile.am                       |   14 ++++++++++++--
>  cfg.mk                            |    8 +++-----
>  7 files changed, 30 insertions(+), 20 deletions(-)
> 
> diff --git a/.x-sc_prohibit_VIR_ERR_NO_MEMORY b/.x-sc_prohibit_VIR_ERR_NO_MEMORY
> index fbefbeb..5c96e83 100644
> --- a/.x-sc_prohibit_VIR_ERR_NO_MEMORY
> +++ b/.x-sc_prohibit_VIR_ERR_NO_MEMORY
> @@ -1,8 +1,5 @@
> -ChangeLog
> -docs/devhelp/libvirt-virterror.html
> -docs/html/libvirt-virterror.html
> -docs/libvirt-api.xml
> -docs/libvirt-refs.xml
> -include/libvirt/virterror.h
> -daemon/dispatch.c
> -src/util/virterror.c
> +^ChangeLog$
> +^ChangeLog-old$
> +^include/libvirt/virterror\.h$
> +^daemon/dispatch\.c$
> +^src/util/virterror\.c$
> diff --git a/.x-sc_prohibit_gethostby b/.x-sc_prohibit_gethostby
> index c771142..7c052f4 100644
> --- a/.x-sc_prohibit_gethostby
> +++ b/.x-sc_prohibit_gethostby
> @@ -1,3 +1,2 @@
> -gnulib/lib/getaddrinfo.c
> -gnulib/m4/
> -src/xend_internal.c
> +^gnulib/lib/getaddrinfo\.c$
> +^gnulib/m4/
> diff --git a/.x-sc_prohibit_strcmp_and_strncmp b/.x-sc_prohibit_strcmp_and_strncmp
> index b7c456e..c0d8793 100644
> --- a/.x-sc_prohibit_strcmp_and_strncmp
> +++ b/.x-sc_prohibit_strcmp_and_strncmp
> @@ -1 +1,8 @@
>  ^gnulib/
> +^ChangeLog-old$
> +^examples/domain-events/events-c/event-test\.c$
> +^src/internal\.h$
> +^src/lxc/lxc_container\.c$
> +^src/node_device/node_device_devkit\.c$
> +^src/node_device/node_device_hal\.c$
> +^src/storage/parthelper\.c$
> diff --git a/.x-sc_prohibit_strncpy b/.x-sc_prohibit_strncpy
> index 10bc29c..70e2300 100644
> --- a/.x-sc_prohibit_strncpy
> +++ b/.x-sc_prohibit_strncpy
> @@ -1 +1 @@
> -src/util/util.c
> +^src/util/util\.c$
> diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h
> index e1f6e10..a530ae0 100644
> --- a/.x-sc_require_config_h
> +++ b/.x-sc_require_config_h
> @@ -1,5 +1,4 @@
>  ^examples/
>  ^gnulib/lib/dummy\.c$
>  ^gnulib/tests/dummy\.c$
> -^daemon/remote_protocol\.c$
>  ^ChangeLog$
> diff --git a/Makefile.am b/Makefile.am
> index 977ad0c..14fc593 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -17,12 +17,22 @@ EXTRA_DIST = \
>    mingw32-libvirt.spec.in \
>    libvirt.pc libvirt.pc.in \
>    autobuild.sh \
> +  .x-sc_avoid_ctype_macros \
>    .x-sc_avoid_if_before_free \
> -  .x-sc_require_config_h_first \
> +  .x-sc_avoid_write \
> +  .x-sc_m4_quote_check \
> +  .x-sc_prohibit_asprintf \
> +  .x-sc_prohibit_gethostby \
> +  .x-sc_prohibit_have_config_h \
> +  .x-sc_prohibit_HAVE_MBRTOWC \
> +  .x-sc_prohibit_nonreentrant \
>    .x-sc_prohibit_strcmp \
>    .x-sc_prohibit_strcmp_and_strncmp \
> +  .x-sc_prohibit_strncpy \
> +  .x-sc_prohibit_VIR_ERR_NO_MEMORY \
>    .x-sc_require_config_h \
> -  .x-sc_prohibit_nonreentrant \
> +  .x-sc_require_config_h_first \
> +  .x-sc_trailing_blank \
>    Makefile.nonreentrant \
>    autogen.sh \
>    examples/domain-events/events-python \
> diff --git a/cfg.mk b/cfg.mk
> index 44cfd17..c1d3864 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -79,11 +79,9 @@ sc_avoid_write:
>  # Use STREQ rather than comparing strcmp == 0, or != 0.
>  # Similarly, use STREQLEN or STRPREFIX rather than strncmp.
>  sc_prohibit_strcmp_and_strncmp:
> -	@grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *=='		\
> -	    $$($(VC_LIST_EXCEPT))					\
> -	  | grep -vE ':# *define STREQ(LEN)?\(' &&			\
> -	  { echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
> -		1>&2; exit 1; } || :
> +	@re='strn?cmp *\('						\
> +	msg='use STREQ() in place of the above uses of str[n]cmp'	\
> +	  $(_prohibit_regexp)
>  
>  # Use virAsprintf rather than a'sprintf since *strp is undefined on error.
>  sc_prohibit_asprintf:

ACK

- Cole


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]