pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:3074:    case PIKE_T_OPERATOR:    case PIKE_T_TRANSITIVE:    t = t->car;    continue;    }    break;    }    return 0;   }    + /** +  * Get the range for an integer type. +  * +  * @param t +  * Integer type to check. +  * +  * @param range +  * Array of two elements (min, max) before calling the +  * function, the array should be initialized to (max, min). +  * +  * Returns 1 if t contained an integer type. This also implies +  * that range has been updated accordingly. +  * +  * Returns 0 if t did not contain any integer type. The range +  * array will be left unmodified in this case. +  */   int get_int_type_range(struct pike_type *t, INT_TYPE *range)   {    int ret = 0;    loop: -  switch(t->type) { +  switch(t?t->type:PIKE_T_UNKNOWN) {    case T_INT:    {    INT_TYPE min = CAR_TO_INT(t);    INT_TYPE max = CDR_TO_INT(t);    if (range[0] > min) range[0] = min;    if (range[1] < max) range[1] = max;    return 1;    }    break;    case T_ZERO:
pike.git/src/pike_types.cmod:3105:    case PIKE_T_NAME:    case PIKE_T_ATTRIBUTE:    t = t->cdr;    goto loop;    case T_OR:    case T_AND:    ret = ret | get_int_type_range(t->car, range);    t = t->cdr;    goto loop;    case T_MIXED: -  return 1; +  t = int_type_string; +  goto loop;    default:    break;    }    return ret;   }      static void low_or_pike_types(struct pike_type *t1,    struct pike_type *t2,    int zero_implied);