summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qlocaltime.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-03-20 12:33:02 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-06-12 13:11:26 +0000
commitb209f943d2611fa4ac2dd9c64b1a014182b59a3d (patch)
tree744bb5708a5a52438aef7cba1ffb96d5c3a051eb /src/corelib/time/qlocaltime.cpp
parente86e2752845ede635840851198c334f550fafb8f (diff)
Replace {add,sub,mul}_overload with q{Add,Sub,Mul}Overload
These APIs started out as private APIs in qnumeric_p.h, but have since been made pseudo-public in qnumeric.h. The qnumeric_p.h versions just forward to the qnumeric.h ones, so just use the latter. This is in preparation of removing the {add,sub,mul}_overflow versions, which, despite being defined in the unnamed namespace, don't sport the q prefix, so potentially clash with global symbols. The change is a simple textual search and replace, manually excluding qnumeric_p.h. Picking to 6.5 to avoid cherry-pick conflicts going forward. Pick-to: 6.6 6.5 Change-Id: Ic0f7c92f7c47923317109e8a9dc06fa66bdff2c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/time/qlocaltime.cpp')
-rw-r--r--src/corelib/time/qlocaltime.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/time/qlocaltime.cpp b/src/corelib/time/qlocaltime.cpp
index 145da917232..e059b30bcfa 100644
--- a/src/corelib/time/qlocaltime.cpp
+++ b/src/corelib/time/qlocaltime.cpp
@@ -176,15 +176,15 @@ inline std::optional<qint64> tmToJd(const struct tm &date)
// True if combining day and seconds overflows qint64; otherwise, sets *epochSeconds
inline bool daysAndSecondsOverflow(qint64 julianDay, qint64 daySeconds, qint64 *epochSeconds)
{
- return mul_overflow(julianDay - JULIAN_DAY_FOR_EPOCH, IC(SECS_PER_DAY), epochSeconds)
- || add_overflow(*epochSeconds, daySeconds, epochSeconds);
+ return qMulOverflow(julianDay - JULIAN_DAY_FOR_EPOCH, IC(SECS_PER_DAY), epochSeconds)
+ || qAddOverflow(*epochSeconds, daySeconds, epochSeconds);
}
// True if combining seconds and millis overflows; otherwise sets *epochMillis
inline bool secondsAndMillisOverflow(qint64 epochSeconds, qint64 millis, qint64 *epochMillis)
{
- return mul_overflow(epochSeconds, IC(MSECS_PER_SEC), epochMillis)
- || add_overflow(*epochMillis, millis, epochMillis);
+ return qMulOverflow(epochSeconds, IC(MSECS_PER_SEC), epochMillis)
+ || qAddOverflow(*epochMillis, millis, epochMillis);
}
#undef IC