Fix deprecated casting style lint errors.
Change-Id: I9130a25f99f6b57537d5609739384a269ed4d12b
Reviewed-on: https://pdfium-review.googlesource.com/c/48452
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index f2c8e18..57b1eb1 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -1788,10 +1788,10 @@
// getting the same answer as before is desirable.
// All floats from 0.0 to 1.0 were tested and now give the same results.
const float rounding_offset = 0.49999997f;
- uint8_t c1 = int(c * 255.f + rounding_offset);
- uint8_t m1 = int(m * 255.f + rounding_offset);
- uint8_t y1 = int(y * 255.f + rounding_offset);
- uint8_t k1 = int(k * 255.f + rounding_offset);
+ uint8_t c1 = static_cast<int>(c * 255.f + rounding_offset);
+ uint8_t m1 = static_cast<int>(m * 255.f + rounding_offset);
+ uint8_t y1 = static_cast<int>(y * 255.f + rounding_offset);
+ uint8_t k1 = static_cast<int>(k * 255.f + rounding_offset);
ASSERT(c1 == FXSYS_round(c * 255));
ASSERT(m1 == FXSYS_round(m * 255));
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp
index e1b0bfb..d5296e5 100644
--- a/xfa/fwl/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -407,9 +407,9 @@
fDayMaxW = (fDayMaxW >= sz.width) ? fDayMaxW : sz.width;
fDayMaxH = (fDayMaxH >= sz.height) ? fDayMaxH : sz.height;
}
- m_szCell.width = float((fMaxWeekW >= fDayMaxW) ? (int)(fMaxWeekW + 0.5)
- : (int)(fDayMaxW + 0.5));
- m_szCell.height = (fMaxWeekH >= fDayMaxH) ? fMaxWeekH : fDayMaxH;
+ m_szCell.width =
+ static_cast<int>(0.5 + (fMaxWeekW >= fDayMaxW ? fMaxWeekW : fDayMaxW));
+ m_szCell.height = fMaxWeekH >= fDayMaxH ? fMaxWeekH : fDayMaxH;
CFX_SizeF fs;
fs.width = m_szCell.width * MONTHCAL_COLUMNS +