PVS V1028: cast result of operation instead of operands

If an overflow occurs before the cast, we can't fix it. If we cast
first, we can rely on integer promotion to make the result use the
appropriate size.

Change-Id: I7462e28422456c07f179f94d39c10c408d9bec36
Reviewed-on: https://review.haiku-os.org/c/1623
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Adrien Destugues
2019-07-17 22:17:22 +00:00
committed by waddlesplash
parent fbe53d9249
commit 72bfb14432
8 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -1713,7 +1713,7 @@ time_t dos_to_unix_time(dosdatetime)
++days; /* OK through 2199 */
/* convert date & time to seconds relative to 00:00:00, 01/01/YRBASE */
m_time = (time_t)((unsigned long)(days + dy) * 86400L +
m_time = (time_t)(((unsigned long)days + dy) * 86400L +
(unsigned long)hh * 3600L +
(unsigned long)(mm * 60 + ss));
/* - 1; MS-DOS times always rounded up to nearest even second */