qdoc: Fix const correctness in old style casts
Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c94687a79b3f40 Reviewed-by: Martin Smith <martin.smith@digia.com>bb10
parent
a0e693b1e8
commit
6b38d9fa77
|
|
@ -396,7 +396,7 @@ QString Config::getString(const QString& var) const
|
|||
while (i >= 0) {
|
||||
const ConfigVar& cv = configVars[i];
|
||||
if (!cv.location_.isEmpty())
|
||||
(Location&) lastLocation_ = cv.location_;
|
||||
const_cast<Config *>(this)->lastLocation_ = cv.location_;
|
||||
if (!cv.values_.isEmpty()) {
|
||||
if (!cv.plus_)
|
||||
value.clear();
|
||||
|
|
@ -443,7 +443,7 @@ QStringList Config::getStringList(const QString& var) const
|
|||
int i = configVars.size() - 1;
|
||||
while (i >= 0) {
|
||||
if (!configVars[i].location_.isEmpty())
|
||||
(Location&) lastLocation_ = configVars[i].location_;
|
||||
const_cast<Config *>(this)->lastLocation_ = configVars[i].location_;
|
||||
if (configVars[i].plus_)
|
||||
values.append(configVars[i].values_);
|
||||
else
|
||||
|
|
@ -478,7 +478,7 @@ QStringList Config::getCanonicalPathList(const QString& var, bool validate) cons
|
|||
while (i >= 0) {
|
||||
const ConfigVar& cv = configVars[i];
|
||||
if (!cv.location_.isEmpty())
|
||||
(Location&) lastLocation_ = cv.location_;
|
||||
const_cast<Config *>(this)->lastLocation_ = cv.location_;
|
||||
if (!cv.plus_)
|
||||
t.clear();
|
||||
const QString d = cv.currentPath_;
|
||||
|
|
|
|||
|
|
@ -788,63 +788,63 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
|
|||
|
||||
NodeMultiMap::const_iterator n = nsmap.constBegin();
|
||||
while (n != nsmap.constEnd()) {
|
||||
const Node* node = n.value();
|
||||
Node* node = n.value();
|
||||
switch (node->type()) {
|
||||
case Node::QmlType:
|
||||
sections[QmlClass].appendMember((Node*)node);
|
||||
sections[QmlClass].appendMember(node);
|
||||
break;
|
||||
case Node::Namespace:
|
||||
sections[Namespace].appendMember((Node*)node);
|
||||
sections[Namespace].appendMember(node);
|
||||
break;
|
||||
case Node::Class:
|
||||
sections[Class].appendMember((Node*)node);
|
||||
sections[Class].appendMember(node);
|
||||
break;
|
||||
case Node::Enum:
|
||||
sections[Enum].appendMember((Node*)node);
|
||||
sections[Enum].appendMember(node);
|
||||
break;
|
||||
case Node::Typedef:
|
||||
sections[Typedef].appendMember((Node*)node);
|
||||
sections[Typedef].appendMember(node);
|
||||
break;
|
||||
case Node::Function: {
|
||||
const FunctionNode* fn = static_cast<const FunctionNode*>(node);
|
||||
if (fn->isMacro())
|
||||
sections[Macro].appendMember((Node*)node);
|
||||
sections[Macro].appendMember(node);
|
||||
else {
|
||||
Node* p = fn->parent();
|
||||
if (p) {
|
||||
if (p->type() == Node::Class)
|
||||
sections[MemberFunction].appendMember((Node*)node);
|
||||
sections[MemberFunction].appendMember(node);
|
||||
else if (p->type() == Node::Namespace) {
|
||||
if (p->name().isEmpty())
|
||||
sections[GlobalFunction].appendMember((Node*)node);
|
||||
sections[GlobalFunction].appendMember(node);
|
||||
else
|
||||
sections[NamespaceFunction].appendMember((Node*)node);
|
||||
sections[NamespaceFunction].appendMember(node);
|
||||
}
|
||||
else
|
||||
sections[GlobalFunction].appendMember((Node*)node);
|
||||
sections[GlobalFunction].appendMember(node);
|
||||
}
|
||||
else
|
||||
sections[GlobalFunction].appendMember((Node*)node);
|
||||
sections[GlobalFunction].appendMember(node);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Node::Property:
|
||||
sections[Property].appendMember((Node*)node);
|
||||
sections[Property].appendMember(node);
|
||||
break;
|
||||
case Node::Variable:
|
||||
sections[Variable].appendMember((Node*)node);
|
||||
sections[Variable].appendMember(node);
|
||||
break;
|
||||
case Node::QmlProperty:
|
||||
sections[QmlProperty].appendMember((Node*)node);
|
||||
sections[QmlProperty].appendMember(node);
|
||||
break;
|
||||
case Node::QmlSignal:
|
||||
sections[QmlSignal].appendMember((Node*)node);
|
||||
sections[QmlSignal].appendMember(node);
|
||||
break;
|
||||
case Node::QmlSignalHandler:
|
||||
sections[QmlSignalHandler].appendMember((Node*)node);
|
||||
sections[QmlSignalHandler].appendMember(node);
|
||||
break;
|
||||
case Node::QmlMethod:
|
||||
sections[QmlMethod].appendMember((Node*)node);
|
||||
sections[QmlMethod].appendMember(node);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -807,7 +807,7 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name) const
|
|||
that the function has the same name and signature as the
|
||||
\a clone node.
|
||||
*/
|
||||
FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone)
|
||||
FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const
|
||||
{
|
||||
QMap<QString,Node*>::ConstIterator c = primaryFunctionMap.constFind(clone->name());
|
||||
if (c != primaryFunctionMap.constEnd()) {
|
||||
|
|
@ -857,7 +857,7 @@ QStringList InnerNode::secondaryKeys()
|
|||
|
||||
/*!
|
||||
*/
|
||||
void InnerNode::setOverload(const FunctionNode *func, bool overlode)
|
||||
void InnerNode::setOverload(FunctionNode *func, bool overlode)
|
||||
{
|
||||
Node *node = (Node *) func;
|
||||
Node *&primary = primaryFunctionMap[func->name()];
|
||||
|
|
@ -1017,7 +1017,7 @@ const EnumNode *InnerNode::findEnumNodeForValue(const QString &enumValue) const
|
|||
*/
|
||||
int InnerNode::overloadNumber(const FunctionNode *func) const
|
||||
{
|
||||
Node *node = (Node *) func;
|
||||
Node *node = const_cast<FunctionNode *>(func);
|
||||
if (primaryFunctionMap[func->name()] == node) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,10 +376,10 @@ public:
|
|||
Node* findChildNode(const QString& name, Type type);
|
||||
virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE;
|
||||
FunctionNode* findFunctionNode(const QString& name) const;
|
||||
FunctionNode* findFunctionNode(const FunctionNode* clone);
|
||||
FunctionNode* findFunctionNode(const FunctionNode* clone) const;
|
||||
void addInclude(const QString &include);
|
||||
void setIncludes(const QStringList &includes);
|
||||
void setOverload(const FunctionNode* func, bool overlode);
|
||||
void setOverload(FunctionNode* func, bool overlode);
|
||||
void normalizeOverloads();
|
||||
void makeUndocumentedChildrenInternal();
|
||||
void deleteChildren();
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Functi
|
|||
parent = findNode(parentPath, 0, 0, Node::DontCare);
|
||||
if (parent == 0 || !parent->isInnerNode())
|
||||
return 0;
|
||||
return ((InnerNode*)parent)->findFunctionNode(clone);
|
||||
return ((const InnerNode*)parent)->findFunctionNode(clone);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -249,9 +249,9 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path,
|
|||
|
||||
const Node* next;
|
||||
if (i == path.size() - 1)
|
||||
next = ((InnerNode*) node)->findFunctionNode(path.at(i));
|
||||
next = ((const InnerNode*) node)->findFunctionNode(path.at(i));
|
||||
else
|
||||
next = ((InnerNode*) node)->findChildNode(path.at(i), genus);
|
||||
next = ((const InnerNode*) node)->findChildNode(path.at(i), genus);
|
||||
|
||||
if (!next && node->isClass() && (findFlags & SearchBaseClasses)) {
|
||||
NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node));
|
||||
|
|
|
|||
Loading…
Reference in New Issue