pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.174 2001/03/31 01:22:20 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.175 2001/03/31 16:04:34 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:1767:    else if (t1->type == T_ZERO && zero_implied)    {    push_finished_type(t2);    }    else if(t1->type == T_MIXED || t2->type == T_MIXED)    {    push_type(T_MIXED);    }    else if(t1->type == T_INT && t2->type == T_INT)    { -  /* FIXME: -  * This should only be done if the ranges are -  * overlapping or adjecant to each other. /Hubbe -  */ +     INT32 min, max; -  +  +  if (MINIMUM((ptrdiff_t)t1->cdr, (ptrdiff_t)t2->cdr) < +  MAXIMUM((ptrdiff_t)t1->car, (ptrdiff_t)t2->car)) { +  /* No overlap. */ +  push_finished_type(t1); +  push_finished_type(t2); +  push_type(T_OR); +  } else { +  /* Overlap */    min = MINIMUM((ptrdiff_t)t1->car, (ptrdiff_t)t2->car);    max = MAXIMUM((ptrdiff_t)t1->cdr, (ptrdiff_t)t2->cdr);       push_int_type(min, max);    } -  +  }    else if (t1->type == T_SCOPE)    {    if (t2->type == T_SCOPE) {    low_or_pike_types(t1->cdr, t2->cdr, zero_implied);    if (t1->car > t2->car)    push_scope_type((ptrdiff_t)t1->car);    else    push_scope_type((ptrdiff_t)t2->car);    } else {    low_or_pike_types(t1->cdr, t2, zero_implied);