[PATCH] D39597: [Support][Chrono] Use explicit cast of text output of time values.

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 15:02:31 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL317523: [Support][Chrono] Use explicit cast of text output of time values. (authored by sdardis).

Repository:
  rL LLVM

https://reviews.llvm.org/D39597

Files:
  llvm/trunk/lib/Support/Chrono.cpp


Index: llvm/trunk/lib/Support/Chrono.cpp
===================================================================
--- llvm/trunk/lib/Support/Chrono.cpp
+++ llvm/trunk/lib/Support/Chrono.cpp
@@ -65,17 +65,17 @@
     if (Style[I] == '%' && Style.size() > I + 1) switch (Style[I + 1]) {
         case 'L':  // Milliseconds, from Ruby.
           FStream << llvm::format(
-              "%.3lu", duration_cast<milliseconds>(Fractional).count());
+              "%.3lu", (long)duration_cast<milliseconds>(Fractional).count());
           ++I;
           continue;
         case 'f':  // Microseconds, from Python.
           FStream << llvm::format(
-              "%.6lu", duration_cast<microseconds>(Fractional).count());
+              "%.6lu", (long)duration_cast<microseconds>(Fractional).count());
           ++I;
           continue;
         case 'N':  // Nanoseconds, from date(1).
           FStream << llvm::format(
-              "%.6lu", duration_cast<nanoseconds>(Fractional).count());
+              "%.6lu", (long)duration_cast<nanoseconds>(Fractional).count());
           ++I;
           continue;
         case '%':  // Consume %%, so %%f parses as (%%)f not %(%f)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39597.121796.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171106/c6b262a9/attachment.bin>


More information about the llvm-commits mailing list