|
From: <koc...@us...> - 2009-09-11 08:14:06
|
Revision: 309
http://scstudio.svn.sourceforge.net/scstudio/?rev=309&view=rev
Author: kocianon
Date: 2009-09-11 08:13:58 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
fixing some gcc warnings, constrain check fix - EndNode problem, adding IsEndignNode class to search for stright EndNode successor
Modified Paths:
--------------
trunk/src/check/liveness/deadlock_checker.cpp
trunk/src/check/pseudocode/utils.h
trunk/src/check/time/constrain_check.cpp
trunk/src/check/time/time_consistency.cpp
trunk/src/data/Z120/z120_save.cpp
trunk/src/data/time.cpp
trunk/src/data/time.h
trunk/tests/interval_string.cpp
Modified: trunk/src/check/liveness/deadlock_checker.cpp
===================================================================
--- trunk/src/check/liveness/deadlock_checker.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/liveness/deadlock_checker.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -70,7 +70,8 @@
m_depths.push(m_current_depth);
}
//set deadlock free attribute
- bool& deadlock_free = get_deadlock_free(node);
+// bool& deadlock_free = get_deadlock_free(node);
+ get_deadlock_free(node);
if (dynamic_cast<EndNode*>(node))
{
mark_deadlock_free(node);
@@ -98,7 +99,8 @@
if (!m_depths.empty())
{
//depth of node is surely set (in on_white_node_found())
- size_t node_depth = get_depth(node);
+// size_t node_depth = get_depth(node);
+ get_depth(node);
size_t top_reference_depth = m_depths.top();
//there is some ReferenceNode on path from node to previous white HMscNode
if (top_reference_depth >= m_current_depth)
Modified: trunk/src/check/pseudocode/utils.h
===================================================================
--- trunk/src/check/pseudocode/utils.h 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/pseudocode/utils.h 2009-09-11 08:13:58 UTC (rev 309)
@@ -2,11 +2,12 @@
#define _UTILS_H
#include <string>
-
+#include <stack>
#include "data/dfs_events_traverser.h"
#include "data/dfs_bmsc_graph_traverser.h"
#include "data/dfsb_hmsc_traverser.h"
#include "check/pseudocode/export.h"
+#include "data/node_finder.h"
typedef std::map<std::wstring,size_t> StringSizeTMap;
@@ -129,6 +130,38 @@
};
+/*
+ * \brief Check whether the HMscNode is ending node
+ * (one of the straight successors is End node)
+ * due to connection node theather
+ *
+ */
+
+class IsEndingNode
+{
+private:
+
+public:
+ IsEndingNode()
+ {
+ }
+ static EndNode* check(HMscNode* node)
+ {
+ EndNode* end;
+ //isnt it EndNode itself?
+ if((end=dynamic_cast<EndNode*>(node)))
+ return end;
+
+ HMscNodePListPtr succs = NodeFinder::successors(node,"IsEndingNode");
+ HMscNodePList::iterator it;
+ for(it=succs->begin();it!=succs->end();it++)
+ if((end=dynamic_cast<EndNode*>(*it)))
+ return end;
+ return end;
+
+ }
+};
+
#endif /* _UTILS_H */
// $Id$
Modified: trunk/src/check/time/constrain_check.cpp
===================================================================
--- trunk/src/check/time/constrain_check.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/time/constrain_check.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -1,5 +1,6 @@
#include "constrain_check.h"
#include "data/dfs_bmsc_graph_traverser.h"
+#include "check/pseudocode/utils.h"
HMscTimeConstrainCheckerPtr HMscTimeConstrainChecker::m_instance;
@@ -59,8 +60,7 @@
check_active_set(n,constrain_set);
- if(dynamic_cast<EndNode*>(n))
- if(m_active_constrains.size()!=0)
+ if(m_active_constrains.size()!=0 && IsEndingNode::check(n))
throw m_active_constrains;
}
@@ -72,9 +72,6 @@
if(constrains_set!=m_active_constrains)
throw constrains_set;
- constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=m_active_constrains)
- throw constrains_set;
}
void HMscTimeConstrainChecker::on_black_node_found(ReferenceNode* n)
@@ -85,9 +82,6 @@
if(constrains_set!=m_active_constrains)
throw constrains_set;
- constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=m_active_constrains)
- throw constrains_set;
}
Modified: trunk/src/check/time/time_consistency.cpp
===================================================================
--- trunk/src/check/time/time_consistency.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/time/time_consistency.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -50,7 +50,7 @@
int new_j;
int new_i;
DEBUG_(i,j);
- if(matrix.size1()==i+1 && matrix.size1()== j+1)
+ if((matrix.size1()==(unsigned)(i+1)) && (matrix.size1()==(unsigned)(j+1)))
{
IntervalMatrix tmp = tightener->tight(matrix);
for(unsigned g=0;g<matrix.size1();g++)
@@ -62,7 +62,7 @@
else
{
std::list<MscTimeIntervalD> interval_list;
- if(j+1==matrix.size1())
+ if((unsigned)(j+1)==matrix.size1())
{
new_i = i+1;
new_j = new_i;
Modified: trunk/src/data/Z120/z120_save.cpp
===================================================================
--- trunk/src/data/Z120/z120_save.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/Z120/z120_save.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -50,8 +50,8 @@
{
char stripped;
- if(*pos >= 'A' && *pos <= 'Z' || *pos >= 'a' && *pos <= 'z'
- || *pos >= '0' && *pos <= '9'
+ if((*pos >= 'A' && *pos <= 'Z') || (*pos >= 'a' && *pos <= 'z')
+ || (*pos >= '0' && *pos <= '9')
|| *pos == '_' || *pos == '.')
{
// print valid characters
Modified: trunk/src/data/time.cpp
===================================================================
--- trunk/src/data/time.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/time.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -53,7 +53,8 @@
template <>
MscIntervalCouple<double>::MscIntervalCouple(const std::string& number, \
const bool& closed):
-m_value(0),m_closed(closed)
+ m_closed(closed)
+ ,m_value(0)
{
const char* pos = number.c_str();
m_value = atof(pos);
@@ -62,7 +63,8 @@
template <>
MscIntervalCouple<DecScaled>::MscIntervalCouple(const std::string &number, \
const bool& closed):
-m_value(0),m_closed(closed)
+ m_closed(closed)
+ ,m_value(0)
{
DecScaled tmp(number);
m_value = tmp;
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/time.h 2009-09-11 08:13:58 UTC (rev 309)
@@ -286,7 +286,9 @@
MscIntervalCouple(const std::string&,const bool&);
- MscIntervalCouple(const bool& b,const T& d): m_closed(b),m_value(d)
+ MscIntervalCouple(const bool& b,const T& d):
+ m_closed(b)
+ ,m_value(d)
{
}
Modified: trunk/tests/interval_string.cpp
===================================================================
--- trunk/tests/interval_string.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/tests/interval_string.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -48,5 +48,6 @@
MscTimeInterval<DecScaled> d("[10]");
std::cerr << d << std::endl;
+// MscTimeInterval<DecScaled> c(std::string("405"));
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|