build: Treat warnings as errors (#923)

* squash and rebase andronov-alexey:treat_warnings_as_errors from pull request #850
* fix remaining warnings in java lib
This commit is contained in:
Malte Langkabel
2020-02-14 16:34:04 +01:00
committed by GitHub
parent e5c1a118d7
commit a30f47e27f
112 changed files with 634 additions and 430 deletions
+7 -5
View File
@@ -625,7 +625,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
/*no ref here!*/ fileResults,
&collection,
&collectionMutex]() {
const int termLength = searchTerm.length();
const int termLength = static_cast<int>(searchTerm.length());
for (const FullTextSearchResult& fileResult: fileResults)
{
const FilePath filePath = getFileNodePath(fileResult.fileId);
@@ -639,7 +639,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
{
while (charsTotal + (int)line.length() <= pos)
{
charsTotal += line.length();
charsTotal += static_cast<int>(line.length());
lineNumber++;
line = codec.decode(fileContent->getLine(lineNumber));
}
@@ -655,7 +655,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
}
while ((charsTotal + (int)line.length()) < pos + termLength)
{
charsTotal += line.length();
charsTotal += static_cast<int>(line.length());
lineNumber++;
line = codec.decode(fileContent->getLine(lineNumber));
}
@@ -709,7 +709,7 @@ std::vector<SearchMatch> PersistentStorage::getAutocompletionMatches(
TRACE();
// search in indices
const size_t maxResultsCount = std::pow(3, query.size() + 3);
const size_t maxResultsCount = static_cast<size_t>(std::pow(3, query.size() + 3));
const size_t maxBestScoredResultsLength = 100;
const size_t maxMatchesReturned = 1000;
@@ -2280,7 +2280,9 @@ TooltipSnippet PersistentStorage::getTooltipSnippetForNode(const StorageNode& no
std::vector<Annotation> annotations;
std::vector<std::string> lines =
getFileContent(sigLoc->getFilePath(), false)
->getLines(sigLoc->getLineNumber(), sigLoc->getEndLocation()->getLineNumber());
->getLines(
static_cast<unsigned int>(sigLoc->getLineNumber()),
static_cast<unsigned int>(sigLoc->getEndLocation()->getLineNumber()));
// check if signature location refers to correct locations in the code
// wrongly recorded signature locations of implicit template methods in C++ caused crashes