[clang-tools-extra] r335209 - Fix double-float constant truncation warnings. NFCI.
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 21 00:54:47 PDT 2018
Author: rksimon
Date: Thu Jun 21 00:54:47 2018
New Revision: 335209
URL: http://llvm.org/viewvc/llvm-project?rev=335209&view=rev
Log:
Fix double-float constant truncation warnings. NFCI.
Modified:
clang-tools-extra/trunk/unittests/clangd/QualityTests.cpp
Modified: clang-tools-extra/trunk/unittests/clangd/QualityTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/QualityTests.cpp?rev=335209&r1=335208&r2=335209&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/QualityTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/QualityTests.cpp Thu Jun 21 00:54:47 2018
@@ -97,13 +97,13 @@ TEST(QualityTests, SymbolRelevanceSignal
Relevance = {};
Relevance.merge(CodeCompletionResult(&findDecl(AST, "main"), 42));
- EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 1.0) << "Decl in current file";
+ EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 1.0f) << "Decl in current file";
Relevance = {};
Relevance.merge(CodeCompletionResult(&findDecl(AST, "header"), 42));
- EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 0.6) << "Decl from header";
+ EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 0.6f) << "Decl from header";
Relevance = {};
Relevance.merge(CodeCompletionResult(&findDecl(AST, "header_main"), 42));
- EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 1.0)
+ EXPECT_FLOAT_EQ(Relevance.SemaProximityScore, 1.0f)
<< "Current file and header";
Relevance = {};
@@ -186,7 +186,7 @@ std::string joinPaths(llvm::ArrayRef<Str
llvm::join(Parts.begin(), Parts.end(), llvm::sys::path::get_separator()));
}
-static constexpr float ProximityBase = 0.7;
+static constexpr float ProximityBase = 0.7f;
// Calculates a proximity score for an index symbol with declaration file
// SymPath with the given URI scheme.
More information about the cfe-commits
mailing list