diff --git a/src/modules/_math/math.c b/src/modules/_math/math.c index 161248c8a5d74a5a472223f83bd226369a811e39..f0b84cba24eb77336b8b7b92d8baf5876550d378 100644 --- a/src/modules/_math/math.c +++ b/src/modules/_math/math.c @@ -27,7 +27,7 @@ #include <floatingpoint.h> #endif -RCSID("$Id: math.c,v 1.28 2000/03/28 19:37:23 grubba Exp $"); +RCSID("$Id: math.c,v 1.29 2000/03/29 05:17:38 hubbe Exp $"); #ifndef M_PI #define M_PI 3.1415926535897932384626433832795080 @@ -221,7 +221,7 @@ void f_round(INT32 args) { if(args<1) error("Too few arguments to round()\n"); if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to round()\n"); - sp[-args].u.float_number=rint(sp[-args].u.float_number); + sp[-args].u.float_number=RINT(sp[-args].u.float_number); } void f_min(INT32 args) diff --git a/src/modules/sprintf/sprintf.c b/src/modules/sprintf/sprintf.c index bb2955ea1856b38449591ad927ee42fae3ffca27..ac3f0b0eaad1acd604fc6005b432131e4f5c9c28 100644 --- a/src/modules/sprintf/sprintf.c +++ b/src/modules/sprintf/sprintf.c @@ -102,7 +102,7 @@ */ #include "global.h" -RCSID("$Id: sprintf.c,v 1.60 1999/11/01 15:11:09 mirar Exp $"); +RCSID("$Id: sprintf.c,v 1.61 2000/03/29 05:17:44 hubbe Exp $"); #include "error.h" #include "array.h" #include "svalue.h" @@ -1195,7 +1195,7 @@ static void low_pike_sprintf(struct format_stack *fs, if(fs->fsp->precision<0) { double m=pow(10.0, (double)fs->fsp->precision); - tf=rint(tf*m)/m; + tf=RINT(tf*m)/m; } sprintf(x,buffer,1,fs->fsp->precision<0?0:fs->fsp->precision,tf); diff --git a/src/port.h b/src/port.h index 0963dc61a7a96dd7529a899ce8e6c064905c4b5b..f7da545bfd79e259a2be3a7b09b86e9a98197bda 100644 --- a/src/port.h +++ b/src/port.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: port.h,v 1.22 1999/08/14 15:09:17 per Exp $ + * $Id: port.h,v 1.23 2000/03/29 05:17:15 hubbe Exp $ */ #ifndef PORT_H #define PORT_H @@ -39,7 +39,9 @@ time_t TIME(time_t *); #endif #ifndef HAVE_RINT -#define rint(X) floor( (X) + 0.5 ) +#define RINT rint +#else +#define RINT(X) floor( (X) + 0.5 ) #endif #if defined(HAVE_STRTOL) && defined(HAVE_WORKING_STRTOL) diff --git a/src/uncompressor.c b/src/uncompressor.c index 95f0fc4af9e3f5b10b1aaa62d2008f55721a456d..13323b3dee4827a7740eaefcb6fa83b47a7185b2 100644 --- a/src/uncompressor.c +++ b/src/uncompressor.c @@ -38,7 +38,7 @@ static void gr(char *ptr, int len) } #define GR(X) gr( (char *) & (X), sizeof(X)) -static unsigned int rint(void) +static unsigned int read_int(void) { unsigned char x[4]; gr(x,4); @@ -101,7 +101,7 @@ void my_uncompress(char *file) char *data; GR(type); - len=rint(); + len=read_int(); /* fprintf(stderr,"namelen=%d\n",len); */ gr(buffer, len); @@ -155,7 +155,7 @@ void my_uncompress(char *file) fprintf(stderr,"Failed to open %s\n",buffer); exit(1); } - len=rint(); + len=read_int(); while(len) { int r=len > sizeof(buffer) ? sizeof(buffer) : len;