提交 e26712d3 编写于 作者: P Peter Krempa

util: Remove virParseNumber

We have more modern replacements.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 29a7c2e5
......@@ -3223,7 +3223,6 @@ virIsSUID;
virMemoryLimitIsSet;
virMemoryLimitTruncate;
virMemoryMaxValue;
virParseNumber;
virParseOwnershipIds;
virParseVersionString;
virScaleInteger;
......
......@@ -278,37 +278,6 @@ virScaleInteger(unsigned long long *value, const char *suffix,
}
/**
* virParseNumber:
* @str: pointer to the char pointer used
*
* Parse an unsigned number
*
* Returns the unsigned number or -1 in case of error. @str will be
* updated to skip the number.
*/
int
virParseNumber(const char **str)
{
int ret = 0;
const char *cur = *str;
if ((*cur < '0') || (*cur > '9'))
return -1;
while (c_isdigit(*cur)) {
unsigned int c = *cur - '0';
if ((ret > INT_MAX / 10) ||
((ret == INT_MAX / 10) && (c > INT_MAX % 10)))
return -1;
ret = ret * 10 + c;
cur++;
}
*str = cur;
return ret;
}
/**
* virParseVersionString:
* @str: const char pointer to the version string
......
......@@ -54,7 +54,6 @@ int virScaleInteger(unsigned long long *value, const char *suffix,
int virHexToBin(unsigned char c);
int virParseNumber(const char **str);
int virParseVersionString(const char *str, unsigned long *version,
bool allowMissing);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册