[dasher] use std::numeric_limits<double>::infinity() not INFINITY
- From: Patrick Welche <pwelche src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [dasher] use std::numeric_limits<double>::infinity() not INFINITY
- Date: Mon, 16 Nov 2009 15:46:13 +0000 (UTC)
commit e8717b13c957ec3a1a89c5d613081ae5d9337102
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date: Mon Nov 16 16:45:36 2009 +0100
use std::numeric_limits<double>::infinity() not INFINITY
ChangeLog | 1 +
Src/DasherCore/DasherViewSquare.cpp | 6 +++---
Src/DasherCore/TwoPushDynamicFilter.cpp | 12 ++++++------
3 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6a566af..66b6c06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
CDasherNode subclasses.
* Many covariant overrides, etc., in place of unchecked casts -->
*type safety*!!
+ * use std::numeric_limits<double>::infinity() not INFINITY
2009-11-16 Alan Lawrence <acl33 inf phy cam ac uk>
diff --git a/Src/DasherCore/DasherViewSquare.cpp b/Src/DasherCore/DasherViewSquare.cpp
index 5632d99..1b5507f 100644
--- a/Src/DasherCore/DasherViewSquare.cpp
+++ b/Src/DasherCore/DasherViewSquare.cpp
@@ -159,7 +159,7 @@ void CDasherViewSquare::RenderNodes(CDasherNode *pRoot, myint iRootMin, myint iR
// 0, -1, Nodes1, false, true, 1);
// Render the root node (and children)
- pRoot->m_dCost = INFINITY;
+ pRoot->m_dCost = std::numeric_limits<double>::infinity();
RecursiveRender(pRoot, iRootMin, iRootMax, iDasherMaxX, nodeQueue, pvGamePointer,iDasherMaxX,0,0);
// Labels are drawn in a second parse to get the overlapping right
@@ -334,9 +334,9 @@ void CDasherViewSquare::RecursiveRender(CDasherNode *pRender, myint y1, myint y2
DASHER_ASSERT ((iScreenY2 - iScreenY1 > MIN_SIZE) && //big enough to render?
(newy1 <= iDasherMaxY) && (newy2 >= iDasherMinY)); //at least partly onscreen!
- DASHER_ASSERT(pRender->m_dCost == INFINITY);
+ DASHER_ASSERT(pRender->m_dCost == std::numeric_limits<double>::infinity());
}
- pChild->m_dCost = INFINITY;
+ pChild->m_dCost = std::numeric_limits<double>::infinity();
//don't inc iDepth, meaningless when covers the screen
RecursiveRender(pChild, newy1, newy2, mostleft,
nodeQueue, pvGamePointer,
diff --git a/Src/DasherCore/TwoPushDynamicFilter.cpp b/Src/DasherCore/TwoPushDynamicFilter.cpp
index 6c5699c..6e739c9 100644
--- a/Src/DasherCore/TwoPushDynamicFilter.cpp
+++ b/Src/DasherCore/TwoPushDynamicFilter.cpp
@@ -44,7 +44,7 @@ static SModuleSettings sSettings[] = {
};
CTwoPushDynamicFilter::CTwoPushDynamicFilter(Dasher::CEventHandler * pEventHandler, CSettingsStore *pSettingsStore, CDasherInterfaceBase *pInterface)
- : CDynamicFilter(pEventHandler, pSettingsStore, pInterface, 14, 1, _("Two-push Dynamic Mode (New One Button)")), m_dNatsSinceFirstPush(-INFINITY) {
+ : CDynamicFilter(pEventHandler, pSettingsStore, pInterface, 14, 1, _("Two-push Dynamic Mode (New One Button)")), m_dNatsSinceFirstPush(-std::numeric_limits<double>::infinity()) {
Dasher::CParameterNotificationEvent oEvent(LP_TWO_PUSH_OUTER);//and all the others too!
HandleEvent(&oEvent);
@@ -88,7 +88,7 @@ bool CTwoPushDynamicFilter::DecorateView(CDasherView *pView)
GuideLine(pView, 2048 + GetLongParameter(LP_TWO_PUSH_OUTER), 1);
//moving markers - green if active, else yellow
- if (m_bDecorationChanged && isRunning() && m_dNatsSinceFirstPush > -INFINITY)
+ if (m_bDecorationChanged && isRunning() && m_dNatsSinceFirstPush > -std::numeric_limits<double>::infinity())
{
for (int i = 0; i < 2; i++)
{
@@ -183,7 +183,7 @@ void CTwoPushDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDas
reverse();
return;
}
- if (m_dNatsSinceFirstPush == -INFINITY) //no button pushed (recently)
+ if (m_dNatsSinceFirstPush == -std::numeric_limits<double>::infinity()) //no button pushed (recently)
{
m_dNatsSinceFirstPush = pModel->GetNats();
//note, could be negative if overall reversed since last ResetNats (Offset)
@@ -199,7 +199,7 @@ void CTwoPushDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDas
pModel->Offset(m_aiTarget[m_iActiveMarker]);
pModel->ResetNats();
//don't really have to reset there, but seems as good a place as any
- m_dNatsSinceFirstPush = -INFINITY; //"waiting for first push"
+ m_dNatsSinceFirstPush = -std::numeric_limits<double>::infinity(); //"waiting for first push"
}
}
}
@@ -214,7 +214,7 @@ bool doSet(int &var, const int val)
bool CTwoPushDynamicFilter::TimerImpl(int iTime, CDasherView *m_pDasherView, CDasherModel *m_pDasherModel, Dasher::VECTOR_SYMBOL_PROB *pAdded, int *pNumDeleted)
{
DASHER_ASSERT(isRunning());
- if (m_dNatsSinceFirstPush > -INFINITY) // first button has been pushed
+ if (m_dNatsSinceFirstPush > -std::numeric_limits<double>::infinity()) // first button has been pushed
{
double dLogGrowth(m_pDasherModel->GetNats() - m_dNatsSinceFirstPush), dOuter(GetLongParameter(LP_TWO_PUSH_OUTER)),
dUp(GetLongParameter(LP_TWO_PUSH_UP)), dDown(GetLongParameter(LP_TWO_PUSH_DOWN));
@@ -259,7 +259,7 @@ void CTwoPushDynamicFilter::Deactivate() {
}
void CTwoPushDynamicFilter::run() {
- m_dNatsSinceFirstPush = -INFINITY;
+ m_dNatsSinceFirstPush = -std::numeric_limits<double>::infinity();
SetBoolParameter(BP_SMOOTH_OFFSET, true);
CDynamicFilter::run();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]