Change None in C/C++ source to NoneType.
Prevent name conflict with X11 None definition.
This commit is contained in:
parent
752804372c
commit
6f6c4cdef6
@ -19,7 +19,7 @@
|
||||
namespace YAML {
|
||||
namespace detail {
|
||||
struct iterator_type {
|
||||
enum value { None, Sequence, Map };
|
||||
enum value { NoneType, Sequence, Map };
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
@ -73,7 +73,7 @@ class node_iterator_base
|
||||
typedef node_iterator_value<V> value_type;
|
||||
|
||||
node_iterator_base()
|
||||
: m_type(iterator_type::None), m_seqIt(), m_mapIt(), m_mapEnd() {}
|
||||
: m_type(iterator_type::NoneType), m_seqIt(), m_mapIt(), m_mapEnd() {}
|
||||
explicit node_iterator_base(SeqIter seqIt)
|
||||
: m_type(iterator_type::Sequence),
|
||||
m_seqIt(seqIt),
|
||||
@ -105,7 +105,7 @@ class node_iterator_base
|
||||
return false;
|
||||
|
||||
switch (m_type) {
|
||||
case iterator_type::None:
|
||||
case iterator_type::NoneType:
|
||||
return true;
|
||||
case iterator_type::Sequence:
|
||||
return m_seqIt == rhs.m_seqIt;
|
||||
@ -122,7 +122,7 @@ class node_iterator_base
|
||||
|
||||
node_iterator_base<V>& operator++() {
|
||||
switch (m_type) {
|
||||
case iterator_type::None:
|
||||
case iterator_type::NoneType:
|
||||
break;
|
||||
case iterator_type::Sequence:
|
||||
++m_seqIt;
|
||||
@ -143,7 +143,7 @@ class node_iterator_base
|
||||
|
||||
value_type operator*() const {
|
||||
switch (m_type) {
|
||||
case iterator_type::None:
|
||||
case iterator_type::NoneType:
|
||||
return value_type();
|
||||
case iterator_type::Sequence:
|
||||
return value_type(**m_seqIt);
|
||||
|
||||
@ -103,7 +103,7 @@ GTEST_DECLARE_string_(color);
|
||||
// the tests to run. If the filter is not given all tests are executed.
|
||||
GTEST_DECLARE_string_(filter);
|
||||
|
||||
// This flag causes the Google Test to list tests. None of the tests listed
|
||||
// This flag causes the Google Test to list tests. NoneType of the tests listed
|
||||
// are actually run if the flag is provided.
|
||||
GTEST_DECLARE_bool_(list_tests);
|
||||
|
||||
|
||||
@ -539,7 +539,7 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
|
||||
|
||||
// If *pstr starts with the given prefix, modifies *pstr to be right
|
||||
// past the prefix and returns true; otherwise leaves *pstr unchanged
|
||||
// and returns false. None of pstr, *pstr, and prefix can be NULL.
|
||||
// and returns false. NoneType of pstr, *pstr, and prefix can be NULL.
|
||||
GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
|
||||
|
||||
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -103,7 +103,7 @@ struct AssertTypeEq<T, T> {
|
||||
// template Types. This allows us to simulate variadic templates
|
||||
// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
|
||||
// support directly.
|
||||
struct None {};
|
||||
struct NoneType {};
|
||||
|
||||
// The following family of struct and struct templates are used to
|
||||
// represent type lists. In particular, TypesN<T1, T2, ..., TN>
|
||||
@ -144,7 +144,7 @@ struct Types$i {
|
||||
// easier to write, but generates horrible messages when there is a
|
||||
// compiler error, as gcc insists on printing out each template
|
||||
// argument, even if it has the default value (this means Types<int>
|
||||
// will appear as Types<int, None, None, ..., None> in the compiler
|
||||
// will appear as Types<int, NoneType, None, ..., NoneType> in the compiler
|
||||
// errors).
|
||||
//
|
||||
// Our solution is to combine the best part of the two approaches: a
|
||||
@ -154,13 +154,13 @@ struct Types$i {
|
||||
// Types template.
|
||||
|
||||
$range i 1..n
|
||||
template <$for i, [[typename T$i = internal::None]]>
|
||||
template <$for i, [[typename T$i = internal::NoneType]]>
|
||||
struct Types {
|
||||
typedef internal::Types$n<$for i, [[T$i]]> type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Types<$for i, [[internal::None]]> {
|
||||
struct Types<$for i, [[internal::NoneType]]> {
|
||||
typedef internal::Types0 type;
|
||||
};
|
||||
|
||||
@ -169,7 +169,7 @@ $for i [[
|
||||
$range j 1..i
|
||||
$range k i+1..n
|
||||
template <$for j, [[typename T$j]]>
|
||||
struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {
|
||||
struct Types<$for j, [[T$j]]$for k[[, internal::NoneType]]> {
|
||||
typedef internal::Types$i<$for j, [[T$j]]> type;
|
||||
};
|
||||
|
||||
|
||||
@ -4997,7 +4997,7 @@ bool AlwaysTrue() {
|
||||
|
||||
// If *pstr starts with the given prefix, modifies *pstr to be right
|
||||
// past the prefix and returns true; otherwise leaves *pstr unchanged
|
||||
// and returns false. None of pstr, *pstr, and prefix can be NULL.
|
||||
// and returns false. NoneType of pstr, *pstr, and prefix can be NULL.
|
||||
bool SkipPrefix(const char* prefix, const char** pstr) {
|
||||
const size_t prefix_len = strlen(prefix);
|
||||
if (strncmp(*pstr, prefix, prefix_len) == 0) {
|
||||
|
||||
@ -181,7 +181,7 @@ void TestRepeat(int repeat) {
|
||||
// set of tests.
|
||||
void TestRepeatWithEmptyFilter(int repeat) {
|
||||
GTEST_FLAG(repeat) = repeat;
|
||||
GTEST_FLAG(filter) = "None";
|
||||
GTEST_FLAG(filter) = "NoneType";
|
||||
|
||||
ResetCounts();
|
||||
GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user