util: Remove virParseNumber

We have more modern replacements.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-04-01 17:45:46 +02:00
parent 29a7c2e5d8
commit e26712d35b
3 changed files with 0 additions and 33 deletions

View File

@ -3223,7 +3223,6 @@ virIsSUID;
virMemoryLimitIsSet;
virMemoryLimitTruncate;
virMemoryMaxValue;
virParseNumber;
virParseOwnershipIds;
virParseVersionString;
virScaleInteger;

View File

@ -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

View File

@ -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);