Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Unified Diff: third_party/WebKit/Source/wtf/ASCIICType.h

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/PRESUBMIT.py ('k') | third_party/WebKit/Source/wtf/ASCIICType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/ASCIICType.h
diff --git a/third_party/WebKit/Source/wtf/ASCIICType.h b/third_party/WebKit/Source/wtf/ASCIICType.h
index 052a45b11c3c65a6b695bea7a052a58f35484554..d990cbead6cbbcf4ff9045d4500edb92ee47ef36 100644
--- a/third_party/WebKit/Source/wtf/ASCIICType.h
+++ b/third_party/WebKit/Source/wtf/ASCIICType.h
@@ -44,44 +44,44 @@
namespace WTF {
-template<typename CharType> inline bool isASCII(CharType c)
-{
- return !(c & ~0x7F);
+template <typename CharType>
+inline bool isASCII(CharType c) {
+ return !(c & ~0x7F);
}
-template<typename CharType> inline bool isASCIIAlpha(CharType c)
-{
- return (c | 0x20) >= 'a' && (c | 0x20) <= 'z';
+template <typename CharType>
+inline bool isASCIIAlpha(CharType c) {
+ return (c | 0x20) >= 'a' && (c | 0x20) <= 'z';
}
-template<typename CharType> inline bool isASCIIDigit(CharType c)
-{
- return c >= '0' && c <= '9';
+template <typename CharType>
+inline bool isASCIIDigit(CharType c) {
+ return c >= '0' && c <= '9';
}
-template<typename CharType> inline bool isASCIIAlphanumeric(CharType c)
-{
- return isASCIIDigit(c) || isASCIIAlpha(c);
+template <typename CharType>
+inline bool isASCIIAlphanumeric(CharType c) {
+ return isASCIIDigit(c) || isASCIIAlpha(c);
}
-template<typename CharType> inline bool isASCIIHexDigit(CharType c)
-{
- return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f');
+template <typename CharType>
+inline bool isASCIIHexDigit(CharType c) {
+ return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f');
}
-template<typename CharType> inline bool isASCIILower(CharType c)
-{
- return c >= 'a' && c <= 'z';
+template <typename CharType>
+inline bool isASCIILower(CharType c) {
+ return c >= 'a' && c <= 'z';
}
-template<typename CharType> inline bool isASCIIOctalDigit(CharType c)
-{
- return (c >= '0') & (c <= '7');
+template <typename CharType>
+inline bool isASCIIOctalDigit(CharType c) {
+ return (c >= '0') & (c <= '7');
}
-template<typename CharType> inline bool isASCIIPrintable(CharType c)
-{
- return c >= ' ' && c <= '~';
+template <typename CharType>
+inline bool isASCIIPrintable(CharType c) {
+ return c >= ' ' && c <= '~';
}
/*
@@ -97,85 +97,81 @@ template<typename CharType> inline bool isASCIIPrintable(CharType c)
0C \f 0
0B \v 0
*/
-template<typename CharType> inline bool isASCIISpace(CharType c)
-{
- return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9));
+template <typename CharType>
+inline bool isASCIISpace(CharType c) {
+ return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9));
}
-template<typename CharType> inline bool isASCIIUpper(CharType c)
-{
- return c >= 'A' && c <= 'Z';
+template <typename CharType>
+inline bool isASCIIUpper(CharType c) {
+ return c >= 'A' && c <= 'Z';
}
WTF_EXPORT extern const LChar ASCIICaseFoldTable[256];
-template<typename CharType> inline CharType toASCIILower(CharType c)
-{
+template <typename CharType>
+inline CharType toASCIILower(CharType c) {
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER == 170060610
- // Make a workaround for VS2012 update 3 optimizer bug, remove once VS2012 fix it.
- return (c >= 'A' && c <= 'Z') ? c + 0x20 : c;
+ // Make a workaround for VS2012 update 3 optimizer bug, remove once VS2012 fix it.
+ return (c >= 'A' && c <= 'Z') ? c + 0x20 : c;
#else
- return c | ((c >= 'A' && c <= 'Z') << 5);
+ return c | ((c >= 'A' && c <= 'Z') << 5);
#endif
}
-inline LChar toASCIILower(LChar c)
-{
- return ASCIICaseFoldTable[c];
+inline LChar toASCIILower(LChar c) {
+ return ASCIICaseFoldTable[c];
}
-inline char toASCIILower(char c)
-{
- return static_cast<char>(ASCIICaseFoldTable[static_cast<LChar>(c)]);
+inline char toASCIILower(char c) {
+ return static_cast<char>(ASCIICaseFoldTable[static_cast<LChar>(c)]);
}
-template<typename CharType> inline CharType toASCIILowerUnchecked(CharType character)
-{
- // This function can be used for comparing any input character
- // to a lowercase English character. The isASCIIAlphaCaselessEqual
- // below should be used for regular comparison of ASCII alpha
- // characters, but switch statements in CSS tokenizer require
- // direct use of this function.
- return character | 0x20;
+template <typename CharType>
+inline CharType toASCIILowerUnchecked(CharType character) {
+ // This function can be used for comparing any input character
+ // to a lowercase English character. The isASCIIAlphaCaselessEqual
+ // below should be used for regular comparison of ASCII alpha
+ // characters, but switch statements in CSS tokenizer require
+ // direct use of this function.
+ return character | 0x20;
}
-template<typename CharType> inline CharType toASCIIUpper(CharType c)
-{
- return c & ~((c >= 'a' && c <= 'z') << 5);
+template <typename CharType>
+inline CharType toASCIIUpper(CharType c) {
+ return c & ~((c >= 'a' && c <= 'z') << 5);
}
-template<typename CharType> inline int toASCIIHexValue(CharType c)
-{
- ASSERT(isASCIIHexDigit(c));
- return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF;
+template <typename CharType>
+inline int toASCIIHexValue(CharType c) {
+ ASSERT(isASCIIHexDigit(c));
+ return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF;
}
-template<typename CharType> inline int toASCIIHexValue(CharType upperValue, CharType lowerValue)
-{
- ASSERT(isASCIIHexDigit(upperValue) && isASCIIHexDigit(lowerValue));
- return ((toASCIIHexValue(upperValue) << 4) & 0xF0) | toASCIIHexValue(lowerValue);
+template <typename CharType>
+inline int toASCIIHexValue(CharType upperValue, CharType lowerValue) {
+ ASSERT(isASCIIHexDigit(upperValue) && isASCIIHexDigit(lowerValue));
+ return ((toASCIIHexValue(upperValue) << 4) & 0xF0) |
+ toASCIIHexValue(lowerValue);
}
-inline char lowerNibbleToASCIIHexDigit(char c)
-{
- char nibble = c & 0xF;
- return nibble < 10 ? '0' + nibble : 'A' + nibble - 10;
+inline char lowerNibbleToASCIIHexDigit(char c) {
+ char nibble = c & 0xF;
+ return nibble < 10 ? '0' + nibble : 'A' + nibble - 10;
}
-inline char upperNibbleToASCIIHexDigit(char c)
-{
- char nibble = (c >> 4) & 0xF;
- return nibble < 10 ? '0' + nibble : 'A' + nibble - 10;
+inline char upperNibbleToASCIIHexDigit(char c) {
+ char nibble = (c >> 4) & 0xF;
+ return nibble < 10 ? '0' + nibble : 'A' + nibble - 10;
}
-template<typename CharType> inline bool isASCIIAlphaCaselessEqual(CharType cssCharacter, char character)
-{
- // This function compares a (preferrably) constant ASCII
- // lowercase letter to any input character.
- ASSERT(character >= 'a' && character <= 'z');
- return LIKELY(toASCIILowerUnchecked(cssCharacter) == character);
+template <typename CharType>
+inline bool isASCIIAlphaCaselessEqual(CharType cssCharacter, char character) {
+ // This function compares a (preferrably) constant ASCII
+ // lowercase letter to any input character.
+ ASSERT(character >= 'a' && character <= 'z');
+ return LIKELY(toASCIILowerUnchecked(cssCharacter) == character);
}
-
}
using WTF::isASCII;
« no previous file with comments | « third_party/WebKit/PRESUBMIT.py ('k') | third_party/WebKit/Source/wtf/ASCIICType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698