mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
use g_ascii_isdigit instead of c_isdigit frum gnulib
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
bbe0610625
commit
a405834a5d
@ -567,7 +567,7 @@ udevBridgeScanDirFilter(const struct dirent *entry)
|
|||||||
*/
|
*/
|
||||||
if (strlen(entry->d_name) >= 5) {
|
if (strlen(entry->d_name) >= 5) {
|
||||||
if (STRPREFIX(entry->d_name, VIR_NET_GENERATED_TAP_PREFIX) &&
|
if (STRPREFIX(entry->d_name, VIR_NET_GENERATED_TAP_PREFIX) &&
|
||||||
c_isdigit(entry->d_name[4]))
|
g_ascii_isdigit(entry->d_name[4]))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "virconf.h"
|
#include "virconf.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
@ -1860,7 +1859,7 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg,
|
|||||||
char *p = mem_tokens[j] + 4;
|
char *p = mem_tokens[j] + 4;
|
||||||
unsigned long long multiplier = 1;
|
unsigned long long multiplier = 1;
|
||||||
|
|
||||||
while (c_isdigit(*p))
|
while (g_ascii_isdigit(*p))
|
||||||
p++;
|
p++;
|
||||||
if (virStrToLong_ull(mem_tokens[j] + 4, &p, 10, maxmem) < 0)
|
if (virStrToLong_ull(mem_tokens[j] + 4, &p, 10, maxmem) < 0)
|
||||||
break;
|
break;
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virgettext.h"
|
#include "virgettext.h"
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ int main(int argc, char **argv)
|
|||||||
* path, then append the "p" partition separator. Otherwise, if
|
* path, then append the "p" partition separator. Otherwise, if
|
||||||
* the path ends with a letter already, then no need for a separator.
|
* the path ends with a letter already, then no need for a separator.
|
||||||
*/
|
*/
|
||||||
if (c_isdigit(path[strlen(path)-1]) || devmap_partsep)
|
if (g_ascii_isdigit(path[strlen(path)-1]) || devmap_partsep)
|
||||||
partsep = "p";
|
partsep = "p";
|
||||||
else
|
else
|
||||||
partsep = "";
|
partsep = "";
|
||||||
@ -97,7 +96,7 @@ int main(int argc, char **argv)
|
|||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
partsep = *canonical_path &&
|
partsep = *canonical_path &&
|
||||||
c_isdigit(canonical_path[strlen(canonical_path)-1]) ? "p" : "";
|
g_ascii_isdigit(canonical_path[strlen(canonical_path)-1]) ? "p" : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev = ped_device_get(path)) == NULL) {
|
if ((dev = ped_device_get(path)) == NULL) {
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "virbitmap.h"
|
#include "virbitmap.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
@ -506,7 +505,7 @@ virBitmapParseSeparator(const char *str,
|
|||||||
neg = true;
|
neg = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!c_isdigit(*cur))
|
if (!g_ascii_isdigit(*cur))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virStrToLong_i(cur, &tmp, 10, &start) < 0)
|
if (virStrToLong_i(cur, &tmp, 10, &start) < 0)
|
||||||
@ -642,7 +641,7 @@ virBitmapParseUnlimited(const char *str)
|
|||||||
neg = true;
|
neg = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!c_isdigit(*cur))
|
if (!g_ascii_isdigit(*cur))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virStrToLong_i(cur, &tmp, 10, &start) < 0)
|
if (virStrToLong_i(cur, &tmp, 10, &start) < 0)
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
#include "virconf.h"
|
#include "virconf.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
#include "c-ctype.h"
|
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
@ -350,11 +349,11 @@ virConfParseLong(virConfParserCtxtPtr ctxt, long long *val)
|
|||||||
} else if (CUR == '+') {
|
} else if (CUR == '+') {
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
if ((ctxt->cur >= ctxt->end) || (!c_isdigit(CUR))) {
|
if ((ctxt->cur >= ctxt->end) || (!g_ascii_isdigit(CUR))) {
|
||||||
virConfError(ctxt, VIR_ERR_CONF_SYNTAX, _("unterminated number"));
|
virConfError(ctxt, VIR_ERR_CONF_SYNTAX, _("unterminated number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while ((ctxt->cur < ctxt->end) && (c_isdigit(CUR))) {
|
while ((ctxt->cur < ctxt->end) && (g_ascii_isdigit(CUR))) {
|
||||||
l = l * 10 + (CUR - '0');
|
l = l * 10 + (CUR - '0');
|
||||||
NEXT;
|
NEXT;
|
||||||
}
|
}
|
||||||
@ -514,7 +513,7 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
|
|||||||
virConfFreeList(lst);
|
virConfFreeList(lst);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else if (c_isdigit(CUR) || (CUR == '-') || (CUR == '+')) {
|
} else if (g_ascii_isdigit(CUR) || (CUR == '-') || (CUR == '+')) {
|
||||||
if (ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) {
|
if (ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) {
|
||||||
virConfError(ctxt, VIR_ERR_CONF_SYNTAX,
|
virConfError(ctxt, VIR_ERR_CONF_SYNTAX,
|
||||||
_("numbers not allowed in VMX format"));
|
_("numbers not allowed in VMX format"));
|
||||||
|
@ -80,8 +80,6 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virutil.h"
|
#include "virutil.h"
|
||||||
|
|
||||||
#include "c-ctype.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_NONE
|
#define VIR_FROM_THIS VIR_FROM_NONE
|
||||||
|
|
||||||
VIR_LOG_INIT("util.file");
|
VIR_LOG_INIT("util.file");
|
||||||
@ -696,7 +694,7 @@ static int virFileLoopDeviceOpenSearch(char **dev_name)
|
|||||||
* new kernels have a dev named 'loop-control'
|
* new kernels have a dev named 'loop-control'
|
||||||
*/
|
*/
|
||||||
if (!STRPREFIX(de->d_name, "loop") ||
|
if (!STRPREFIX(de->d_name, "loop") ||
|
||||||
!c_isdigit(de->d_name[4]))
|
!g_ascii_isdigit(de->d_name[4]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
looppath = g_strdup_printf("/dev/%s", de->d_name);
|
looppath = g_strdup_printf("/dev/%s", de->d_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user