From dd791d8074e016ae62be6b9c46dae864513b3869 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Oct 2020 12:52:22 +0200 Subject: [PATCH] util/StringStrip: use std::size_t --- src/util/StringStrip.cxx | 8 ++++---- src/util/StringStrip.hxx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/StringStrip.cxx b/src/util/StringStrip.cxx index 27b2b567..9aaf7d49 100644 --- a/src/util/StringStrip.cxx +++ b/src/util/StringStrip.cxx @@ -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; @@ -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; } diff --git a/src/util/StringStrip.hxx b/src/util/StringStrip.hxx index 20d0ed92..90207540 100644 --- a/src/util/StringStrip.hxx +++ b/src/util/StringStrip.hxx @@ -32,7 +32,7 @@ #include "Compiler.h" -#include +#include /** * Skips whitespace at the beginning of the string, and returns the @@ -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.