Просмотр исходного кода

Fixed initialization of NominalPollTime and MaximumPollTime so that they are both valid by the time the c'tor calls set...() on them.

Fixed comment in setNominalPollTime so it shows the correct intent (that MaximumPollTime >= NominalPollTime).


git-svn-id: https://svn.microneil.com/svn/CodeDweller/trunk@13 d34b734f-a00e-4b39-a726-e4eeb87269ab
wx
madscientist 16 лет назад
Родитель
Сommit
dad799f603
1 измененных файлов: 4 добавлений и 2 удалений
  1. 4
    2
      timing.cpp

+ 4
- 2
timing.cpp Просмотреть файл

// a natural spiral. // a natural spiral.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////


PollTimer::PollTimer(int Nom, int Max) { // Construction requires a
PollTimer::PollTimer(int Nom, int Max) :
NominalPollTime(MinimumSleeperTime),
MaximumPollTime(MinimumSleeperTime) { // Construction requires a
setNominalPollTime(Nom); // nominal delay to use and setNominalPollTime(Nom); // nominal delay to use and
setMaximumPollTime(Max); // a maximum delay to allow. setMaximumPollTime(Max); // a maximum delay to allow.
} }
NominalPollTime = Nom; // remember it. NominalPollTime = Nom; // remember it.


if(MaximumPollTime < NominalPollTime) // Make sure the Maximum poll if(MaximumPollTime < NominalPollTime) // Make sure the Maximum poll
MaximumPollTime = NominalPollTime; // time is > the Nominal time.
MaximumPollTime = NominalPollTime; // time is >= the Nominal time.


reset(); // Reset due to the change. reset(); // Reset due to the change.
return NominalPollTime; // Return the new value. return NominalPollTime; // Return the new value.

Загрузка…
Отмена
Сохранить