[libvirt] Use gnulib's c-ctype.h; prohibit use of <ctype.h>

Jim Meyering jim at meyering.net
Fri May 9 12:39:06 UTC 2008


Jim Meyering <jim at meyering.net> wrote:
> Following up on this thread:
>
>   http://thread.gmane.org/gmane.comp.emulators.libvirt/6338/focus=6349
>
> This change removes all uses of ctype macros and ensures
> that no new ones will be added.
>
> The other changes I mentioned will come later.
>
>>From 3966a3ebaaacc14b4f330677fd2ed8f8546c6f4a Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Fri, 9 May 2008 12:55:29 +0200
> Subject: [PATCH] Use gnulib's c-ctype.h, not <ctype.h>.
...
> ---
>  Makefile.maint      |   16 +++++++++++++---
>  qemud/remote.c      |    1 -
>  src/buf.c           |    3 +--
>  src/nodeinfo.c      |   12 ++++++------
>  src/openvz_driver.c |    1 -
>  src/qemu_driver.c   |    4 ++--
>  src/sexpr.c         |    4 ++--
>  src/stats_linux.c   |    8 ++++----
>  src/util.c          |   15 ++++++---------
>  src/util.h          |    5 -----
>  src/virsh.c         |    8 ++++----
>  src/xend_internal.c |    1 -

I should mention that there is a prerequisite patch
to add the c-ctype module and pull in gnulib-related updates:

>From 105399f605ff7c4c7f5148f18ea08cb63c8c0411 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Fri, 9 May 2008 13:59:48 +0200
Subject: [PATCH] Prepare to use gnulib's c-type module.

* bootstrap: Move module list into separate variable w/less syntax.
(modules): Add c-ctype.
Update the following from gnulib:
* build-aux/useless-if-before-free:
* build-aux/vc-list-files:
* gnulib/lib/Makefile.am:
* gnulib/lib/getaddrinfo.h:
* gnulib/m4/gnulib-cache.m4:
* gnulib/m4/gnulib-comp.m4:
* gnulib/m4/inet_ntop.m4:
* gnulib/tests/Makefile.am:
* gnulib/tests/test-getaddrinfo.c:
---
 bootstrap                        |   25 ++++++++++++++++------
 build-aux/useless-if-before-free |    6 ++--
 build-aux/vc-list-files          |    4 +-
 gnulib/lib/Makefile.am           |   14 ++++++------
 gnulib/lib/dummy.c               |   42 --------------------------------------
 gnulib/lib/getaddrinfo.h         |   10 ++++++++-
 gnulib/m4/gnulib-cache.m4        |    4 +-
 gnulib/m4/gnulib-comp.m4         |    8 ++++++-
 gnulib/m4/inet_ntop.m4           |    5 +++-
 gnulib/tests/Makefile.am         |   18 ++++++++++++++++
 gnulib/tests/test-getaddrinfo.c  |    1 +
 11 files changed, 71 insertions(+), 66 deletions(-)
 delete mode 100644 gnulib/lib/dummy.c

diff --git a/bootstrap b/bootstrap
index 087b98d..acce4e8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -64,6 +64,23 @@ esac
 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
 <$gnulib_tool || exit

+modules='
+c-ctype
+getaddrinfo
+getpass
+gettext
+mktempd
+physmem
+poll
+posix-shell
+strndup
+strsep
+sys_stat
+useless-if-before-free
+vasprintf
+vc-list-files
+'
+
 # Tell gnulib to:
 #   require LGPLv2+
 #   put *.m4 files in new gnulib/m4/ dir
@@ -75,13 +92,7 @@ $gnulib_tool			\
   --m4-base=gnulib/m4		\
   --source-base=gnulib/lib	\
   --tests-base=gnulib/tests	\
-  --import physmem getaddrinfo  \
-    sys_stat vasprintf strndup  \
-    strsep poll gettext getpass \
-    useless-if-before-free      \
-    posix-shell                 \
-    mktempd                     \
-    vc-list-files
+  --import $modules

 rm -f				\
     .gitignore			\
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 4603c6c..48f55c6 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -2,7 +2,7 @@
 # Detect instances of "if (p) free (p);".
 # Likewise for "if (p != NULL) free (p);".  And with braces.

-my $VERSION = '2008-04-29 19:56'; # UTC
+my $VERSION = '2008-05-01 19:11'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -68,8 +68,8 @@ OPTIONS:

 Exit status:

-  0   no match
-  1   one or more matches
+  0   one or more matches
+  1   no match
   2   an error

 EXAMPLE:
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index abb0c40..8ca4530 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -2,7 +2,7 @@
 # List version-controlled file names.

 # Print a version string.
-scriptversion=2008-04-30.12
+scriptversion=2008-05-01.10

 # Copyright (C) 2006-2008 Free Software Foundation, Inc.

@@ -91,7 +91,7 @@ elif test -d CVS; then
 	  sub(/CVS\/Entries/, "", f);	\
 	  print f $2;			\
 	}}'\''				\
-      $(find "$dir" -name Entries -print) /dev/null' $postprocess
+      `find "$dir" -name Entries -print` /dev/null' $postprocess
   fi
 else
   echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
...




More information about the libvir-list mailing list