util/CNumberParser: remove unused function ParseInt64()

This commit is contained in:
Max Kellermann 2024-01-04 21:07:34 +01:00
parent 4086190c80
commit b601f4dc15
3 changed files with 0 additions and 34 deletions

View File

@ -1,22 +0,0 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#include "CNumberParser.hxx"
#include <algorithm>
#include <iterator>
int64_t
ParseInt64(std::string_view s, const char **endptr_r, int base) noexcept
{
char buffer[32];
*std::copy_n(s.data(), std::min(s.size(), std::size(buffer) - 1),
buffer) = 0;
char *endptr;
const auto result = ParseInt64(buffer, &endptr, base);
if (endptr_r != nullptr)
*endptr_r = s.data() + (endptr - buffer);
return result;
}

View File

@ -33,17 +33,6 @@ ParseUint64(const char *p, char **endptr=nullptr, int base=10) noexcept
return strtoull(p, endptr, base);
}
static inline int64_t
ParseInt64(const char *p, char **endptr=nullptr, int base=10) noexcept
{
assert(p != nullptr);
return strtoll(p, endptr, base);
}
int64_t
ParseInt64(std::string_view s, const char **endptr_r=nullptr, int base=10) noexcept;
static inline double
ParseDouble(const char *p, char **endptr=nullptr) noexcept
{

View File

@ -3,7 +3,6 @@ util = static_library(
'Exception.cxx',
'UTF8.cxx',
'MimeType.cxx',
'CNumberParser.cxx',
'TruncateString.cxx',
'StringStrip.cxx',
'StringUtil.cxx',