diff options
author | Pixel <Pixel> | 2001-05-02 10:44:20 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-05-02 10:44:20 +0000 |
commit | 744672b90fe21495913fc321633bc6d103e3cb6b (patch) | |
tree | e4ad06604ccb14022a61f01e3f7412fadcb1bdbc /lib | |
parent | a0c6c21ab0d031376cb37b3f2b931a3ceabaa1b7 (diff) |
Pouet
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fonctions.c | 6 | ||||
-rw-r--r-- | lib/interface.c | 8 | ||||
-rw-r--r-- | lib/pile.c | 1 | ||||
-rw-r--r-- | lib/scalaires.c | 7 |
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/fonctions.c b/lib/fonctions.c index dee16a8..44cdf91 100644 --- a/lib/fonctions.c +++ b/lib/fonctions.c @@ -12,6 +12,7 @@ #include "terminal.h" #include "exceptions.h" #include "polynom.h" +#include "interface.h" #ifdef HAVE_CONFIG_H #include "config.h" #else @@ -195,6 +196,5 @@ void reinit(polynome p1, polynome p2, polynome p3) void exit_call(polynome p1, polynome p2, polynome p3) { - clearterm(); - exception(2, _("Exiting, bye!")); -}
\ No newline at end of file + quit = 1; +} diff --git a/lib/interface.c b/lib/interface.c index f459215..f698318 100644 --- a/lib/interface.c +++ b/lib/interface.c @@ -7,6 +7,8 @@ #include "parser.h" #include "pile.h" +int quit; + void supprime(char * ch) { for (; *ch; ch++) { *ch = *(ch + 1); @@ -26,12 +28,13 @@ void inserer(char * ch, char c) { void ifloop(void) { int cread, i, insert = 0; - int gotesc = 0, quit = 0; + int gotesc = 0; char buffer[BUFSIZ] = ""; int position = 0; printf("> "); - + + quit = 0; while (!quit) { cread = fgetc(input); @@ -96,6 +99,7 @@ void ifloop(void) { printf("\n"); clearterm(); parse_line(buffer); + if (quit) break; initterm(); position = 0; buffer[0] = 0; @@ -420,7 +420,6 @@ void act_pile(int func) (ply_valuation (operande2.poly, rat_to_double(operande[0].poly->coef))), 0)); - if (operande[0].poly) ply_destruct(operande[0].poly); ply_destruct(operande2.poly); diff --git a/lib/scalaires.c b/lib/scalaires.c index d55c4b2..b9af70a 100644 --- a/lib/scalaires.c +++ b/lib/scalaires.c @@ -16,7 +16,7 @@ #define PRECISION 1E6 typedisplay display; -static int pgcd(int a, int b) +static unsigned long long pgcd(unsigned long long a, unsigned long long b) { if (a < b) return pgcd(b, a); @@ -35,7 +35,7 @@ rationnel rat_constr_zero(void) } -rationnel rat_constr(int num, int denom) +rationnel rat_constr(unsigned long long num, unsigned long long denom) { /* cree une fraction */ rationnel temp; int sgnnum = 1, sgndenom = 1; @@ -64,10 +64,7 @@ rationnel rat_constr(int num, int denom) rationnel rat_constr_from_double(double flt) { /* cree une fraction a partir d un double */ - return rat_constr(floor(flt * PRECISION), PRECISION); - - } void rat_destruct(rationnel rat) |