Skip to content

Commit

Permalink
util/StringStrip: use std::size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Oct 15, 2020
1 parent 41f6d44 commit dd791d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/util/StringStrip.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ StripRight(const char *p, const char *end) noexcept
return end;
}

size_t
StripRight(const char *p, size_t length) noexcept
std::size_t
StripRight(const char *p, std::size_t length) noexcept
{
while (length > 0 && IsWhitespaceOrNull(p[length - 1]))
--length;
Expand All @@ -71,8 +71,8 @@ StripRight(const char *p, size_t length) noexcept
void
StripRight(char *p) noexcept
{
size_t old_length = strlen(p);
size_t new_length = StripRight(p, old_length);
std::size_t old_length = strlen(p);
std::size_t new_length = StripRight(p, old_length);
p[new_length] = 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/util/StringStrip.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "Compiler.h"

#include <stddef.h>
#include <cstddef>

/**
* Skips whitespace at the beginning of the string, and returns the
Expand Down Expand Up @@ -82,8 +82,8 @@ StripRight(char *p, char *end) noexcept
* side.
*/
gcc_pure gcc_nonnull_all
size_t
StripRight(const char *p, size_t length) noexcept;
std::size_t
StripRight(const char *p, std::size_t length) noexcept;

/**
* Strip trailing whitespace by null-terminating the string.
Expand Down

0 comments on commit dd791d8

Please sign in to comment.