From 5b18acd45d677a04b1e862c29fc50aba42e3a5dc Mon Sep 17 00:00:00 2001 From: Laurent Bartholdi Date: Mon, 6 Feb 2017 12:26:48 +0100 Subject: [PATCH] Removed setjmp inclusion --- TODO | 1 + src/cpoly.C | 2 +- src/img_dll.c | 10 +++++++--- src/img_dll.h | 2 -- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 79e3a03..c0807fd 100644 --- a/TODO +++ b/TODO @@ -10,3 +10,4 @@ These are the things I'll get to do when I get to do them: * "prenucleus" using just the states, not the action to compare. possibly return also the relations that are needed to make it a nucleus, something like the "triangles". * abstract triangulations: just work with pairs/triples of conjugacy classes. do the lifting symbolically. train tracks. + * submachines, esp. with subalphabets diff --git a/src/cpoly.C b/src/cpoly.C index 3c2fa36..daea6d2 100644 --- a/src/cpoly.C +++ b/src/cpoly.C @@ -46,7 +46,7 @@ static xcomplex cauchy(const int deg, xcomplex *P) dx = x; // Do Newton iteration until x converges to two decimal places - while(fabs(dx / x) > 0.005) { + while(fabsl(dx / x) > 0.005) { f = tmp[0]; df = 0.0; for(int i = 1; i <= deg; i++){ diff --git a/src/img_dll.c b/src/img_dll.c index c551447..87f31c9 100644 --- a/src/img_dll.c +++ b/src/img_dll.c @@ -31,7 +31,9 @@ static void baby_please_dont_go (void) { } /* in code: - +... +#include +... atexit (baby_please_dont_go); if (setjmp(e_t_go_home)) return __result; @@ -176,7 +178,9 @@ static Obj REAL_ROOTS (Obj self, Obj coeffs) p = INT_INTOBJ(ELM_PLIST(negind,-v)); \ } -#define EXP_LETTER(v) (INT_INTOBJ(ELM_PLIST(exp,abs(v)))) +Int Intabs(Int v) { return v > 0 ? v : -v; } + +#define EXP_LETTER(v) (INT_INTOBJ(ELM_PLIST(exp,Intabs(v)))) #define FIND_MATCH(match,matchlen) { \ matchlen = 1; \ @@ -230,7 +234,7 @@ static Obj NFFUNCTION(Obj self, Obj rel, Obj exp, Obj dir, Obj word) */ Int vi = INT_INTOBJ(ELM_PLIST(word,i)); if (EXP_LETTER(vi)==2) - vi = abs(vi); + vi = Intabs(vi); Int idle; if (vi == -vlast) { /* pop letter */ diff --git a/src/img_dll.h b/src/img_dll.h index 36995a8..1f8088d 100644 --- a/src/img_dll.h +++ b/src/img_dll.h @@ -12,11 +12,9 @@ #undef VERY_LONG_DOUBLES -/* #define sigjmp_buf int */ #include #include #include -#include #include "src/compiled.h" #include "src/macfloat.h" #include "poly.h"