[clang-tools-extra] r345184 - Fix MSVC "truncation from 'double' to 'float'" warnings. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 12:31:24 PDT 2018


Author: rksimon
Date: Wed Oct 24 12:31:24 2018
New Revision: 345184

URL: http://llvm.org/viewvc/llvm-project?rev=345184&view=rev
Log:
Fix MSVC "truncation from 'double' to 'float'" warnings. NFCI.

Modified:
    clang-tools-extra/trunk/clangd/Quality.cpp

Modified: clang-tools-extra/trunk/clangd/Quality.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Quality.cpp?rev=345184&r1=345183&r2=345184&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.cpp (original)
+++ clang-tools-extra/trunk/clangd/Quality.cpp Wed Oct 24 12:31:24 2018
@@ -373,15 +373,15 @@ float SymbolRelevanceSignals::evaluate()
   if (!IsInstanceMember &&
       (Context == CodeCompletionContext::CCC_DotMemberAccess ||
        Context == CodeCompletionContext::CCC_ArrowMemberAccess)) {
-    Score *= 0.2;
+    Score *= 0.2f;
   }
 
   if (InBaseClass)
-    Score *= 0.5;
+    Score *= 0.5f;
 
   // Penalize for FixIts.
   if (NeedsFixIts)
-    Score *= 0.5;
+    Score *= 0.5f;
 
   return Score;
 }




More information about the cfe-commits mailing list