Nearly at 20 trampolines left.
This commit is contained in:
parent
9da05f738c
commit
38d57ed91d
24
src/system.c
24
src/system.c
@ -1189,28 +1189,31 @@ iterateRoles (const System sys, int (*callback) (Protocol p, Role r))
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get first recv/send occurrence (event index) of term t in run r
|
//! Get first recv/send occurrence (event index) of term t in run r
|
||||||
|
/**
|
||||||
|
* ..or -1 if it does not occor
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
firstOccurrence (const System sys, const int r, Term t, int evtype)
|
firstOccurrence (const System sys, const int r, Term t, int evtype)
|
||||||
{
|
{
|
||||||
int firste;
|
int e;
|
||||||
|
Roledef rd;
|
||||||
|
|
||||||
int checkOccurs (Roledef rd, int e)
|
rd = sys->runs[r].start;
|
||||||
|
for (e = 0; e < sys->runs[r].step; e++)
|
||||||
|
{
|
||||||
|
if (evtype == ANYEVENT || rd->type == evtype)
|
||||||
{
|
{
|
||||||
if (termSubTerm (rd->message, t) || termSubTerm (rd->from, t)
|
if (termSubTerm (rd->message, t) || termSubTerm (rd->from, t)
|
||||||
|| termSubTerm (rd->to, t))
|
|| termSubTerm (rd->to, t))
|
||||||
{
|
{
|
||||||
firste = e;
|
return e;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
|
rd = rd->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
firste = -1;
|
|
||||||
iterateEventsType (sys, r, evtype, checkOccurs);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (DEBUGL (3))
|
if (DEBUGL (3))
|
||||||
{
|
|
||||||
if (firste == -1)
|
|
||||||
{
|
{
|
||||||
globalError++;
|
globalError++;
|
||||||
eprintf ("Warning: Desired term ");
|
eprintf ("Warning: Desired term ");
|
||||||
@ -1221,9 +1224,8 @@ firstOccurrence (const System sys, const int r, Term t, int evtype)
|
|||||||
eprintf ("\n");
|
eprintf ("\n");
|
||||||
globalError--;
|
globalError--;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return firste;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the roledef of an event
|
//! Get the roledef of an event
|
||||||
|
Loading…
Reference in New Issue
Block a user