diff --git a/src/util/CNumberParser.cxx b/src/util/CNumberParser.cxx deleted file mode 100644 index f099e4391..000000000 --- a/src/util/CNumberParser.cxx +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: BSD-2-Clause -// author: Max Kellermann - -#include "CNumberParser.hxx" - -#include -#include - -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; -} diff --git a/src/util/CNumberParser.hxx b/src/util/CNumberParser.hxx index a360e2d88..96264c926 100644 --- a/src/util/CNumberParser.hxx +++ b/src/util/CNumberParser.hxx @@ -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 { diff --git a/src/util/meson.build b/src/util/meson.build index 4afaa2506..4d69809d0 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -3,7 +3,6 @@ util = static_library( 'Exception.cxx', 'UTF8.cxx', 'MimeType.cxx', - 'CNumberParser.cxx', 'TruncateString.cxx', 'StringStrip.cxx', 'StringUtil.cxx',