From f62a6a927a8ce7aa91b023e7aafad9b5ff96f755 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 8 Jan 2011 11:53:28 +0000 Subject: Removed unused (but unnecessarily incremented and decremented) timeout counter variables and improved comment. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8216 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl.cxx b/src/Fl.cxx index 07c7ff4b7..a8cc29d52 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -183,10 +183,12 @@ int Fl::event_inside(const Fl_Widget *o) /*const*/ { // -//////////////////////////////////////////////////////////////// -// Timeouts are stored in a sorted list, so only the first one needs -// to be checked to see if any should be called. - +//////////////////////////////////////////////////////////////////////// +// Timeouts are stored in a sorted list (*first_timeout), so only the +// first one needs to be checked to see if any should be called. +// Allocated, but unused (free) Timeout structs are stored in another +// linked list (*free_timeout). + struct Timeout { double time; void (*cb)(void*); @@ -194,7 +196,6 @@ struct Timeout { Timeout* next; }; static Timeout* first_timeout, *free_timeout; -static int first_timeout_count, free_timeout_count; #include @@ -235,7 +236,6 @@ void Fl::repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) { Timeout* t = free_timeout; if (t) { free_timeout = t->next; - --free_timeout_count; } else { t = new Timeout; } @@ -435,8 +435,6 @@ double Fl::wait(double time_to_wait) { first_timeout = t->next; t->next = free_timeout; free_timeout = t; - ++free_timeout_count; - --first_timeout_count; // Now it is safe for the callback to do add_timeout: cb(argp); } -- cgit v1.2.3