pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:20:   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.114 2001/07/20 04:02:30 mast Exp $"); + RCSID("$Id: opcodes.c,v 1.115 2001/07/31 19:31:21 marcus Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:947:   #else   extern double LDEXP(double x, int exp); /* defined in encode.c */   #endif      static INLINE FLOAT_TYPE low_parse_IEEE_float(char *b, int sz)   {    unsigned INT32 f, extra_f;    int s, e;    unsigned char x[4];    double r; +  DECLARE_INF +  DECLARE_NAN       x[0] = EXTRACT_UCHAR(b);    x[1] = EXTRACT_UCHAR(b+1);    x[2] = EXTRACT_UCHAR(b+2);    x[3] = EXTRACT_UCHAR(b+3);    s = ((x[0]&0x80)? 1 : 0);       if(sz==4) {    e = (((int)(x[0]&0x7f))<<1)|((x[1]&0x80)>>7);    f = (((unsigned INT32)(x[1]&0x7f))<<16)|(((unsigned INT32)x[2])<<8)|x[3];
pike.git/src/opcodes.c:983:    e = 9999;    else if(e>0) {    f |= 0x00100000;    e -= 1023+20;    } else    e -= 1022+20;    }    if(e>=9999)    if(f||extra_f) {    /* NAN */ - #ifdef HAVE_INFNAN -  return (FLOAT_TYPE)infnan(EDOM); - #else - #ifdef HAVE_NAN -  /* C99 provides a portable way of generating NaN */ -  return (FLOAT_TYPE)nan(""); - #else -  return (FLOAT_TYPE)0.0; - #endif /* HAVE_NAN */ - #endif /* HAVE_INFNAN */ +  return (FLOAT_TYPE)MAKE_NAN();    } else {    /* +/- Infinity */ - #ifdef HAVE_INFNAN -  return (FLOAT_TYPE)infnan(s? -ERANGE:ERANGE); - #else - #ifdef HUGE_VAL -  return (FLOAT_TYPE)(s? -HUGE_VAL:HUGE_VAL); - #else -  /* This number is infinite enough... :) */ -  e = 1024; -  f = 1; -  extra_f = 0; - #endif /* HUGE_VAL */ - #endif /* HAVE_INFNAN */ +  return (FLOAT_TYPE)MAKE_INF(s? -1:1);    }       r = (double)f;    if(extra_f)    r += ((double)extra_f)/4294967296.0;    return (FLOAT_TYPE)(s? -LDEXP(r, e):LDEXP(r, e));   }      #endif