From: Daniel G. <bu...@li...> - 2001-12-19 01:38:40
|
Mathew, Well, it's perfectly legal C++... Memberwise comparison, see ARM 13.2.3.2 . . . . . Surprised ? Just joking: see FXApp.cpp, line 1120: static inline int operator<(const struct timeval& a,const struct timeval& b){ return (a.tv_sec<b.tv_sec) || (a.tv_sec==b.tv_sec && a.tv_usec<b.tv_usec); } Regards, Daniel > -----Original Message----- > From: fox...@li... > [mailto:fox...@li...] On Behalf > Of Mathew Robertson > Sent: Wednesday, December 19, 2001 1:58 AM > To: FOX Users > Subject: [Foxgui-users]general C question: explanation of > timeout code in FXApp > > > > Can someone explain to me how this works: > > // Handle all past due timers > gettimeofday(&now,NULL); > while(timers){ > register FXTimer* t=timers; > if(now < t->due) break; > timers=t->next; > if(t->target && t->target->handle(this,MKUINT(t->message, > SEL_TIMEOUT),&event)) refresh(); > t->next=timerrecs; > timerrecs=t; > } > > > Both 'now' and 't->due' are struct timeval's. How can: > > if (now < t->due) break; > > work for a struct? > > What am I missing here? > > Mathew Robertson > > _______________________________________________ > Foxgui-users mailing list > Fox...@li... > https://lists.sourceforge.net/lists/listinfo/foxgui-users > |