ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/iom.h
(Generate patch)

Comparing gvpe/src/iom.h (file contents):
Revision 1.21 by pcg, Thu Sep 2 07:50:43 2004 UTC vs.
Revision 1.22 by pcg, Thu Nov 11 17:41:55 2004 UTC

41# define IOM_IDLE 0 41# define IOM_IDLE 0
42#endif 42#endif
43#ifndef IOM_SIG 43#ifndef IOM_SIG
44# define IOM_SIG 0 44# define IOM_SIG 0
45#endif 45#endif
46#ifndef IOM_ACCURACY
47# define IOM_ACCURACY 0.001 // start timers at most this much earlier (can be 0)
48#endif
46 49
47typedef double tstamp; 50typedef double tstamp;
48extern tstamp NOW; 51extern tstamp NOW;
49 52
50struct watcher; 53struct watcher;
64struct sig_watcher; 67struct sig_watcher;
65#endif 68#endif
66 69
67template<class watcher> 70template<class watcher>
68struct io_manager_vec : vector<watcher *> { 71struct io_manager_vec : vector<watcher *> {
69#if IOM_CHECK
70 bool activity;
71#endif
72
73 void erase_unordered (unsigned int pos) 72 void erase_unordered (unsigned int pos)
74 { 73 {
75 watcher *w = (*this)[this->size () - 1]; 74 watcher *w = (*this)[this->size () - 1];
76 this->pop_back (); 75 this->pop_back ();
77 76
78 if (this->size ()) 77 if (this->size ())
79 if ((*this)[pos] = w) 78 if (((*this)[pos] = w)) // '=' is correct!
80 w->active = pos + 1; 79 w->active = pos + 1;
81 } 80 }
82}; 81};
83 82
84// only used as a namespace, and for initialisation purposes 83// only used as a namespace, and for initialisation purposes

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines