diff options
author | Jim Meyering <meyering@redhat.com> | 2009-09-24 10:59:01 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-09-24 11:00:44 +0200 |
commit | 6a14f1c2502f58ff7bed8cb451f95a83f5ee920a (patch) | |
tree | 975cb6488e6413dab5aece9fcf1aee5a595381ac /daemon | |
parent | 0ca36888c6975ffa7e03df11bf8ded42156939c7 (diff) | |
download | libguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.tar.gz libguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.tar.xz libguestfs-6a14f1c2502f58ff7bed8cb451f95a83f5ee920a.zip |
avoid use of all ctype macros
* cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros.
* fish/tilde.c: Remove unnecessary inclusion of ctype.h.
* bootstrap: Add gnulib's c-ctype module to the list.
* daemon/m4/gnulib-cache.m4: Likewise.
* daemon/ext2.c: Include "c-ctype.h", not <ctype.h>.
Use c_isspace, etc, rather than isspace.
* daemon/guestfsd.c: Likewise.
* daemon/lvm.c: Likewise.
* daemon/proto.c: Likewise.
* fish/fish.c: Likewise.
* fish/tilde.c: Likewise.
* src/generator.ml: Likewise.
* src/guestfs.c: Likewise.
* examples/to-xml.c: Likewise.
* examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib
so inclusion of "c-ctype.h" works.
(to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/ext2.c | 8 | ||||
-rw-r--r-- | daemon/guestfsd.c | 4 | ||||
-rw-r--r-- | daemon/lvm.c | 6 | ||||
-rw-r--r-- | daemon/m4/gnulib-cache.m4 | 3 | ||||
-rw-r--r-- | daemon/proto.c | 4 |
5 files changed, 13 insertions, 12 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c index a26891b0..0021a065 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -21,10 +21,10 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <ctype.h> #include "../src/guestfs_protocol.h" #include "daemon.h" +#include "c-ctype.h" #include "actions.h" char ** @@ -72,7 +72,7 @@ do_tune2fs_l (const char *device) if (colon) { *colon = '\0'; - do { colon++; } while (*colon && isspace (*colon)); + do { colon++; } while (*colon && c_isspace (*colon)); if (add_string (&ret, &size, &alloc, p) == -1) { free (out); @@ -202,7 +202,7 @@ do_get_e2uuid (const char *device) } p += 17; - while (*p && isspace (*p)) + while (*p && c_isspace (*p)) p++; if (!*p) { reply_with_error ("malformed Filesystem UUID in the output of tune2fs -l"); @@ -212,7 +212,7 @@ do_get_e2uuid (const char *device) /* Now 'p' hopefully points to the start of the UUID. */ q = p; - while (*q && (isxdigit (*q) || *q == '-')) + while (*q && (c_isxdigit (*q) || *q == '-')) q++; if (!*q) { reply_with_error ("malformed Filesystem UUID in the output of tune2fs -l"); diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index e3b8883e..8c39c39c 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -34,10 +34,10 @@ #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> -#include <ctype.h> #include <signal.h> #include <printf.h> +#include "c-ctype.h" #include "daemon.h" static char *read_cmdline (void); @@ -835,7 +835,7 @@ print_shell_quote (FILE *stream, const struct printf_info *info ATTRIBUTE_UNUSED, const void *const *args) { -#define SAFE(c) (isalnum((c)) || \ +#define SAFE(c) (c_isalnum((c)) || \ (c) == '/' || (c) == '-' || (c) == '_' || (c) == '.') int i, len; const char *str = *((const char **) (args[0])); diff --git a/daemon/lvm.c b/daemon/lvm.c index 742b40ba..9865bb23 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -22,9 +22,9 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <ctype.h> #include "daemon.h" +#include "c-ctype.h" #include "actions.h" /* LVM actions. Keep an eye on liblvm, although at the time @@ -49,12 +49,12 @@ convert_lvm_output (char *out, const char *prefix) pend++; } - while (*p && isspace (*p)) /* Skip any leading whitespace. */ + while (*p && c_isspace (*p)) /* Skip any leading whitespace. */ p++; /* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */ len = strlen (p)-1; - while (*p && isspace (p[len])) + while (*p && c_isspace (p[len])) p[len--] = '\0'; if (!*p) { /* Empty line? Skip it. */ diff --git a/daemon/m4/gnulib-cache.m4 b/daemon/m4/gnulib-cache.m4 index bd6cf61d..df69113a 100644 --- a/daemon/m4/gnulib-cache.m4 +++ b/daemon/m4/gnulib-cache.m4 @@ -15,11 +15,12 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl hash ignore-value manywarnings warnings +# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=gl c-ctype hash ignore-value manywarnings warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ + c-ctype hash ignore-value manywarnings diff --git a/daemon/proto.c b/daemon/proto.c index c22bbee4..a0d3736a 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -24,11 +24,11 @@ #include <string.h> #include <unistd.h> #include <errno.h> -#include <ctype.h> #include <sys/param.h> /* defines MIN */ #include <rpc/types.h> #include <rpc/xdr.h> +#include "c-ctype.h" #include "ignore-value.h" #include "daemon.h" @@ -96,7 +96,7 @@ main_loop (int _sock) printf (" "); printf ("|"); for (j = i; j < MIN (i+16, len); ++j) - if (isprint (buf[j])) + if (c_isprint (buf[j])) printf ("%c", buf[j]); else printf ("."); |