Skip to content

Commit b4b3b2a

Browse files
committed
More llabs and adding more <cmath>
1 parent e8c9858 commit b4b3b2a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Src/DasherCore/DasherModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void CDasherModel::ScheduleOneStep(dasherint y1, dasherint y2, int nSteps, int l
371371
// = (MAX_Y-(2*limX)) / (2*limX) * targetRange / (MAX_Y-targetRange)
372372
{
373373
const dasherint n=targetRange*(MAX_Y-2*limX), d=(MAX_Y-targetRange)*2*limX;
374-
bool bOver=std::max(abs(m1),abs(m2))>std::numeric_limits<dasherint>::max()/n;
374+
bool bOver=std::max(llabs(m1),llabs(m2))>std::numeric_limits<dasherint>::max()/n;
375375
if (bOver) {
376376
//std::cout << "Overflow in max-speed-limit " << m1 << "," << m2 << " =wd> " << ((m1*n)/d) << "," << ((m2*n)/d);
377377
//so do it a harder way, but which uses smaller intermediates:

Src/DasherCore/DefaultFilter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "DefaultFilter.h"
22

33
#include <I18n.h>
4+
#include <algorithm>
5+
#include <cmath>
46

57
#include "DasherInterfaceBase.h"
68

0 commit comments

Comments
 (0)