Counter: setInit(): fix. Init can't be set to lower of down_lim or higher of up_lim
This commit is contained in:
@@ -50,7 +50,15 @@ Counter::Counter (unsigned int down, unsigned int up)
|
||||
}
|
||||
|
||||
void
|
||||
Counter::setInit (unsigned int i)
|
||||
Counter::setInit (unsigned int newInit)
|
||||
{
|
||||
init = i;
|
||||
if(newInit > up_lim){
|
||||
init = up_lim;
|
||||
}
|
||||
else if(newInit < down_lim){
|
||||
init = down_lim;
|
||||
}
|
||||
else{
|
||||
init = newInit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user