Skip to content

Commit 714b2cc

Browse files
committed
fix for issue found by cppcheck
replace abs with llabs
1 parent 1d8c65f commit 714b2cc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

heclib/heclib_c/src/Utilities/DateTime/incrementTime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ int incrementTime(int intervalSeconds, int numberPeriods,
214214
day = 15;
215215
}
216216
}
217-
else if (abs(intervalMinutes - MINS_IN_1_MONTH) <= 2 * MINS_IN_1_DAY) {
217+
else if (llabs(intervalMinutes - MINS_IN_1_MONTH) <= 2 * MINS_IN_1_DAY) {
218218
// Monthly
219219
month += numberPeriods;
220220
// Day is always end of month for standard
221221
day = 28;
222222
}
223-
else if (abs(intervalMinutes > MINS_IN_1_YEAR) <= MINS_IN_1_DAY) {
223+
else if (llabs(intervalMinutes - MINS_IN_1_YEAR) <= MINS_IN_1_DAY) {
224224
// Yearly
225225
year += numberPeriods;
226226
// Always new year's eve for standard

0 commit comments

Comments
 (0)