]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
use g_ascii_isspace instead of c_isspace from gnulib
authorPavel Hrdina <phrdina@redhat.com>
Mon, 18 Nov 2019 14:10:02 +0000 (15:10 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 10 Dec 2019 12:49:24 +0000 (13:49 +0100)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/bhyve/bhyve_parse_command.c
src/conf/nwfilter_conf.c
src/interface/interface_backend_udev.c
src/rpc/virnetsocket.c
src/util/virhostcpu.c
src/util/virnetdevvportprofile.c
src/util/virpidfile.c
src/util/virstoragefile.c
src/util/virstring.c
src/util/viruuid.c

index 050a558cee4d6ddb85cf0e1d52aac622378fad1d..5eec05c7d40242e413a4c7ef23b1239c94fa7fbf 100644 (file)
@@ -31,7 +31,6 @@
 #include "virlog.h"
 #include "virstring.h"
 #include "virutil.h"
-#include "c-ctype.h"
 
 #define VIR_FROM_THIS VIR_FROM_BHYVE
 
@@ -212,7 +211,7 @@ bhyveCommandLineToArgv(const char *nativeConfig,
             arglist[args_count++] = arg;
             arglist[args_count] = NULL;
 
-            while (next && c_isspace(*next))
+            while (next && g_ascii_isspace(*next))
                 next++;
 
             curr = next;
index 6c7b85d4c8d67b8c985ecbbf038053f317afc4a7..5bcf52a84c2f71c53bd955d11417975263354b01 100644 (file)
@@ -42,7 +42,6 @@
 #include "nwfilter_params.h"
 #include "nwfilter_conf.h"
 #include "domain_conf.h"
-#include "c-ctype.h"
 #include "virfile.h"
 #include "virstring.h"
 
@@ -775,7 +774,7 @@ parseStringItems(const struct int_map *int_map,
     i = 0;
     while (input[i]) {
         found = false;
-        while (c_isspace(input[i]) || input[i] == sep)
+        while (g_ascii_isspace(input[i]) || input[i] == sep)
             i++;
         if (!input[i])
             break;
index 29d91d3539d56cefd6427fa51af048c3a972d460..7df5cf2cc32f849cd6d7d8aa78b4c83a6877a418 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "virerror.h"
 #include "virfile.h"
-#include "c-ctype.h"
 #include "datatypes.h"
 #include "domain_conf.h"
 #include "interface_driver.h"
@@ -932,7 +931,7 @@ udevGetIfaceDefVlan(struct udev *udev G_GNUC_UNUSED,
     vid_pos += strlen(vid_prefix);
 
     if ((vid_len = strspn(vid_pos, "0123456789")) == 0 ||
-        !c_isspace(vid_pos[vid_len])) {
+        !g_ascii_isspace(vid_pos[vid_len])) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("failed to find the VID for the VLAN device '%s'"),
                        name);
index 21ef7a803463329ac475644ba208f7c2afbb76f3..b98287e6d7cdf886f482e5bf00303c5f60cf511e 100644 (file)
@@ -40,7 +40,6 @@
 # include <sys/ucred.h>
 #endif
 
-#include "c-ctype.h"
 #ifdef WITH_SELINUX
 # include <selinux/selinux.h>
 #endif
@@ -1813,7 +1812,7 @@ static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len)
         errout != NULL) {
         size_t elen = strlen(errout);
         /* remove trailing whitespace */
-        while (elen && c_isspace(errout[elen - 1]))
+        while (elen && g_ascii_isspace(errout[elen - 1]))
             errout[--elen] = '\0';
     }
 
index a3ef067f41b0ffe895b4cbc1e3c0d0c8f52fe7c5..22102f2c75803de3197d4069afc6e5ee616917a7 100644 (file)
@@ -38,7 +38,6 @@
 # include <sys/resource.h>
 #endif
 
-#include "c-ctype.h"
 #include "viralloc.h"
 #define LIBVIRT_VIRHOSTCPUPRIV_H_ALLOW
 #include "virhostcpupriv.h"
@@ -512,7 +511,7 @@ virHostCPUParseFrequencyString(const char *str,
     str += strlen(prefix);
 
     /* Skip all whitespace */
-    while (c_isspace(*str))
+    while (g_ascii_isspace(*str))
         str++;
     if (*str == '\0')
         goto error;
@@ -524,7 +523,7 @@ virHostCPUParseFrequencyString(const char *str,
     str++;
 
     /* Skip all whitespace */
-    while (c_isspace(*str))
+    while (g_ascii_isspace(*str))
         str++;
     if (*str == '\0')
         goto error;
@@ -533,7 +532,7 @@ virHostCPUParseFrequencyString(const char *str,
      * followed by a fractional part (which gets discarded) or some
      * leading whitespace */
     if (virStrToLong_ui(str, &p, 10, &ui) < 0 ||
-        (*p != '.' && *p != '\0' && !c_isspace(*p))) {
+        (*p != '.' && *p != '\0' && !g_ascii_isspace(*p))) {
         goto error;
     }
 
index 593bd6e2d64b31fbaca30cabd0dbf1a736c79cda..c5db49b9325dd67b5216f620962cdaa460a50acc 100644 (file)
@@ -49,7 +49,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
 #if WITH_VIRTUALPORT
 
 # include <fcntl.h>
-# include <c-ctype.h>
 # include <sys/socket.h>
 # include <sys/ioctl.h>
 
@@ -482,7 +481,7 @@ virNetDevVPortProfileGetLldpadPid(void)
             char *endptr;
 
             if (virStrToLong_ui(buffer, &endptr, 10, &res) == 0
-                && (*endptr == '\0' || c_isspace(*endptr))
+                && (*endptr == '\0' || g_ascii_isspace(*endptr))
                 && res != 0) {
                 pid = res;
             } else {
index a825a23e49e5467aeb4a9f78f2ba92e037177428..249515aff2dc306e00bcd805da0a0d27bca400cd 100644 (file)
@@ -34,7 +34,6 @@
 #include "intprops.h"
 #include "virlog.h"
 #include "virerror.h"
-#include "c-ctype.h"
 #include "virstring.h"
 #include "virprocess.h"
 
@@ -130,7 +129,7 @@ int virPidFileReadPath(const char *path,
     pidstr[bytes] = '\0';
 
     if (virStrToLong_ll(pidstr, &endptr, 10, &pid_value) < 0 ||
-        !(*endptr == '\0' || c_isspace(*endptr)) ||
+        !(*endptr == '\0' || g_ascii_isspace(*endptr)) ||
         (pid_t) pid_value != pid_value) {
         rc = -1;
         goto cleanup;
index 77f885ef1d1d9201b661db0a0675dce77170f32d..5e371694d1ea7a9adae743331e099cd96dda49a6 100644 (file)
@@ -30,7 +30,6 @@
 #include "virerror.h"
 #include "virlog.h"
 #include "virfile.h"
-#include "c-ctype.h"
 #include "vircommand.h"
 #include "virhash.h"
 #include "virendian.h"
@@ -1376,7 +1375,7 @@ int virStorageFileGetLVMKey(const char *path,
         char *tmp = *key;
 
         /* Find first non-space character */
-        while (*tmp && c_isspace(*tmp))
+        while (*tmp && g_ascii_isspace(*tmp))
             tmp++;
         /* Kill leading spaces */
         if (tmp != *key)
index a66b4062989d9d3d0a7305a0fc1d890c7eb000a8..311c9058db7c0d99802d30bd8a9b7f0b2e96dfe1 100644 (file)
@@ -794,7 +794,7 @@ virSkipSpaces(const char **str)
 {
     const char *cur = *str;
 
-    while (c_isspace(*cur))
+    while (g_ascii_isspace(*cur))
         cur++;
     *str = cur;
 }
@@ -811,7 +811,7 @@ virSkipSpacesAndBackslash(const char **str)
 {
     const char *cur = *str;
 
-    while (c_isspace(*cur) || *cur == '\\')
+    while (g_ascii_isspace(*cur) || *cur == '\\')
         cur++;
     *str = cur;
 }
@@ -840,7 +840,7 @@ virTrimSpaces(char *str, char **endp)
         end = str + strlen(str);
     else
         end = *endp;
-    while (end > str && c_isspace(end[-1]))
+    while (end > str && g_ascii_isspace(end[-1]))
         end--;
     if (endp) {
         if (!*endp)
index 7626d72c2379e3f8191ec36e9c4a3db9a9156d72..835c8733008a642d53222cb459907db26406f21c 100644 (file)
@@ -102,7 +102,7 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
      * 32 hexadecimal digits the end.
      */
     cur = uuidstr;
-    while (c_isspace(*cur))
+    while (g_ascii_isspace(*cur))
         cur++;
 
     for (i = 0; i < VIR_UUID_BUFLEN;) {
@@ -128,7 +128,7 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
     }
 
     while (*cur) {
-        if (!c_isspace(*cur))
+        if (!g_ascii_isspace(*cur))
             goto error;
         cur++;
     }