Branch: Tag:

2016-12-30

2016-12-30 18:56:28 by Martin Nilsson <nilsson@fastmail.com>

Some small improvements from per/simplified-operators

243:    else if(SUBTYPEOF(sp[-1]) == NUMBER_UNDEFINED)    Pike_error("Cannot cast this object to int.\n");    } -  +     break;       case T_FLOAT: {
251:       if ( PIKE_ISINF(f) || PIKE_ISNAN(f) )    Pike_error("Can't cast infinites or NaN to int.\n"); +  /* should perhaps convert to Int.Inf now that we have them? */       if (UNLIKELY(f > MAX_INT_TYPE || f < MIN_INT_TYPE)) {    convert_stack_top_to_bignum();
1132:   PMOD_EXPORT void f_ne(INT32 args)   {    f_eq(args); -  o_not(); +  /* f_eq and friends always returns 1 or 0. */ +  Pike_sp[-1].u.integer = !Pike_sp[-1].u.integer;   }      /*! @decl int(0..1) `==(mixed arg1, mixed arg2, mixed ... extras)
2221:    return 0;   }    - static int call_lfun(int left, int right) + static int call_lfun(enum LFUN left, enum LFUN right)   {    struct object *o;    struct program *p;
2526:      PMOD_EXPORT void o_and(void)   { -  if(TYPEOF(sp[-1]) != TYPEOF(sp[-2])) +  if(UNLIKELY(TYPEOF(sp[-1]) != TYPEOF(sp[-2])))    {    if(call_lfun(LFUN_AND, LFUN_RAND))    return;