pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:4891:    case T_ZERO:    case T_FLOAT:    /* Not reached. Should be handled by the a == b test at    * the beginning of the function.    */    Pike_fatal("Type hashing has duplicates.\n");    return NULL;       case T_INT:    { -  INT32 bounds[6] = { MIN_INT32, }; +  INT32 bounds[6] = { MIN_INT32, }; /* Start sentinel. */    int ab[6] = { 0, 0, };    int i;    int nbounds = 1;    INT32 bound;    INT32 other;    -  /* NB: The bits in ab are selected so that they match +  /* +  * Implementation notes: +  * +  * bounds[] contains the values where the set changes in order +  * from smallest to largest. It always contains at least the +  * start sentinel value (MIN_INT32) at position 0. +  * +  * ab[] contains one bit for each of a and b indicating whether +  * the corresponding value in bounds[] is a member of a and/or b. +  * +  * nbounds contains the number of valid entries in bounds[] and ab[]. +  * +  * To avoid issues with overflow and similar the end sentinel +  * (ie MAX_INT32 + 1) is not in bounds[]. +  * +  * NB: The bits in ab are selected so that they match    * the shifts for the minterms in enum pt_binop. -  +  * +  * bounds[] and ab[] are created with insert sort.    */    bound = CAR_TO_INT(a);    for (i = nbounds; i-- && bounds[i] > bound;) {    ab[i] |= 2;    }    if (bounds[i] < bound) {    /* We need to insert a bound. */    i++;    memmove(bounds + i + 1, bounds + i,    sizeof(bounds[i]) * (nbounds - i));