encore

Répétitions espacées dans le terminal
git clone git://git.asteride.xyz/~ldp/encore.git
Journaux | Fichiers | Références

commit fd29512b8166c3fe6042133f88efab0f29847014
parent 86a62cd6bd1031240f2c3dcaf6b62c419cf68eeb
Auteur: Selve <selve@asteride.xyz>
Date:   Tue, 12 Mar 2024 18:21:05 -0400

un peu de ménage dans sm2.c

Diffstat:
Msm2.c | 13++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/sm2.c b/sm2.c @@ -12,22 +12,19 @@ static uint8_t sm2_fac(int, int); void sm2(struct fiche *f, unsigned int qual, unsigned int pins, unsigned int pipi, unsigned int pnpi, uint64_t date) { - unsigned int nsucc; uint32_t intrv; uint64_t mtn; - nsucc = f->nsucc; - f->fac = sm2_fac(f->fac, qual); if (qual >= 4) - nsucc++; + f->nsucc++; else - nsucc = 0; + f->nsucc = 0; - if (nsucc <= 1) + if (f->nsucc <= 1) intrv = pipi; - else if (nsucc == pins + 1) + else if (f->nsucc == pins + 1) intrv = pnpi; else intrv = (f->prch - f->dern) * (f->fac / 100.0 + FMIN) + 1; @@ -36,8 +33,6 @@ sm2(struct fiche *f, unsigned int qual, unsigned int pins, unsigned int pipi, un f->dern = mtn - date; f->prch = f->dern + intrv; - - f->nsucc = nsucc; } static uint8_t