diff options
Diffstat (limited to 'src/corelib/tools/qtools_p.h')
-rw-r--r-- | src/corelib/tools/qtools_p.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h index 303e626962..105aa40c02 100644 --- a/src/corelib/tools/qtools_p.h +++ b/src/corelib/tools/qtools_p.h @@ -16,7 +16,10 @@ // #include "QtCore/private/qglobal_p.h" + +#include <chrono> #include <limits.h> +#include <time.h> QT_BEGIN_NAMESPACE @@ -31,7 +34,7 @@ constexpr inline char toHexLower(char32_t value) noexcept return "0123456789abcdef"[value & 0xF]; } -[[nodiscard]] constexpr inline int isHexDigit(char32_t c) noexcept +[[nodiscard]] constexpr inline bool isHexDigit(char32_t c) noexcept { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') @@ -51,7 +54,7 @@ constexpr inline char toOct(char32_t value) noexcept return char('0' + (value & 0x7)); } -[[nodiscard]] constexpr inline int isOctalDigit(char32_t c) noexcept +[[nodiscard]] constexpr inline bool isOctalDigit(char32_t c) noexcept { return c >= '0' && c <= '7'; } @@ -98,16 +101,19 @@ constexpr inline int caseCompareAscii(char lhs, char rhs) noexcept return int(uchar(lhsLower)) - int(uchar(rhsLower)); } +constexpr inline int isAsciiPrintable(char32_t ch) noexcept +{ + return ch >= ' ' && ch < 0x7f; +} + constexpr inline int qt_lencmp(qsizetype lhs, qsizetype rhs) noexcept { return lhs == rhs ? 0 : lhs > rhs ? 1 : /* else */ -1 ; } -} -// We typically need an extra bit for qNextPowerOfTwo when determining the next allocation size. -constexpr qsizetype MaxAllocSize = (std::numeric_limits<qsizetype>::max)(); +} // namespace QtMiscUtils struct CalculateGrowingBlockSizeResult { |