[Lldb-commits] [lldb] 23f29b2 - Revert "Silence warnings around int/float conversions."
Dmitri Gribenko via lldb-commits
lldb-commits at lists.llvm.org
Wed May 20 03:46:50 PDT 2020
Author: Dmitri Gribenko
Date: 2020-05-20T12:44:19+02:00
New Revision: 23f29b2fcc5668c51f15809067a1c3503b422c64
URL: https://github.com/llvm/llvm-project/commit/23f29b2fcc5668c51f15809067a1c3503b422c64
DIFF: https://github.com/llvm/llvm-project/commit/23f29b2fcc5668c51f15809067a1c3503b422c64.diff
LOG: Revert "Silence warnings around int/float conversions."
This reverts commit 15ee8a3a58223b48afbe33cb60084f864ef20889. It is a
follow-up to b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm
reverting -- see the explanation in that revert.
Added:
Modified:
lldb/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/unittests/DataFormatter/MockTests.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 37b352263260..1ad443b8b74e 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -794,8 +794,8 @@ bool lldb_private::formatters::NSDate::FormatDateValue(double date_value,
return true;
}
- if ((time_t)date_value > std::numeric_limits<time_t>::max() ||
- (time_t)date_value < std::numeric_limits<time_t>::min())
+ if (date_value > std::numeric_limits<time_t>::max() ||
+ date_value < std::numeric_limits<time_t>::min())
return false;
time_t epoch = GetOSXEpoch();
diff --git a/lldb/unittests/DataFormatter/MockTests.cpp b/lldb/unittests/DataFormatter/MockTests.cpp
index f7daaf22d140..1185d7bf2c9c 100644
--- a/lldb/unittests/DataFormatter/MockTests.cpp
+++ b/lldb/unittests/DataFormatter/MockTests.cpp
@@ -28,14 +28,14 @@ TEST(DataFormatterMockTest, NSDate) {
EXPECT_EQ(*formatDateValue(-63114076800), "0001-12-30 00:00:00 +0000");
// Can't convert the date_value to a time_t.
- EXPECT_EQ(formatDateValue((double)(std::numeric_limits<time_t>::max()) + 1),
+ EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::max() + 1),
llvm::None);
- EXPECT_EQ(formatDateValue((double)(std::numeric_limits<time_t>::min()) - 1),
+ EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::min() - 1),
llvm::None);
// Can't add the macOS epoch to the converted date_value (the add overflows).
- EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::max()), llvm::None);
- EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::min()), llvm::None);
+ EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::max()), llvm::None);
+ EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::min()), llvm::None);
// FIXME: The formatting result is wrong on Windows because we adjust the
// epoch when _WIN32 is defined (see GetOSXEpoch).
More information about the lldb-commits
mailing list