Hi Andrew, Hi Lars, > >> If you want it to be between [0, max-1], > >> obviously that should be > >> while(max > 0 && sequence >= max) { > >> sequence -= max; > >> }
The rotation was carried out definitely from 0 to max-1. > >> Though I wonder why not simply: > >> if (max == 0) > >> return; > >> if (sequence > max) > >> sequence = 0; The rotation was carried out definitely from 0 to max. > I was probably trying to get too fancy when dealing with run-time > reduction of max. > Lets go with your way :-) I think that the application of the patch of the second simple correction is good. Best Regards, Hideo Yamauchi. --- On Mon, 2012/1/16, Andrew Beekhof <and...@beekhof.net> wrote: > On Mon, Jan 16, 2012 at 10:56 AM, <renayama19661...@ybb.ne.jp> wrote: > > Hi Lars, > > Hi Andrew, > > > >> If you want it to be between [0, max-1], > >> obviously that should be > >> while(max > 0 && sequence >= max) { > >> sequence -= max; > >> } > > > > Thanks!!I try it. > > > >> Though I wonder why not simply: > >> if (max == 0) > >> return; > >> if (sequence > max) > >> sequence = 0; > > > > I wondered, too. > > However, I thought that a cord of Mr. Andrew might have some special > > specifications. > > I was probably trying to get too fancy when dealing with run-time > reduction of max. > Lets go with your way :-) > _______________________________________________ Pacemaker mailing list: Pacemaker@oss.clusterlabs.org http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://bugs.clusterlabs.org