pike.git / src / svalue.c

version» Context lines:

pike.git/src/svalue.c:962:    }    if (a_obj->prog == b_obj->prog) {    /* Common case. */    if (a_fun == b_fun) return 1;    }    /* Consider a and b the same if they are the same identifier. */    return ID_FROM_INT(a_obj->prog, a_fun) == ID_FROM_INT(b_obj->prog, b_fun);    }       case T_TYPE: -  return pike_types_le(a->u.type, b->u.type) && -  pike_types_le(b->u.type, a->u.type); +  return pike_types_le(a->u.type, b->u.type, 0, 0) && +  pike_types_le(b->u.type, a->u.type, 0, 0);       case T_OBJECT:    return object_equal_p(a->u.object, b->u.object, proc);       case T_ARRAY:    check_array_for_destruct(a->u.array);    check_array_for_destruct(b->u.array);    return array_equal_p(a->u.array, b->u.array, proc);       case T_MAPPING:
pike.git/src/svalue.c:1215:       /* At this point both a and b have type T_TYPE */   #ifdef PIKE_DEBUG    if ((TYPEOF(*a) != T_TYPE) || (TYPEOF(*b) != T_TYPE)) {    Pike_fatal("Unexpected types in comparison.\n");    }   #endif /* PIKE_DEBUG */    /* fall through */       case T_TYPE: -  return pike_types_le(a->u.type, b->u.type) && -  !pike_types_le(b->u.type, a->u.type); +  return pike_types_le(a->u.type, b->u.type, 0, 0) && +  !pike_types_le(b->u.type, a->u.type, 0, 0);    }   }      PMOD_EXPORT int is_le(const struct svalue *a, const struct svalue *b)   {    /* Can't optimize this to !is_gt (a, b) since that'd assume total order. */    int mask = (1 << TYPEOF(*a))|(1 << TYPEOF(*b));    if (!(mask & ~(BIT_FUNCTION|BIT_PROGRAM|BIT_TYPE))) {    /* NOTE: Special case for types, since is_eq() below only does    * a pointer comparison.
pike.git/src/svalue.c:1266:    int id = p->id;    type_stack_mark();    push_object_type(0, id);    b_type = pop_unfinished_type();    } else {    free_type(a_type);    Pike_error("Bad argument to comparison.\n");    }    }    -  res = pike_types_le(a_type, b_type); +  res = pike_types_le(a_type, b_type, 0, 0);    free_type(a_type);    free_type(b_type);    return res;    } else if (mask == (BIT_INT | BIT_FLOAT)) {    /* Special case, since is_eq() won't promote ints to floats... */    FLOAT_TYPE aa, bb;    if (TYPEOF(*a) == PIKE_T_INT) {    aa = (FLOAT_TYPE)a->u.integer;    bb = b->u.float_number;    } else {