build: fixed clang warnings and console errors
This commit is contained in:
@@ -102,9 +102,9 @@ MatrixDynamicBase<unsigned int> QtGraphPostprocessor::buildHeatMap(const std::li
|
||||
if(up + height > heatMapHeight || up < 0)
|
||||
continue;
|
||||
|
||||
for(unsigned int i = 0; i < width; i++)
|
||||
for(int i = 0; i < width; i++)
|
||||
{
|
||||
for(unsigned int j = 0; j < height; j++)
|
||||
for(int j = 0; j < height; j++)
|
||||
{
|
||||
unsigned int x = left + i;
|
||||
unsigned int y = up + j;
|
||||
@@ -153,7 +153,7 @@ void QtGraphPostprocessor::resolveOverlap(std::list<std::shared_ptr<QtGraphNode>
|
||||
|
||||
// handle overlap with no gradient
|
||||
// e.g. when a node lies completely on top of another
|
||||
float gradLength = grad.getLength();
|
||||
// float gradLength = grad.getLength();
|
||||
|
||||
if(grad.getLengthSquared() <= 0.000001f)
|
||||
{
|
||||
@@ -203,19 +203,19 @@ void QtGraphPostprocessor::modifyHeatmapArea(MatrixDynamicBase<unsigned int>& he
|
||||
{
|
||||
bool wentOutOfRange = false;
|
||||
|
||||
for(unsigned int i = 0; i < size.x; i++)
|
||||
for(int i = 0; i < size.x; i++)
|
||||
{
|
||||
for(unsigned int j = 0; j < size.y; j++)
|
||||
for(int j = 0; j < size.y; j++)
|
||||
{
|
||||
int x = leftUpperCorner.x + i;
|
||||
int y = leftUpperCorner.y + j;
|
||||
|
||||
if(x < 0 || x > heatMap.getColumnsCount()-1)
|
||||
if(x < 0 || x > static_cast<int>(heatMap.getColumnsCount()-1))
|
||||
{
|
||||
wentOutOfRange = true;
|
||||
continue;
|
||||
}
|
||||
if(y < 0 || y > heatMap.getRowsCount()-1)
|
||||
if(y < 0 || y > static_cast<int>(heatMap.getRowsCount()-1))
|
||||
{
|
||||
wentOutOfRange = true;
|
||||
continue;
|
||||
@@ -236,17 +236,17 @@ bool QtGraphPostprocessor::getHeatmapGradient(Vec2f& outGradient, const MatrixDy
|
||||
{
|
||||
bool overlap = false;
|
||||
|
||||
for(unsigned int i = 0; i < size.x; i++)
|
||||
for(int i = 0; i < size.x; i++)
|
||||
{
|
||||
for(unsigned int j = 0; j < size.y; j++)
|
||||
for(int j = 0; j < size.y; j++)
|
||||
{
|
||||
int x = leftUpperCorner.x + i;
|
||||
int y = leftUpperCorner.y + j;
|
||||
|
||||
// if x and y lie directly at the border not all 4 neighbours can be checked
|
||||
if(x < 1 || x > heatMap.getColumnsCount()-2)
|
||||
if(x < 1 || x > static_cast<int>(heatMap.getColumnsCount()-2))
|
||||
continue;
|
||||
if(y < 1 || y > heatMap.getRowsCount()-2)
|
||||
if(y < 1 || y > static_cast<int>(heatMap.getRowsCount()-2))
|
||||
continue;
|
||||
|
||||
float val = heatMap.getValue(x, y);
|
||||
@@ -278,7 +278,7 @@ bool QtGraphPostprocessor::getHeatmapGradient(Vec2f& outGradient, const MatrixDy
|
||||
void QtGraphPostprocessor::resizeNodes(std::list<std::shared_ptr<QtGraphNode>>& nodes, const unsigned int atomarSize)
|
||||
{
|
||||
std::list<std::shared_ptr<QtGraphNode>>::iterator it = nodes.begin();
|
||||
for(it; it != nodes.end(); it++)
|
||||
for(; it != nodes.end(); it++)
|
||||
{
|
||||
Vec2i size = (*it)->getSize();
|
||||
if(size.x % atomarSize != 0)
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ void Project::parseCode()
|
||||
{
|
||||
// Add the SourcePaths as HeaderSearchPaths as well, so clang will also look here when searching include files.
|
||||
std::vector<std::string> headerSearchPaths = ProjectSettings::getInstance()->getHeaderSearchPaths();
|
||||
for (int i = 0; i < includePaths.size(); i++)
|
||||
for (size_t i = 0; i < includePaths.size(); i++)
|
||||
{
|
||||
headerSearchPaths.push_back(includePaths[i]);
|
||||
}
|
||||
|
||||
+50
-30
@@ -146,7 +146,7 @@ void Storage::onError(const ParseLocation& location, const std::string& message)
|
||||
{
|
||||
Id errorId = m_errorMessages.size();
|
||||
|
||||
TokenLocation* loc = m_errorLocationCollection.addTokenLocation(
|
||||
m_errorLocationCollection.addTokenLocation(
|
||||
errorId, filePath,
|
||||
location.startLineNumber, location.startColumnNumber,
|
||||
location.endLineNumber, location.endColumnNumber
|
||||
@@ -493,52 +493,72 @@ Id Storage::onTypeUsageParsed(const ParseTypeUsage& type, const ParseVariable& v
|
||||
Id Storage::onTemplateRecordParameterTypeParsed(
|
||||
const ParseLocation& location, const std::string& templateParameterTypeName,
|
||||
const std::vector<std::string>& templateRecordNameHierarchy
|
||||
)
|
||||
{
|
||||
){
|
||||
log("template record type parameter", templateParameterTypeName, location);
|
||||
|
||||
std::vector<std::string> templateParameterTypeNameHierarchy = templateRecordNameHierarchy;
|
||||
templateParameterTypeNameHierarchy.back() += "::" + templateParameterTypeName;
|
||||
Node* templateParameterNode = addNodeHierarchy(Node::NODE_TEMPLATE_PARAMETER_TYPE, templateParameterTypeNameHierarchy);
|
||||
addTokenLocation(templateParameterNode, location);
|
||||
|
||||
Node* templateRecordNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, templateRecordNameHierarchy);
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_PARAMETER_OF, templateParameterNode, templateRecordNode);
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_PARAMETER_OF, templateParameterNode, templateRecordNode);
|
||||
|
||||
return 0;
|
||||
return templateParameterNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::onTemplateRecordArgumentTypeParsed(
|
||||
const ParseLocation& location, const std::vector<std::string>& templateArgumentTypeNameHierarchy,
|
||||
const std::vector<std::string>& templateRecordNameHierarchy)
|
||||
{
|
||||
log("template record argument", utility::join(templateArgumentTypeNameHierarchy, "::") + " -> " + utility::join(templateRecordNameHierarchy, "::"), location);
|
||||
const std::vector<std::string>& templateRecordNameHierarchy
|
||||
){
|
||||
log(
|
||||
"template record argument",
|
||||
utility::join(templateArgumentTypeNameHierarchy, "::") + " -> " + utility::join(templateRecordNameHierarchy, "::"),
|
||||
location
|
||||
);
|
||||
|
||||
Node* templateArgumentNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, templateArgumentTypeNameHierarchy);
|
||||
Node* templateRecordNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, templateRecordNameHierarchy);
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_ARGUMENT_OF, templateArgumentNode, templateRecordNode);
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_ARGUMENT_OF, templateArgumentNode, templateRecordNode);
|
||||
|
||||
if (location.isValid())
|
||||
{
|
||||
addTokenLocation(templateArgumentNode, location);
|
||||
}
|
||||
return 0;
|
||||
|
||||
return templateArgumentNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::onTemplateDefaultArgumentTypeParsed(
|
||||
const ParseTypeUsage& defaultArgumentType, const std::vector<std::string>& templateArgumentTypeNameHierarchy)
|
||||
{
|
||||
log("template default argument", utility::join(defaultArgumentType.dataType.getTypeNameHierarchy(), "::") + " -> " + utility::join(templateArgumentTypeNameHierarchy, "::"), defaultArgumentType.location);
|
||||
Node* templateDefaultArgumentNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, defaultArgumentType.dataType.getTypeNameHierarchy());
|
||||
addTokenLocation(templateDefaultArgumentNode, defaultArgumentType.location);
|
||||
Node* templateArgumentNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, templateArgumentTypeNameHierarchy);
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_DEFAULT_ARGUMENT_OF, templateDefaultArgumentNode, templateArgumentNode);
|
||||
const ParseTypeUsage& defaultArgumentType, const std::vector<std::string>& templateArgumentTypeNameHierarchy
|
||||
){
|
||||
log(
|
||||
"template default argument",
|
||||
utility::join(defaultArgumentType.dataType.getTypeNameHierarchy(), "::") +
|
||||
" -> " + utility::join(templateArgumentTypeNameHierarchy, "::"),
|
||||
defaultArgumentType.location
|
||||
);
|
||||
|
||||
return 0;
|
||||
Node* templateDefaultArgumentNode =
|
||||
addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, defaultArgumentType.dataType.getTypeNameHierarchy());
|
||||
addTokenLocation(templateDefaultArgumentNode, defaultArgumentType.location);
|
||||
|
||||
Node* templateArgumentNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, templateArgumentTypeNameHierarchy);
|
||||
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_DEFAULT_ARGUMENT_OF, templateDefaultArgumentNode, templateArgumentNode);
|
||||
|
||||
return templateDefaultArgumentNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::onTemplateRecordSpecializationParsed(
|
||||
const ParseLocation& location, const std::vector<std::string>& specializedRecordNameHierarchy,
|
||||
const RecordType specializedRecordType, const std::vector<std::string>& specializedFromNameHierarchy)
|
||||
{
|
||||
log("template record specialization", utility::join(specializedRecordNameHierarchy, "::") + " -> " + utility::join(specializedFromNameHierarchy, "::"), location);
|
||||
const RecordType specializedRecordType, const std::vector<std::string>& specializedFromNameHierarchy
|
||||
){
|
||||
log(
|
||||
"template record specialization",
|
||||
utility::join(specializedRecordNameHierarchy, "::") + " -> " + utility::join(specializedFromNameHierarchy, "::"),
|
||||
location
|
||||
);
|
||||
|
||||
Node::NodeType specializedRecordNodeType = Node::NODE_CLASS;
|
||||
if (specializedRecordType == ParserClient::RECORD_STRUCT)
|
||||
@@ -549,16 +569,15 @@ Id Storage::onTemplateRecordSpecializationParsed(
|
||||
Node* specializedRecordNode = addNodeHierarchy(specializedRecordNodeType, specializedRecordNameHierarchy);
|
||||
Node* templateRecordNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, specializedFromNameHierarchy);
|
||||
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, specializedRecordNode, templateRecordNode);
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, specializedRecordNode, templateRecordNode);
|
||||
//addTokenLocation(edge, location);
|
||||
|
||||
return 0;
|
||||
return specializedRecordNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::onTemplateFunctionParameterTypeParsed(
|
||||
const ParseLocation& location, const std::string& templateParameterTypeName, const ParseFunction function
|
||||
)
|
||||
{
|
||||
){
|
||||
log("function template type parameter", templateParameterTypeName, location);
|
||||
|
||||
std::vector<std::string> templateParameterTypeNameHierarchy;
|
||||
@@ -568,9 +587,9 @@ Id Storage::onTemplateFunctionParameterTypeParsed(
|
||||
|
||||
Node* templateFunctionNode = addNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED_FUNCTION, function);
|
||||
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_PARAMETER_OF, templateParameterNode, templateFunctionNode);
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_PARAMETER_OF, templateParameterNode, templateFunctionNode);
|
||||
|
||||
return 0;
|
||||
return templateParameterNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::onTemplateFunctionSpecializationParsed(
|
||||
@@ -582,9 +601,9 @@ Id Storage::onTemplateFunctionSpecializationParsed(
|
||||
Node* specializedFunctionNode = addNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED_FUNCTION, specializedFunction);
|
||||
Node* templateFunctionNode = addNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED_FUNCTION, templateFunction);
|
||||
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, specializedFunctionNode, templateFunctionNode);
|
||||
m_graph.createEdge(Edge::EDGE_TEMPLATE_SPECIALIZATION_OF, specializedFunctionNode, templateFunctionNode);
|
||||
|
||||
return 0;
|
||||
return specializedFunctionNode->getId();
|
||||
}
|
||||
|
||||
Id Storage::getIdForNodeWithName(const std::string& fullName) const
|
||||
@@ -998,7 +1017,7 @@ TokenComponentAccess* Storage::addAccess(Node* node, ParserClient::AccessType ac
|
||||
Edge* edge = node->getMemberEdge();
|
||||
if (!edge)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Cannot assign access" << access << " to node " << node->getFullName() << " because it is not a child.");
|
||||
LOG_ERROR_STREAM(<< "Cannot assign access" << access << " to node " << node->getFullName() << " because it's no child.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -1083,6 +1102,7 @@ bool Storage::getQuerySearchResults(const std::string& query, const std::string&
|
||||
switch (QueryOperator::getOperatorType(q.back()))
|
||||
{
|
||||
case QueryOperator::OPERATOR_AND:
|
||||
case QueryOperator::OPERATOR_OR:
|
||||
case QueryOperator::OPERATOR_NOT:
|
||||
q.pop_back();
|
||||
return false;
|
||||
|
||||
@@ -137,6 +137,8 @@ std::string Edge::getTypeString(EdgeType type) const
|
||||
return "template parameter";
|
||||
case EDGE_TEMPLATE_ARGUMENT_OF:
|
||||
return "template argument";
|
||||
case EDGE_TEMPLATE_DEFAULT_ARGUMENT_OF:
|
||||
return "template default argument";
|
||||
case EDGE_TEMPLATE_SPECIALIZATION_OF:
|
||||
return "template specialization";
|
||||
case EDGE_AGGREGATION:
|
||||
@@ -253,6 +255,14 @@ bool Edge::checkType() const
|
||||
}
|
||||
return true;
|
||||
|
||||
case EDGE_TEMPLATE_ARGUMENT_OF:
|
||||
case EDGE_TEMPLATE_DEFAULT_ARGUMENT_OF:
|
||||
if (!m_from->isType(typeMask) || !m_to->isType(typeMask))
|
||||
{
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
case EDGE_TEMPLATE_SPECIALIZATION_OF:
|
||||
if (!m_from->isType(typeMask | functionMask) || !m_to->isType(typeMask | functionMask))
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@ bool ASTVisitor::VisitClassTemplateDecl(clang::ClassTemplateDecl* declaration)
|
||||
);
|
||||
|
||||
const clang::TemplateArgumentList &argList = specializationDecl->getTemplateArgs();
|
||||
for (int i = 0; i < argList.size(); i++)
|
||||
for (size_t i = 0; i < argList.size(); i++)
|
||||
{
|
||||
std::vector<std::string> argumentNameHierarchy = utility::templateArgumentToDataType(argList.get(i)).getTypeNameHierarchy();
|
||||
if (argumentNameHierarchy.size()) // FIXME: Some TemplateArgument kinds are not handled yet.
|
||||
@@ -375,7 +375,7 @@ bool ASTVisitor::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplat
|
||||
}
|
||||
|
||||
const clang::ASTTemplateArgumentListInfo* argumentInfoList = declaration->getTemplateArgsAsWritten();
|
||||
for (int i = 0; i < argumentInfoList->NumTemplateArgs; i++)
|
||||
for (size_t i = 0; i < argumentInfoList->NumTemplateArgs; i++)
|
||||
{
|
||||
const clang::TemplateArgumentLoc& argumentLoc = argumentInfoList->operator[](i);
|
||||
const clang::QualType argumentType = argumentLoc.getArgument().getAsType();
|
||||
|
||||
@@ -47,7 +47,7 @@ void FileManager::fetchFilePaths()
|
||||
pathsExtensionsPairs.push_back(std::make_pair(m_includePaths, m_includeExtensions));
|
||||
pathsExtensionsPairs.push_back(std::make_pair(m_sourcePaths, m_sourceExtensions));
|
||||
|
||||
for (int i = 0; i < pathsExtensionsPairs.size(); i++)
|
||||
for (size_t i = 0; i < pathsExtensionsPairs.size(); i++)
|
||||
{
|
||||
std::vector<FileInfo> fileInfos = FileSystem::getFileInfosFromDirectoryPaths(pathsExtensionsPairs[i].first, pathsExtensionsPairs[i].second);
|
||||
for (FileInfo fileInfo: fileInfos)
|
||||
|
||||
Reference in New Issue
Block a user