提交 caab1fbd 编写于 作者: P Pavel Hrdina

use g_ascii_isspace instead of c_isspace from gnulib

Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 04d267d3
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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';
}
......
......@@ -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;
}
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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)
......
......@@ -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)
......
......@@ -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++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册