diff --git a/re2/filtered_re2.h b/re2/filtered_re2.h index dd618c70e8bfee9cfc8e5118868f5f0a3cd298ee..ea5c89fd408e2a3845a92f1f055f451ea2ab3d25 100644 --- a/re2/filtered_re2.h +++ b/re2/filtered_re2.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef RE2_FILTERED_RE2_H_ -#define RE2_FILTERED_RE2_H_ +#pragma once // The class FilteredRE2 is used as a wrapper to multiple RE2 regexps. // It provides a prefilter mechanism that helps in cutting down the @@ -110,5 +109,3 @@ class FilteredRE2 { }; } // namespace re2 - -#endif // RE2_FILTERED_RE2_H_ diff --git a/re2/re2.h b/re2/re2.h index 7fd2245cb35c070b81fb50429bf2af2fa48f4ac0..1550dc9321cd17d1f5f026a2341a3bae88560166 100644 --- a/re2/re2.h +++ b/re2/re2.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef RE2_RE2_H_ -#define RE2_RE2_H_ +#pragma once // C++ interface to the re2 regular-expression library. // RE2 supports Perl-style regular expressions (with extensions like @@ -1012,6 +1011,4 @@ DECLARE_HOOK(DFASearchFailure) } // namespace re2 using re2::RE2; -using re2::LazyRE2; - -#endif // RE2_RE2_H_ +using re2::LazyRE2; \ No newline at end of file diff --git a/re2/set.h b/re2/set.h index 8d64f30ccd94073058de740e22fb110d013de506..5d6ec912c2ade77c9151fda8f56da0943fa08b3c 100644 --- a/re2/set.h +++ b/re2/set.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef RE2_SET_H_ -#define RE2_SET_H_ +#pragma once #include #include @@ -80,6 +79,4 @@ class RE2::Set { std::unique_ptr prog_; }; -} // namespace re2 - -#endif // RE2_SET_H_ +} // namespace re2 \ No newline at end of file diff --git a/re2/stringpiece.h b/re2/stringpiece.h index 1d9c2d3d2c34d245d4dd78978c363e6b694041c5..f568876bab2b4c91851cd43e783073c082d25424 100644 --- a/re2/stringpiece.h +++ b/re2/stringpiece.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef RE2_STRINGPIECE_H_ -#define RE2_STRINGPIECE_H_ +#pragma once // A string-like object that points to a sized piece of memory. // @@ -205,6 +204,4 @@ inline bool operator>=(const StringPiece& x, const StringPiece& y) { // Allow StringPiece to be logged. std::ostream& operator<<(std::ostream& o, const StringPiece& p); -} // namespace re2 - -#endif // RE2_STRINGPIECE_H_ +} // namespace re2 \ No newline at end of file diff --git a/regex-capi/include/rure.h b/regex-capi/include/rure.h index c8e2af5162d8f1d59afa1fb9e2f45d2a5cf1bd5e..f9abf430325043c48fa6fabf09e8c047c5a9da8d 100644 --- a/regex-capi/include/rure.h +++ b/regex-capi/include/rure.h @@ -1,5 +1,4 @@ -#ifndef _RURE_H -#define _RURE_H +#pragma once #include #include @@ -616,6 +615,4 @@ bool rure_check_rewrite_string(const char *rewrite, int max_token); #ifdef __cplusplus } -#endif - -#endif +#endif \ No newline at end of file diff --git a/util/benchmark.h b/util/benchmark.h index d97b49e17f4cb091455d06cd8717e081119caf27..40181a5bdd9c91df34d2125c30cfdb1ba7e8aa2d 100644 --- a/util/benchmark.h +++ b/util/benchmark.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_BENCHMARK_H_ -#define UTIL_BENCHMARK_H_ +#pragma once #include #include @@ -152,5 +151,3 @@ class Benchmark { #define BENCHMARK_RANGE(f, lo, hi) \ ::testing::Benchmark* _benchmark_##f = \ (new ::testing::Benchmark(#f, f, lo, hi)) - -#endif // UTIL_BENCHMARK_H_ diff --git a/util/flags.h b/util/flags.h index 3386b729d4319882ed096d2f44dceab8946f88fa..c6d66e34756f40697901a42d8a70b4fe737aba88 100644 --- a/util/flags.h +++ b/util/flags.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_FLAGS_H_ -#define UTIL_FLAGS_H_ +#pragma once // Simplified version of Google's command line flags. // Does not support parsing the command line. @@ -21,6 +20,4 @@ template T GetFlag(const T& flag) { return flag; } -} // namespace re2 - -#endif // UTIL_FLAGS_H_ +} // namespace re2 \ No newline at end of file diff --git a/util/logging.h b/util/logging.h index 5b2217f29ca4c79c3696aa66f6dbdef6be01f95d..917b4816a2ba2441be37bda8d254dc590a96d87a 100644 --- a/util/logging.h +++ b/util/logging.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_LOGGING_H_ -#define UTIL_LOGGING_H_ +#pragma once // Simplified version of Google's logging. @@ -104,6 +103,4 @@ class LogMessageFatal : public LogMessage { #ifdef _MSC_VER #pragma warning(pop) -#endif - -#endif // UTIL_LOGGING_H_ +#endif \ No newline at end of file diff --git a/util/malloc_counter.h b/util/malloc_counter.h index 81b564ff9868bbbd19c0fa1ef8ae8cd08a88abb0..9beabef14cf3390b9ec13210869179ae8af94af0 100644 --- a/util/malloc_counter.h +++ b/util/malloc_counter.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_MALLOC_COUNTER_H_ -#define UTIL_MALLOC_COUNTER_H_ +#pragma once namespace testing { class MallocCounter { @@ -14,6 +13,4 @@ class MallocCounter { long long PeakHeapGrowth() { return 0; } void Reset() {} }; -} // namespace testing - -#endif // UTIL_MALLOC_COUNTER_H_ +} // namespace testing \ No newline at end of file diff --git a/util/mix.h b/util/mix.h index d85c172ab0e3fb95a67ea2ab315f178596fca869..b8953f03c668060d8b03337bedb84aea6772cfd3 100644 --- a/util/mix.h +++ b/util/mix.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_MIX_H_ -#define UTIL_MIX_H_ +#pragma once #include #include @@ -36,6 +35,4 @@ class HashMix { #pragma warning(pop) #endif -} // namespace re2 - -#endif // UTIL_MIX_H_ +} // namespace re2 \ No newline at end of file diff --git a/util/mutex.h b/util/mutex.h index 158046bb5c9f40b7bbcbebe2c5ebf8dae23979d2..a5ebc8a6de211dff7a20aa34bacceb726b4ec0d5 100644 --- a/util/mutex.h +++ b/util/mutex.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_MUTEX_H_ -#define UTIL_MUTEX_H_ +#pragma once /* * A simple mutex wrapper, supporting locks and read-write locks. @@ -143,6 +142,4 @@ class WriterMutexLock { #define ReaderMutexLock(x) static_assert(false, "ReaderMutexLock declaration missing variable name") #define WriterMutexLock(x) static_assert(false, "WriterMutexLock declaration missing variable name") -} // namespace re2 - -#endif // UTIL_MUTEX_H_ +} // namespace re2 \ No newline at end of file diff --git a/util/pcre.h b/util/pcre.h index 896b0bdf8935a8e901fc74a2be0fdf0786e0bbc4..7cf2de49d847db0094e5663cd876145a4d624ac4 100644 --- a/util/pcre.h +++ b/util/pcre.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_PCRE_H_ -#define UTIL_PCRE_H_ +#pragma once // This is a variant of PCRE's pcrecpp.h, originally written at Google. // The main changes are the addition of the HitLimit method and @@ -677,5 +676,3 @@ MAKE_INTEGER_PARSER(unsigned long long, ulonglong); #undef MAKE_INTEGER_PARSER } // namespace re2 - -#endif // UTIL_PCRE_H_ diff --git a/util/strutil.h b/util/strutil.h index a69908a0dd94108de70d0b8a8401262ae070645a..e2a7f0b3cf73f4999fb6351de6c021cec2b9ee06 100644 --- a/util/strutil.h +++ b/util/strutil.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_STRUTIL_H_ -#define UTIL_STRUTIL_H_ +#pragma once #include @@ -16,6 +15,4 @@ std::string CEscape(const StringPiece& src); void PrefixSuccessor(std::string* prefix); std::string StringPrintf(const char* format, ...); -} // namespace re2 - -#endif // UTIL_STRUTIL_H_ +} // namespace re2 \ No newline at end of file diff --git a/util/test.h b/util/test.h index 54e6f8fbbbc845ede96eaacd59f27d400fe3b971..e52d883ed332ca3737dc161219f7bf59a7ec180b 100644 --- a/util/test.h +++ b/util/test.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_TEST_H_ -#define UTIL_TEST_H_ +#pragma once #include "util/util.h" #include "util/logging.h" @@ -46,5 +45,3 @@ class TestRegisterer { #define EXPECT_LE CHECK_LE #define EXPECT_GT CHECK_GT #define EXPECT_GE CHECK_GE - -#endif // UTIL_TEST_H_ diff --git a/util/utf.h b/util/utf.h index 85b42972390159f8ef9286417485f0d252ce7c74..a25f762d95941c558b008221da43b181518370b8 100644 --- a/util/utf.h +++ b/util/utf.h @@ -15,8 +15,7 @@ * in name space re2. */ -#ifndef UTIL_UTF_H_ -#define UTIL_UTF_H_ +#pragma once #include @@ -39,6 +38,4 @@ int fullrune(const char* s, int n); int utflen(const char* s); char* utfrune(const char*, Rune); -} // namespace re2 - -#endif // UTIL_UTF_H_ +} // namespace re2 \ No newline at end of file diff --git a/util/util.h b/util/util.h index 56e46c1a3385bbd7e21fcf321281f4f42ec81dd9..78bf84ce63ba624545667b2dfaacc28feb1ebdbf 100644 --- a/util/util.h +++ b/util/util.h @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#ifndef UTIL_UTIL_H_ -#define UTIL_UTIL_H_ +#pragma once #define arraysize(array) (sizeof(array)/sizeof((array)[0])) @@ -37,6 +36,4 @@ #ifndef NO_THREAD_SAFETY_ANALYSIS #define NO_THREAD_SAFETY_ANALYSIS -#endif - -#endif // UTIL_UTIL_H_ +#endif \ No newline at end of file