[dasher] Miscellaneous fixes:



commit 3d3e0a1fb55e9b9cf5c20645b3d858298e942491
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Sat Jul 31 18:43:37 2010 +0100

    Miscellaneous fixes:
    
    * DasherInterfaceBase.cpp: Fix signed/unsigned comparison
    * ControlManager.h: Remove debug printout
    * ExpansionPolicy.cpp: Fix precedence
        (i.e. make AmortizedPolicy do some amortization!)

 Src/DasherCore/ControlManager.h        |    1 -
 Src/DasherCore/DasherInterfaceBase.cpp |    2 +-
 Src/DasherCore/ExpansionPolicy.cpp     |    2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/Src/DasherCore/ControlManager.h b/Src/DasherCore/ControlManager.h
index 4bd092b..a33c24f 100644
--- a/Src/DasherCore/ControlManager.h
+++ b/Src/DasherCore/ControlManager.h
@@ -119,7 +119,6 @@ namespace Dasher {
       ///pointer to a function "void X()", that is a member of a T...
       typedef void (T::*Method)();
       MethodTemplate(T *pRecv, const std::string &strLabel, Method f) : NodeTemplate(strLabel,-1),m_pRecv(pRecv),m_f(f) {
-        std::cout << "Creating " << this << " with receiver " << pRecv << std::endl;
       }
       virtual void happen(CContNode *pNode) {
         //invoke pointer-to-member-function m_f on object *m_pRecv!
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index b652d46..cd535b1 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -361,7 +361,7 @@ void CDasherInterfaceBase::InterfaceEventHandler(Dasher::CEvent *pEvent) {
       if(GetBoolParameter(BP_LM_ADAPTIVE))
 	 strTrainfileBuffer = strTrainfileBuffer.substr( 0, strTrainfileBuffer.size() - pEditEvent->m_sText.size());
       if (GetBoolParameter(BP_SPEAK_WORDS))
-        m_strCurrentWord = m_strCurrentWord.substr(0, max(0ul, m_strCurrentWord.size()-pEditEvent->m_sText.size()));
+        m_strCurrentWord = m_strCurrentWord.substr(0, max(static_cast<string::size_type>(0), m_strCurrentWord.size()-pEditEvent->m_sText.size()));
     }
   }
 }
diff --git a/Src/DasherCore/ExpansionPolicy.cpp b/Src/DasherCore/ExpansionPolicy.cpp
index c6cce34..4fb2ecf 100644
--- a/Src/DasherCore/ExpansionPolicy.cpp
+++ b/Src/DasherCore/ExpansionPolicy.cpp
@@ -111,7 +111,7 @@ double BudgettingPolicy::getCost(CDasherNode *pNode, int iDasherMinY, int iDashe
   return getRange(iDasherMinY, iDasherMaxY, 0, 4096);
 }
 
-AmortizedPolicy::AmortizedPolicy(unsigned int iNodeBudget) : BudgettingPolicy(iNodeBudget), m_iMaxExpands(std::max(1u,500+(iNodeBudget/1000))) {}
+AmortizedPolicy::AmortizedPolicy(unsigned int iNodeBudget) : BudgettingPolicy(iNodeBudget), m_iMaxExpands(std::max(1u,(500+iNodeBudget)/1000)) {}
 
 AmortizedPolicy::AmortizedPolicy(unsigned int iNodeBudget, unsigned int iMaxExpands) : BudgettingPolicy(iNodeBudget), m_iMaxExpands(iMaxExpands) {}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]