With the last user gone this function can be abolished. It is
preferable to use _ll instead since that is not a subject to 32/64 bit
scaling.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/libvirt_private.syms | 1 -
src/util/virstring.c | 19 +------------------
src/util/virstring.h | 5 -----
tests/virstringtest.c | 4 ----
4 files changed, 1 insertion(+), 28 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 436d5a07702e..fb7ad9c85511 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3414,7 +3414,6 @@ virStringToUpper;
virStringTrimOptionalNewline;
virStrToDouble;
virStrToLong_i;
-virStrToLong_l;
virStrToLong_ll;
virStrToLong_ui;
virStrToLong_uip;
diff --git a/src/util/virstring.c b/src/util/virstring.c
index d9c9c8f73807..635685eed4a4 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -113,24 +113,7 @@ virStrToLong_uip(char const *s, char **end_ptr, int base, unsigned
int *result)
return 0;
}
-/* Just like virStrToLong_i, above, but produce a "long" value. */
-int
-virStrToLong_l(char const *s, char **end_ptr, int base, long *result)
-{
- long int val;
- char *p;
- int err;
-
- errno = 0;
- val = strtol(s, &p, base); /* exempt from syntax-check */
- err = (errno || (!end_ptr && *p) || p == s);
- if (end_ptr)
- *end_ptr = p;
- if (err)
- return -1;
- *result = val;
- return 0;
-}
+/* virStrToLong_l is intentionally skipped, consider virStrToLong_ll instead */
/* Just like virStrToLong_i, above, but produce an "unsigned long"
* value. This version allows twos-complement wraparound of negative
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 0f8b5d066425..16dcce98f42a 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -38,11 +38,6 @@ int virStrToLong_uip(char const *s,
int base,
unsigned int *result)
G_GNUC_WARN_UNUSED_RESULT;
-int virStrToLong_l(char const *s,
- char **end_ptr,
- int base,
- long *result)
- G_GNUC_WARN_UNUSED_RESULT;
int virStrToLong_ul(char const *s,
char **end_ptr,
int base,
diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index 7d8d9204cce0..6e697cc240e6 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -258,7 +258,6 @@ testStringToLong(const void *opaque)
const struct stringToLongData *data = opaque;
int ret = 0;
char *end;
- long l;
unsigned long ul;
bool negative;
@@ -308,9 +307,6 @@ testStringToLong(const void *opaque)
/* We hate adding new API with 'long', and prefer 'int' or 'long
* long' instead, since platform-specific results are evil */
- l = (sizeof(int) == sizeof(long)) ? data->si : data->ll;
- TEST_ONE(data->str, data->suffix, long, l, "%ld",
- l, (sizeof(int) == sizeof(long)) ? data->si_ret : data->ll_ret);
ul = (sizeof(int) == sizeof(long)) ? data->ui : data->ull;
TEST_ONE(data->str, data->suffix, unsigned long, ul, "%lu",
ul, (sizeof(int) == sizeof(long)) ? data->ui_ret : data->ull_ret);
--
2.41.0