mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 22:05:47 +00:00
use g_ascii_isspace instead of c_isspace from gnulib
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
04d267d347
commit
caab1fbd67
@ -31,7 +31,6 @@
|
|||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_BHYVE
|
#define VIR_FROM_THIS VIR_FROM_BHYVE
|
||||||
|
|
||||||
@ -212,7 +211,7 @@ bhyveCommandLineToArgv(const char *nativeConfig,
|
|||||||
arglist[args_count++] = arg;
|
arglist[args_count++] = arg;
|
||||||
arglist[args_count] = NULL;
|
arglist[args_count] = NULL;
|
||||||
|
|
||||||
while (next && c_isspace(*next))
|
while (next && g_ascii_isspace(*next))
|
||||||
next++;
|
next++;
|
||||||
|
|
||||||
curr = next;
|
curr = next;
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "nwfilter_params.h"
|
#include "nwfilter_params.h"
|
||||||
#include "nwfilter_conf.h"
|
#include "nwfilter_conf.h"
|
||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
|
|
||||||
@ -775,7 +774,7 @@ parseStringItems(const struct int_map *int_map,
|
|||||||
i = 0;
|
i = 0;
|
||||||
while (input[i]) {
|
while (input[i]) {
|
||||||
found = false;
|
found = false;
|
||||||
while (c_isspace(input[i]) || input[i] == sep)
|
while (g_ascii_isspace(input[i]) || input[i] == sep)
|
||||||
i++;
|
i++;
|
||||||
if (!input[i])
|
if (!input[i])
|
||||||
break;
|
break;
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "domain_conf.h"
|
#include "domain_conf.h"
|
||||||
#include "interface_driver.h"
|
#include "interface_driver.h"
|
||||||
@ -932,7 +931,7 @@ udevGetIfaceDefVlan(struct udev *udev G_GNUC_UNUSED,
|
|||||||
vid_pos += strlen(vid_prefix);
|
vid_pos += strlen(vid_prefix);
|
||||||
|
|
||||||
if ((vid_len = strspn(vid_pos, "0123456789")) == 0 ||
|
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,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to find the VID for the VLAN device '%s'"),
|
_("failed to find the VID for the VLAN device '%s'"),
|
||||||
name);
|
name);
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
# include <sys/ucred.h>
|
# include <sys/ucred.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "c-ctype.h"
|
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
# include <selinux/selinux.h>
|
# include <selinux/selinux.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1813,7 +1812,7 @@ static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len)
|
|||||||
errout != NULL) {
|
errout != NULL) {
|
||||||
size_t elen = strlen(errout);
|
size_t elen = strlen(errout);
|
||||||
/* remove trailing whitespace */
|
/* remove trailing whitespace */
|
||||||
while (elen && c_isspace(errout[elen - 1]))
|
while (elen && g_ascii_isspace(errout[elen - 1]))
|
||||||
errout[--elen] = '\0';
|
errout[--elen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
# include <sys/resource.h>
|
# include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#define LIBVIRT_VIRHOSTCPUPRIV_H_ALLOW
|
#define LIBVIRT_VIRHOSTCPUPRIV_H_ALLOW
|
||||||
#include "virhostcpupriv.h"
|
#include "virhostcpupriv.h"
|
||||||
@ -512,7 +511,7 @@ virHostCPUParseFrequencyString(const char *str,
|
|||||||
str += strlen(prefix);
|
str += strlen(prefix);
|
||||||
|
|
||||||
/* Skip all whitespace */
|
/* Skip all whitespace */
|
||||||
while (c_isspace(*str))
|
while (g_ascii_isspace(*str))
|
||||||
str++;
|
str++;
|
||||||
if (*str == '\0')
|
if (*str == '\0')
|
||||||
goto error;
|
goto error;
|
||||||
@ -524,7 +523,7 @@ virHostCPUParseFrequencyString(const char *str,
|
|||||||
str++;
|
str++;
|
||||||
|
|
||||||
/* Skip all whitespace */
|
/* Skip all whitespace */
|
||||||
while (c_isspace(*str))
|
while (g_ascii_isspace(*str))
|
||||||
str++;
|
str++;
|
||||||
if (*str == '\0')
|
if (*str == '\0')
|
||||||
goto error;
|
goto error;
|
||||||
@ -533,7 +532,7 @@ virHostCPUParseFrequencyString(const char *str,
|
|||||||
* followed by a fractional part (which gets discarded) or some
|
* followed by a fractional part (which gets discarded) or some
|
||||||
* leading whitespace */
|
* leading whitespace */
|
||||||
if (virStrToLong_ui(str, &p, 10, &ui) < 0 ||
|
if (virStrToLong_ui(str, &p, 10, &ui) < 0 ||
|
||||||
(*p != '.' && *p != '\0' && !c_isspace(*p))) {
|
(*p != '.' && *p != '\0' && !g_ascii_isspace(*p))) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
|
|||||||
#if WITH_VIRTUALPORT
|
#if WITH_VIRTUALPORT
|
||||||
|
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
# include <c-ctype.h>
|
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
|
||||||
@ -482,7 +481,7 @@ virNetDevVPortProfileGetLldpadPid(void)
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
|
|
||||||
if (virStrToLong_ui(buffer, &endptr, 10, &res) == 0
|
if (virStrToLong_ui(buffer, &endptr, 10, &res) == 0
|
||||||
&& (*endptr == '\0' || c_isspace(*endptr))
|
&& (*endptr == '\0' || g_ascii_isspace(*endptr))
|
||||||
&& res != 0) {
|
&& res != 0) {
|
||||||
pid = res;
|
pid = res;
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "intprops.h"
|
#include "intprops.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
|
|
||||||
@ -130,7 +129,7 @@ int virPidFileReadPath(const char *path,
|
|||||||
pidstr[bytes] = '\0';
|
pidstr[bytes] = '\0';
|
||||||
|
|
||||||
if (virStrToLong_ll(pidstr, &endptr, 10, &pid_value) < 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) {
|
(pid_t) pid_value != pid_value) {
|
||||||
rc = -1;
|
rc = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "vircommand.h"
|
#include "vircommand.h"
|
||||||
#include "virhash.h"
|
#include "virhash.h"
|
||||||
#include "virendian.h"
|
#include "virendian.h"
|
||||||
@ -1376,7 +1375,7 @@ int virStorageFileGetLVMKey(const char *path,
|
|||||||
char *tmp = *key;
|
char *tmp = *key;
|
||||||
|
|
||||||
/* Find first non-space character */
|
/* Find first non-space character */
|
||||||
while (*tmp && c_isspace(*tmp))
|
while (*tmp && g_ascii_isspace(*tmp))
|
||||||
tmp++;
|
tmp++;
|
||||||
/* Kill leading spaces */
|
/* Kill leading spaces */
|
||||||
if (tmp != *key)
|
if (tmp != *key)
|
||||||
|
@ -794,7 +794,7 @@ virSkipSpaces(const char **str)
|
|||||||
{
|
{
|
||||||
const char *cur = *str;
|
const char *cur = *str;
|
||||||
|
|
||||||
while (c_isspace(*cur))
|
while (g_ascii_isspace(*cur))
|
||||||
cur++;
|
cur++;
|
||||||
*str = cur;
|
*str = cur;
|
||||||
}
|
}
|
||||||
@ -811,7 +811,7 @@ virSkipSpacesAndBackslash(const char **str)
|
|||||||
{
|
{
|
||||||
const char *cur = *str;
|
const char *cur = *str;
|
||||||
|
|
||||||
while (c_isspace(*cur) || *cur == '\\')
|
while (g_ascii_isspace(*cur) || *cur == '\\')
|
||||||
cur++;
|
cur++;
|
||||||
*str = cur;
|
*str = cur;
|
||||||
}
|
}
|
||||||
@ -840,7 +840,7 @@ virTrimSpaces(char *str, char **endp)
|
|||||||
end = str + strlen(str);
|
end = str + strlen(str);
|
||||||
else
|
else
|
||||||
end = *endp;
|
end = *endp;
|
||||||
while (end > str && c_isspace(end[-1]))
|
while (end > str && g_ascii_isspace(end[-1]))
|
||||||
end--;
|
end--;
|
||||||
if (endp) {
|
if (endp) {
|
||||||
if (!*endp)
|
if (!*endp)
|
||||||
|
@ -102,7 +102,7 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
|
|||||||
* 32 hexadecimal digits the end.
|
* 32 hexadecimal digits the end.
|
||||||
*/
|
*/
|
||||||
cur = uuidstr;
|
cur = uuidstr;
|
||||||
while (c_isspace(*cur))
|
while (g_ascii_isspace(*cur))
|
||||||
cur++;
|
cur++;
|
||||||
|
|
||||||
for (i = 0; i < VIR_UUID_BUFLEN;) {
|
for (i = 0; i < VIR_UUID_BUFLEN;) {
|
||||||
@ -128,7 +128,7 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (*cur) {
|
while (*cur) {
|
||||||
if (!c_isspace(*cur))
|
if (!g_ascii_isspace(*cur))
|
||||||
goto error;
|
goto error;
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user