diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-10-22 14:24:35 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-01-08 00:09:50 +0000 |
commit | 65fa1b4c0868ae4898e6753cecf2952dc87034ac (patch) | |
tree | cbd8bc0c18f2a11c021bf41a8cb6eaa5d5921c96 /src/qml/jsruntime | |
parent | ac47b1520ce9d60622f28c0be6c22aa1ae1bb15e (diff) |
Remove prohibited uses of underscore + capital letter
All identifiers starting with an underscore and a capital letter are
reserved to the compiler and must never be used by the user code. Try to
find a better name or, in the worst case, move the underscore to the
last position in these identifiers.
See commit cf63c63d558227fdbef09699c261560e7474f5ea in qtbase for a case
of such an identifier causing a build breakage when the compiler began
treating it specially (it was _Nullable).
Change-Id: I1d0f78915b5942aab07cffff140f9f39c29f0fdf
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 46 |
4 files changed, 28 insertions, 28 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index d74575da03..2560f065cf 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -536,7 +536,7 @@ void ExecutionEngine::initRootContext() Scoped<GlobalContext> r(scope, memoryManager->allocManaged<GlobalContext>(sizeof(GlobalContext::Data) + sizeof(CallData))); new (r->d()) GlobalContext::Data(this); r->d()->callData = reinterpret_cast<CallData *>(r->d() + 1); - r->d()->callData->tag = QV4::Value::_Integer_Type; + r->d()->callData->tag = QV4::Value::Integer_Type_Internal; r->d()->callData->argc = 0; r->d()->callData->thisObject = globalObject; r->d()->callData->args[0] = Encode::undefined(); diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 94df30944b..6a1bd7a9a4 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE namespace QV4 { #define Q_MANAGED_CHECK \ - template <typename _T> inline void qt_check_for_QMANAGED_macro(const _T *_q_argument) const \ + template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const \ { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } template <typename T> diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index f6361681a5..d7fd44e1d6 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -182,7 +182,7 @@ struct ScopedValue template<typename T> struct Scoped { - enum _Convert { Convert }; + enum ConvertType { Convert }; inline void setPointer(const Managed *p) { ptr->setM(p ? p->m() : 0); @@ -218,7 +218,7 @@ struct Scoped setPointer(v.ptr->as<T>()); } - Scoped(const Scope &scope, const Value &v, _Convert) + Scoped(const Scope &scope, const Value &v, ConvertType) { ptr = scope.engine->jsStackTop++; ptr->setRawValue(value_convert<T>(scope.engine, v)); @@ -246,7 +246,7 @@ struct Scoped ptr = scope.engine->jsStackTop++; setPointer(QV4::Value::fromReturnedValue(v).as<T>()); } - Scoped(const Scope &scope, const ReturnedValue &v, _Convert) + Scoped(const Scope &scope, const ReturnedValue &v, ConvertType) { ptr = scope.engine->jsStackTop++; ptr->setRawValue(value_convert<T>(scope.engine, QV4::Value::fromReturnedValue(v))); diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 5e38873b49..089b2bbd34 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -149,9 +149,9 @@ struct Q_QML_PRIVATE_EXPORT Value }; enum ValueTypeInternal { - _Null_Type = Null_Type | ConvertibleToInt, - _Boolean_Type = Boolean_Type | ConvertibleToInt, - _Integer_Type = Integer_Type | ConvertibleToInt, + Null_Type_Internal = Null_Type | ConvertibleToInt, + Boolean_Type_Internal = Boolean_Type | ConvertibleToInt, + Integer_Type_Internal = Integer_Type | ConvertibleToInt, }; #else @@ -189,9 +189,9 @@ struct Q_QML_PRIVATE_EXPORT Value enum ValueTypeInternal { - _Null_Type = Null_Type, - _Boolean_Type = Boolean_Type, - _Integer_Type = Integer_Type + Null_Type_Internal = Null_Type, + Boolean_Type_Internal = Boolean_Type, + Integer_Type_Internal = Integer_Type }; #endif @@ -203,8 +203,8 @@ struct Q_QML_PRIVATE_EXPORT Value inline bool isEmpty() const { return tag() == Empty_Type; } inline bool isUndefined() const { return tag() == Undefined_Type; } - inline bool isNull() const { return tag() == _Null_Type; } - inline bool isBoolean() const { return tag ()== _Boolean_Type; } + inline bool isNull() const { return tag() == Null_Type_Internal; } + inline bool isBoolean() const { return tag ()== Boolean_Type_Internal; } #ifdef QV4_USE_64_BIT_VALUE_ENCODING inline bool isInteger() const { return (_val >> IsNumber_Shift) == 1; } inline bool isDouble() const { return (_val >> IsDouble_Shift); } @@ -220,9 +220,9 @@ struct Q_QML_PRIVATE_EXPORT Value } inline bool isNaN() const { return (tag() & 0x7fff8000) == 0x00078000; } #else - inline bool isInteger() const { return tag() == _Integer_Type; } + inline bool isInteger() const { return tag() == Integer_Type_Internal; } inline bool isDouble() const { return (tag() & NotDouble_Mask) != NotDouble_Mask; } - inline bool isNumber() const { return tag() == _Integer_Type || (tag() & NotDouble_Mask) != NotDouble_Mask; } + inline bool isNumber() const { return tag() == Integer_Type_Internal || (tag() & NotDouble_Mask) != NotDouble_Mask; } inline bool isManaged() const { return tag() == Managed_Type; } inline bool isNullOrUndefined() const { return (tag() & IsNullOrUndefined_Mask) == Undefined_Type; } inline bool integerCompatible() const { return (tag() & ConvertibleToInt) == ConvertibleToInt; } @@ -254,21 +254,21 @@ struct Q_QML_PRIVATE_EXPORT Value inline bool isString() const; inline bool isObject() const; inline bool isInt32() { - if (tag() == _Integer_Type) + if (tag() == Integer_Type_Internal) return true; if (isDouble()) { double d = doubleValue(); int i = (int)d; if (i == d) { setInt_32(i); - setTag(_Integer_Type); + setTag(Integer_Type_Internal); return true; } } return false; } double asDouble() const { - if (tag() == _Integer_Type) + if (tag() == Integer_Type_Internal) return int_32(); return doubleValue(); } @@ -329,7 +329,7 @@ struct Q_QML_PRIVATE_EXPORT Value inline bool tryIntegerConversion() { bool b = integerCompatible(); if (b) - setTag(_Integer_Type); + setTag(Integer_Type_Internal); return b; } @@ -501,9 +501,9 @@ inline Primitive Primitive::nullValue() { Primitive v; #ifndef QV4_USE_64_BIT_VALUE_ENCODING - v.setRawValue(quint64(_Null_Type) << Tag_Shift); + v.setRawValue(quint64(Null_Type_Internal) << Tag_Shift); #else - v.setTagValue(_Null_Type, 0); + v.setTagValue(Null_Type_Internal, 0); #endif return v; } @@ -511,7 +511,7 @@ inline Primitive Primitive::nullValue() inline Primitive Primitive::fromBoolean(bool b) { Primitive v; - v.setTagValue(_Boolean_Type, b); + v.setTagValue(Boolean_Type_Internal, b); return v; } @@ -525,7 +525,7 @@ inline Primitive Primitive::fromDouble(double d) inline Primitive Primitive::fromInt32(int i) { Primitive v; - v.setTagValue(_Integer_Type, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors. + v.setTagValue(Integer_Type_Internal, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors. v.setInt_32(i); return v; } @@ -534,7 +534,7 @@ inline Primitive Primitive::fromUInt32(uint i) { Primitive v; if (i < INT_MAX) { - v.setTagValue(_Integer_Type, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors. + v.setTagValue(Integer_Type_Internal, 0); // For mingw482, because it complains, and for VS9, because of internal compiler errors. v.setInt_32((int)i); } else { v.setDouble(i); @@ -547,11 +547,11 @@ struct Encode { return quint64(Value::Undefined_Type) << Value::Tag_Shift; } static ReturnedValue null() { - return quint64(Value::_Null_Type) << Value::Tag_Shift; + return quint64(Value::Null_Type_Internal) << Value::Tag_Shift; } Encode(bool b) { - val = (quint64(Value::_Boolean_Type) << Value::Tag_Shift) | (uint)b; + val = (quint64(Value::Boolean_Type_Internal) << Value::Tag_Shift) | (uint)b; } Encode(double d) { Value v; @@ -559,11 +559,11 @@ struct Encode { val = v.rawValue(); } Encode(int i) { - val = (quint64(Value::_Integer_Type) << Value::Tag_Shift) | (uint)i; + val = (quint64(Value::Integer_Type_Internal) << Value::Tag_Shift) | (uint)i; } Encode(uint i) { if (i <= INT_MAX) { - val = (quint64(Value::_Integer_Type) << Value::Tag_Shift) | i; + val = (quint64(Value::Integer_Type_Internal) << Value::Tag_Shift) | i; } else { Value v; v.setDouble(i); |