From e26712d35b015a539ca833395ee779ec3391f770 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 1 Apr 2019 17:45:46 +0200 Subject: [PATCH] util: Remove virParseNumber MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have more modern replacements. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/libvirt_private.syms | 1 - src/util/virutil.c | 31 ------------------------------- src/util/virutil.h | 1 - 3 files changed, 33 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4a312218a2..212adf53c1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3223,7 +3223,6 @@ virIsSUID; virMemoryLimitIsSet; virMemoryLimitTruncate; virMemoryMaxValue; -virParseNumber; virParseOwnershipIds; virParseVersionString; virScaleInteger; diff --git a/src/util/virutil.c b/src/util/virutil.c index c0acf59831..3f214629ac 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -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 diff --git a/src/util/virutil.h b/src/util/virutil.h index a80e28b670..e537cc36cb 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -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);