aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-10-22 14:24:35 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-01-08 00:09:50 +0000
commit65fa1b4c0868ae4898e6753cecf2952dc87034ac (patch)
treecbd8bc0c18f2a11c021bf41a8cb6eaa5d5921c96
parentac47b1520ce9d60622f28c0be6c22aa1ae1bb15e (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>
-rw-r--r--src/qml/compiler/qv4jsir.cpp6
-rw-r--r--src/qml/jit/qv4assembler.cpp2
-rw-r--r--src/qml/jit/qv4assembler_p.h2
-rw-r--r--src/qml/jit/qv4isel_masm.cpp34
-rw-r--r--src/qml/jsruntime/qv4engine.cpp2
-rw-r--r--src/qml/jsruntime/qv4managed_p.h2
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h6
-rw-r--r--src/qml/jsruntime/qv4value_p.h46
-rw-r--r--src/qml/parser/qqmljsast_p.h8
-rw-r--r--src/qml/parser/qqmljsmemorypool_p.h2
10 files changed, 55 insertions, 55 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp
index 98b53c6b3b..685825e8ea 100644
--- a/src/qml/compiler/qv4jsir.cpp
+++ b/src/qml/compiler/qv4jsir.cpp
@@ -175,8 +175,8 @@ struct RemoveSharedExpressions: IR::StmtVisitor, IR::ExprVisitor
}
}
- template <typename _Expr>
- _Expr *cleanup(_Expr *expr)
+ template <typename Expr_>
+ Expr_ *cleanup(Expr_ *expr)
{
std::vector<Expr *>::iterator it = std::lower_bound(subexpressions.begin(), subexpressions.end(), expr);
if (it == subexpressions.end() || *it != expr) {
@@ -185,7 +185,7 @@ struct RemoveSharedExpressions: IR::StmtVisitor, IR::ExprVisitor
qSwap(uniqueExpr, e);
expr->accept(this);
qSwap(uniqueExpr, e);
- return static_cast<_Expr *>(e);
+ return static_cast<Expr_ *>(e);
}
// the cloned expression is unique by definition
diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp
index c949c424ea..929726f4b7 100644
--- a/src/qml/jit/qv4assembler.cpp
+++ b/src/qml/jit/qv4assembler.cpp
@@ -327,7 +327,7 @@ Assembler::Jump Assembler::genTryDoubleConversion(IR::Expr *src, Assembler::FPRe
// check if it's an int32:
Assembler::Jump isNoInt = branch32(Assembler::NotEqual, Assembler::ScratchRegister,
- Assembler::TrustedImm32(Value::_Integer_Type));
+ Assembler::TrustedImm32(Value::Integer_Type_Internal));
convertInt32ToDouble(toInt32Register(src, Assembler::ScratchRegister), dest);
Assembler::Jump intDone = jump();
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h
index 80e71ef13c..532a3114f2 100644
--- a/src/qml/jit/qv4assembler_p.h
+++ b/src/qml/jit/qv4assembler_p.h
@@ -1146,7 +1146,7 @@ public:
Pointer tagAddr = addr;
tagAddr.offset += 4;
load32(tagAddr, scratchReg);
- Jump inIntRange = branch32(Equal, scratchReg, TrustedImm32(QV4::Value::_Integer_Type));
+ Jump inIntRange = branch32(Equal, scratchReg, TrustedImm32(QV4::Value::Integer_Type_Internal));
// it's not in signed int range, so load it as a double, and truncate it down
loadDouble(addr, FPGpr0);
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 6de6524615..b6df5fb08c 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -959,10 +959,10 @@ void InstructionSelection::swapValues(IR::Expr *source, IR::Expr *target)
quint32 tag;
switch (regTemp->type) {
case IR::BoolType:
- tag = QV4::Value::_Boolean_Type;
+ tag = QV4::Value::Boolean_Type_Internal;
break;
case IR::SInt32Type:
- tag = QV4::Value::_Integer_Type;
+ tag = QV4::Value::Integer_Type_Internal;
break;
default:
tag = QV4::Value::Undefined_Type;
@@ -1096,7 +1096,7 @@ void InstructionSelection::convertTypeToDouble(IR::Expr *source, IR::Expr *targe
// check if it's an int32:
Assembler::Jump isNoInt = _as->branch32(Assembler::NotEqual, Assembler::ScratchRegister,
- Assembler::TrustedImm32(Value::_Integer_Type));
+ Assembler::TrustedImm32(Value::Integer_Type_Internal));
convertIntToDouble(source, target);
Assembler::Jump intDone = _as->jump();
@@ -1219,7 +1219,7 @@ void InstructionSelection::convertTypeToSInt32(IR::Expr *source, IR::Expr *targe
Assembler::Pointer targetAddr = _as->loadAddress(Assembler::ScratchRegister, target);
_as->store32(Assembler::ReturnValueRegister, targetAddr);
targetAddr.offset += 4;
- _as->store32(Assembler::TrustedImm32(Value::_Integer_Type), targetAddr);
+ _as->store32(Assembler::TrustedImm32(Value::Integer_Type_Internal), targetAddr);
} else {
_as->storeInt32(Assembler::ReturnValueRegister, target);
}
@@ -1232,14 +1232,14 @@ void InstructionSelection::convertTypeToSInt32(IR::Expr *source, IR::Expr *targe
// check if it's an int32:
Assembler::Jump fallback = _as->branch32(Assembler::NotEqual, Assembler::ReturnValueRegister,
- Assembler::TrustedImm32(Value::_Integer_Type));
+ Assembler::TrustedImm32(Value::Integer_Type_Internal));
IR::Temp *targetTemp = target->asTemp();
if (!targetTemp || targetTemp->kind == IR::Temp::StackSlot) {
_as->load32(addr, Assembler::ReturnValueRegister);
Assembler::Pointer targetAddr = _as->loadAddress(Assembler::ScratchRegister, target);
_as->store32(Assembler::ReturnValueRegister, targetAddr);
targetAddr.offset += 4;
- _as->store32(Assembler::TrustedImm32(Value::_Integer_Type), targetAddr);
+ _as->store32(Assembler::TrustedImm32(Value::Integer_Type_Internal), targetAddr);
} else {
_as->load32(addr, (Assembler::RegisterID) targetTemp->index);
}
@@ -1296,7 +1296,7 @@ void InstructionSelection::convertTypeToUInt32(IR::Expr *source, IR::Expr *targe
// check if it's an int32:
Assembler::Jump isNoInt = _as->branch32(Assembler::NotEqual, Assembler::ScratchRegister,
- Assembler::TrustedImm32(Value::_Integer_Type));
+ Assembler::TrustedImm32(Value::Integer_Type_Internal));
Assembler::Pointer addr = _as->loadAddress(Assembler::ScratchRegister, source);
_as->storeUInt32(_as->toInt32Register(addr, Assembler::ScratchRegister), target);
Assembler::Jump intDone = _as->jump();
@@ -1518,16 +1518,16 @@ void InstructionSelection::visitRet(IR::Ret *s)
Assembler::Jump done = _as->jump();
intRange.link(_as);
_as->move(srcReg, lowReg);
- _as->move(Assembler::TrustedImm32(QV4::Value::_Integer_Type), highReg);
+ _as->move(Assembler::TrustedImm32(QV4::Value::Integer_Type_Internal), highReg);
done.link(_as);
} break;
case IR::SInt32Type:
_as->move((Assembler::RegisterID) t->index, lowReg);
- _as->move(Assembler::TrustedImm32(QV4::Value::_Integer_Type), highReg);
+ _as->move(Assembler::TrustedImm32(QV4::Value::Integer_Type_Internal), highReg);
break;
case IR::BoolType:
_as->move((Assembler::RegisterID) t->index, lowReg);
- _as->move(Assembler::TrustedImm32(QV4::Value::_Boolean_Type), highReg);
+ _as->move(Assembler::TrustedImm32(QV4::Value::Boolean_Type_Internal), highReg);
break;
default:
Q_UNREACHABLE();
@@ -1556,7 +1556,7 @@ void InstructionSelection::visitRet(IR::Ret *s)
Assembler::Jump done = _as->jump();
intRange.link(_as);
_as->zeroExtend32ToPtr(srcReg, Assembler::ReturnValueRegister);
- quint64 tag = QV4::Value::_Integer_Type;
+ quint64 tag = QV4::Value::Integer_Type_Internal;
_as->or64(Assembler::TrustedImm64(tag << 32),
Assembler::ReturnValueRegister);
done.link(_as);
@@ -1565,10 +1565,10 @@ void InstructionSelection::visitRet(IR::Ret *s)
quint64 tag;
switch (t->type) {
case IR::SInt32Type:
- tag = QV4::Value::_Integer_Type;
+ tag = QV4::Value::Integer_Type_Internal;
break;
case IR::BoolType:
- tag = QV4::Value::_Boolean_Type;
+ tag = QV4::Value::Boolean_Type_Internal;
break;
default:
tag = QV4::Value::Undefined_Type;
@@ -1657,7 +1657,7 @@ int InstructionSelection::prepareCallData(IR::ExprList* args, IR::Expr *thisObje
}
Pointer p = _as->stackLayout().callDataAddress(qOffsetOf(CallData, tag));
- _as->store32(Assembler::TrustedImm32(QV4::Value::_Integer_Type), p);
+ _as->store32(Assembler::TrustedImm32(QV4::Value::Integer_Type_Internal), p);
p = _as->stackLayout().callDataAddress(qOffsetOf(CallData, argc));
_as->store32(Assembler::TrustedImm32(argc), p);
p = _as->stackLayout().callDataAddress(qOffsetOf(CallData, thisObject));
@@ -1836,7 +1836,7 @@ bool InstructionSelection::visitCJumpStrictNullUndefined(IR::Type nullOrUndef, I
Assembler::RelationalCondition cond = binop->op == IR::OpStrictEqual ? Assembler::Equal
: Assembler::NotEqual;
- const Assembler::TrustedImm32 tag(nullOrUndef == IR::NullType ? int(QV4::Value::_Null_Type)
+ const Assembler::TrustedImm32 tag(nullOrUndef == IR::NullType ? int(QV4::Value::Null_Type_Internal)
: int(QV4::Value::Undefined_Type));
_as->generateCJumpOnCompare(cond, tagReg, tag, _block, trueBlock, falseBlock);
return true;
@@ -1878,7 +1878,7 @@ bool InstructionSelection::visitCJumpStrictBool(IR::Binop *binop, IR::BasicBlock
// check if the tag of the var operand is indicates 'boolean'
_as->load32(otherAddr, Assembler::ScratchRegister);
Assembler::Jump noBool = _as->branch32(Assembler::NotEqual, Assembler::ScratchRegister,
- Assembler::TrustedImm32(QV4::Value::_Boolean_Type));
+ Assembler::TrustedImm32(QV4::Value::Boolean_Type_Internal));
if (binop->op == IR::OpStrictEqual)
_as->addPatch(falseBlock, noBool);
else
@@ -1927,7 +1927,7 @@ bool InstructionSelection::visitCJumpNullUndefined(IR::Type nullOrUndef, IR::Bin
if (binop->op == IR::OpNotEqual)
qSwap(trueBlock, falseBlock);
- Assembler::Jump isNull = _as->branch32(Assembler::Equal, tagReg, Assembler::TrustedImm32(int(QV4::Value::_Null_Type)));
+ Assembler::Jump isNull = _as->branch32(Assembler::Equal, tagReg, Assembler::TrustedImm32(int(QV4::Value::Null_Type_Internal)));
Assembler::Jump isUndefined = _as->branch32(Assembler::Equal, tagReg, Assembler::TrustedImm32(int(QV4::Value::Undefined_Type)));
_as->addPatch(trueBlock, isNull);
_as->addPatch(trueBlock, isUndefined);
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);
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index fa6b5d2488..3987f6093a 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -103,11 +103,11 @@ namespace QQmlJS {
namespace AST {
-template <typename _T1, typename _T2>
-_T1 cast(_T2 *ast)
+template <typename T1, typename T2>
+T1 cast(T2 *ast)
{
- if (ast && ast->kind == static_cast<_T1>(0)->K)
- return static_cast<_T1>(ast);
+ if (ast && ast->kind == static_cast<T1>(0)->K)
+ return static_cast<T1>(ast);
return 0;
}
diff --git a/src/qml/parser/qqmljsmemorypool_p.h b/src/qml/parser/qqmljsmemorypool_p.h
index c7ac5919bd..ae9f1d8257 100644
--- a/src/qml/parser/qqmljsmemorypool_p.h
+++ b/src/qml/parser/qqmljsmemorypool_p.h
@@ -102,7 +102,7 @@ public:
_ptr = _end = 0;
}
- template <typename _Tp> _Tp *New() { return new (this->allocate(sizeof(_Tp))) _Tp(); }
+ template <typename Tp> Tp *New() { return new (this->allocate(sizeof(Tp))) Tp(); }
private:
void *allocate_helper(size_t size)