diff options
author | David Bremner <david@tethera.net> | 2021-07-26 13:48:26 -0300 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2021-07-26 14:07:29 -0300 |
commit | fd8ad78605ffd04f856df5716d6a34cf135312cf (patch) | |
tree | e89baa1c2d3c53edc716f3857cacc3b90c77b2c5 /rat2float.c | |
parent | d2b8abcab3ee2e9e224c0886dd278a4e66f7ad06 (diff) |
get rat2float building against lrslib-072
Many things could be improved, particularly error processing, but at
least it builds and seems to run.
Diffstat (limited to 'rat2float.c')
-rw-r--r-- | rat2float.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/rat2float.c b/rat2float.c index a23df4f..cfb3a0a 100644 --- a/rat2float.c +++ b/rat2float.c @@ -6,13 +6,12 @@ * */ -static char rcsid[]="$Id$"; - #include <stdlib.h> #include <stdio.h> #include <string.h> #include <float.h> +#include "process_args.h" #ifdef LRSMP #include "lrsmp.h" #endif @@ -44,9 +43,18 @@ void my_readrat(long *num_p, long * denom_p) { void rattodouble(integer_t num, integer_t denom, double *out_p){ *out_p=(double)num/(double)denom; } + #else typedef lrs_mp integer_t; #define MP_DIGITS 1000L +FILE *lrs_ifp; +FILE *lrs_ofp; + +void +lrs_overflow (int ignored) { + fprintf (stderr, "lrs_overflow called. exiting\n"); + exit(1); +} #endif #include "rat2float.h" @@ -62,6 +70,9 @@ int main(argc,argv) char format[BUFSIZ]; char buf[BUFSIZ]; + + lrs_ifp = stdin; + lrs_ofp = stdout; process_args(argc,argv,DOCSTRING); |