Commit 9355ec44 authored by Max Kellermann's avatar Max Kellermann

util/StringStrip: use std::size_t

parent c63bd323
...@@ -59,8 +59,8 @@ StripRight(const char *p, const char *end) noexcept ...@@ -59,8 +59,8 @@ StripRight(const char *p, const char *end) noexcept
return end; return end;
} }
size_t std::size_t
StripRight(const char *p, size_t length) noexcept StripRight(const char *p, std::size_t length) noexcept
{ {
while (length > 0 && IsWhitespaceOrNull(p[length - 1])) while (length > 0 && IsWhitespaceOrNull(p[length - 1]))
--length; --length;
...@@ -71,8 +71,8 @@ StripRight(const char *p, size_t length) noexcept ...@@ -71,8 +71,8 @@ StripRight(const char *p, size_t length) noexcept
void void
StripRight(char *p) noexcept StripRight(char *p) noexcept
{ {
size_t old_length = strlen(p); std::size_t old_length = strlen(p);
size_t new_length = StripRight(p, old_length); std::size_t new_length = StripRight(p, old_length);
p[new_length] = 0; p[new_length] = 0;
} }
......
...@@ -82,8 +82,8 @@ StripRight(char *p, char *end) noexcept ...@@ -82,8 +82,8 @@ StripRight(char *p, char *end) noexcept
* side. * side.
*/ */
gcc_pure gcc_nonnull_all gcc_pure gcc_nonnull_all
size_t std::size_t
StripRight(const char *p, size_t length) noexcept; StripRight(const char *p, std::size_t length) noexcept;
/** /**
* Strip trailing whitespace by null-terminating the string. * Strip trailing whitespace by null-terminating the string.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment