commit dccbbcfc59d6dab34e7fca011a3782ce08a10d31 parent d82f93e6074231e3607b5e3b81cab18d52e24ba1 Auteur: Loïc Daignault-Pichette <loic@asteride.xyz> Date: Fri, 10 Apr 2026 13:46:02 -0400 Placer le symbole TFM_SYMB_AUTRE à la fin Diffstat:
| M | tfm.c | | | 16 | +++++++++++++--- |
1 fichier modifié, 13 insertions(+), 3 suppressions(-)
diff --git a/tfm.c b/tfm.c @@ -306,12 +306,22 @@ trier_etat(struct tfm *tfm, size_t ietat) static int trans_comparer(struct tfm *tfm, size_t t1, size_t t2) { + ssize_t s1; + ssize_t s2; + TFM_COHERENT(tfm); - if (tfm->trans[t1].se < tfm->trans[t2].se) + s1 = tfm->trans[t1].se; + s2 = tfm->trans[t2].se; + + /* Le symbole TFM_SYMB_AUTRE doit être placé à la fin. */ + if (s1 == TFM_SYMB_AUTRE) + return 1; + if (s2 == TFM_SYMB_AUTRE) return -1; - if (tfm->trans[t1].se == tfm->trans[t2].se) - return 0; + + if (s1 < s2) return -1; + if (s1 == s2) return 0; return 1; }