pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:3095:    } else if (!t1) {    t = t2;    ret = 1;    } else if (!t2) {    t = t1;    ret = -1;    } else if (zero_implied && (t1->type == T_ZERO)) {    t = t2;    } else if (zero_implied && (t2->type == T_ZERO)) {    t = t1; -  } else if ((t1->type == T_NOT) && pike_types_le(t1->car, t2)) { +  } else if ((t1->type == T_NOT) && pike_types_le(t1->car, t2, 0, 0)) {    t = mixed_type_string; -  } else if ((t2->type == T_NOT) && pike_types_le(t2->car, t1)) { +  } else if ((t2->type == T_NOT) && pike_types_le(t2->car, t1, 0, 0)) {    t = mixed_type_string;    } else if ((t1->type ^ '0') < (t2->type ^ '0')) {    /* Note: Adjusted order to get markers first. */    t = t1;    ret = -1;    } else if ((t1->type ^ '0') > (t2->type ^ '0')) {    /* Note: Adjusted order to get markers first. */    t = t2;    ret = 1;    } else {
pike.git/src/pike_types.cmod:3250:    ret = -1;    break;    } else if (t1->car->type > t2->car->type) {    t = t2;    ret = 1;    break;    }    /* FALLTHRU */    default:   #if 0 -  if (pike_types_le(t1, t2)) { +  if (pike_types_le(t1, t2, 0, 0)) {    t = t2; -  } else if (pike_types_le(t2, t1)) { +  } else if (pike_types_le(t2, t1, 0, 0)) {    t = t1;    } else   #endif /* 0 */    if (t1 < t2) {    t = t1;    ret = -1;    } else {    t = t2;    ret = 1;    }
pike.git/src/pike_types.cmod:9091:    }       free_type(tmp);    free_type(tmp2);    free_mapping(markers);   #endif       return !!res;   }    - int pike_types_le(struct pike_type *a,struct pike_type *b) + int pike_types_le(struct pike_type *a, struct pike_type *b, +  enum pt_cmp_flags aflags, enum pt_cmp_flags bflags)   {    struct remap_state remap;    struct pike_type *tmp, *tmp2 = NULL;   #ifdef PIKE_DEBUG    int res;    struct pike_type **save_type_stackp = Pike_compiler->type_stackp;    struct pike_type ***save_mark_stackp = Pike_compiler->pike_type_mark_stackp;   #endif       memset(&remap, 0, sizeof(remap));    -  tmp = low_type_binop(PT_BINOP_MINUS, a, b, &remap, 0, 0, 0); +  tmp = low_type_binop(PT_BINOP_MINUS, a, b, &remap, aflags, bflags, 0);       if (tmp) {    struct mapping *markers = allocate_mapping(10);    tmp2 = remap_markers(tmp, markers, NULL, PT_FLAG_REMAP_EVAL_MARKERS);    free_mapping(markers);    }      #ifdef PIKE_DEBUG    clear_markers();    res = low_pike_types_le(a, b, 0, 0);
pike.git/src/pike_types.cmod:9132:    simple_describe_type(a);    fprintf(stderr, "\nb: ");    simple_describe_type(b);    fprintf(stderr, "\nres: %d\ntmp: ", res);    simple_describe_type(tmp);    fprintf(stderr, "\ntmp2: ");    simple_describe_type(tmp2);    fprintf(stderr, "\n\n");       tmp3 = low_type_binop(PT_BINOP_MINUS, a, b, &remap, -  0, 0, PT_FLAG_REMAP_TRACE); +  aflags, bflags, PT_FLAG_REMAP_TRACE);    fprintf(stderr, "tmp3: ");    simple_describe_type(tmp3);    fprintf(stderr, "\n\n");       if ((save_type_stackp != Pike_compiler->type_stackp) ||    (save_mark_stackp != Pike_compiler->pike_type_mark_stackp)) {    Pike_fatal("Stack level corruption!\n"    "type stack: %p (expected: %p)\n"    "mark stack: %p (expected: %p)\n",    Pike_compiler->type_stackp, save_type_stackp,
pike.git/src/pike_types.cmod:10539:    if (!CDR_TO_INT(orig_type)) {    copy_pike_type(res, orig_type);    } else if (!CDR_TO_INT(soft_type)) {    copy_pike_type(res, soft_type);    } else if (CDR_TO_INT(soft_type) == CDR_TO_INT(orig_type)) {    if (!CAR_TO_INT(orig_type)) {    copy_pike_type(res, orig_type);    } else {    copy_pike_type(res, soft_type);    } -  } else if (pike_types_le(soft_type, orig_type)) { +  } else if (pike_types_le(soft_type, orig_type, 0, 0)) {    copy_pike_type(res, orig_type); -  } else if (pike_types_le(orig_type, soft_type)) { +  } else if (pike_types_le(orig_type, soft_type, 0, 0)) {    copy_pike_type(res, soft_type);    } else {    copy_pike_type(res, object_type_string);    }    } else {    if (!CDR_TO_INT(orig_type)) {    copy_pike_type(res, soft_type);    } else if (!CDR_TO_INT(soft_type)) {    copy_pike_type(res, orig_type);    } else if (CDR_TO_INT(soft_type) == CDR_TO_INT(orig_type)) {    if (CAR_TO_INT(orig_type)) {    copy_pike_type(res, orig_type);    } else {    copy_pike_type(res, soft_type);    } -  } else if (pike_types_le(soft_type, orig_type)) { +  } else if (pike_types_le(soft_type, orig_type, 0, 0)) {    copy_pike_type(res, soft_type); -  } else if (pike_types_le(orig_type, soft_type)) { +  } else if (pike_types_le(orig_type, soft_type, 0, 0)) {    copy_pike_type(res, orig_type);    }    }    break;    }    break;    }    }    if (tmp) free_type(tmp);    if (tmp2) free_type(tmp2);
pike.git/src/pike_types.cmod:12832:    INT32 b_line,    struct pike_type *type_b)   {    DECLARE_CYCLIC();       implements_a=0;    implements_b=0;    implements_mode=0;       /* Note the argument order. */ -  pike_types_le(type_b, type_a); +  pike_types_le(type_b, type_a, 0, 0);      #if 0    if(!(implements_a && implements_b &&    type_a->str[0]==T_OBJECT &&    type_b->str[0]==T_OBJECT))   #endif /* 0 */    {    ref_push_type_value(type_a);    yytype_report(severity_level, NULL, 0, NULL, a_file, a_line, NULL,    1, "Expected: %O.");
pike.git/src/pike_types.cmod:12877:    struct pike_type *type_a,    struct pike_type *type_b)   {    DECLARE_CYCLIC();       implements_a=0;    implements_b=0;    implements_mode=0;       /* Note the argument order. */ -  pike_types_le(type_b, type_a); +  pike_types_le(type_b, type_a, 0, 0);      #if 0    if(!(implements_a && implements_b &&    type_a->str[0]==T_OBJECT &&    type_b->str[0]==T_OBJECT))   #endif /* 0 */    {    ref_push_type_value(type_a);    ref_push_type_value(type_b);    string_builder_sprintf(s,