Branch: Tag:

2004-08-16

2004-08-16 16:21:08 by Martin Stjernholm <mast@lysator.liu.se>

Fixed 7.4 compatibility in object/class type checks by reverting 1.225 and
1.226 in 7.4 compatibility mode.

Rev: src/pike_types.c:1.235

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_types.c,v 1.234 2004/04/19 13:08:38 grubba Exp $ + || $Id: pike_types.c,v 1.235 2004/08/16 16:21:08 mast Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.234 2004/04/19 13:08:38 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.235 2004/08/16 16:21:08 mast Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
2676:    /* object(* 0) matches any object */    if(!a->cdr || !b->cdr) break;    +  /* object(x *) =? object(x *) */ +  if(TEST_COMPAT(7,4) && a->car == b->car)    { -  +  /* x? */ +  if(a->car) +  { +  /* object(1 x) =? object(1 x) */ +  if(a->cdr != b->cdr) return 0; +  }else{ +  /* object(0 *) =? object(0 *) */ +  break; +  } +  } +  +  {    struct program *ap,*bp;    ap = id_to_program(CDR_TO_INT(a));    bp = id_to_program(CDR_TO_INT(b));
2684:    if(!ap || !bp) break;       implements_mode = 0; +  +  if (TEST_COMPAT(7,4)) { +  if(a->car) +  {    if (!is_compatible(implements_a=ap,implements_b=bp))    return 0; -  +  }else{ +  if(!is_compatible(implements_a=bp,implements_b=ap)) +  return 0;    } -  +  } +  else { +  if (!is_compatible(implements_a=ap,implements_b=bp)) +  return 0; +  } +  }    break;       case T_INT:
3209:    * /grubba 2003-11-11    */    -  if (/* (a->car || !b->car) && */ +  if (TEST_COMPAT(7,4)) { +  if ((a->car || !b->car) &&    (a->cdr == b->cdr))    return 1;    -  /* -  * if (b->car) { -  * return 0; -  * } -  */ +  if (b->car) { +  return 0; +  } +  } +  else { +  if (a->cdr == b->cdr) +  return 1; +  } +     {    struct program *ap = id_to_program(CDR_TO_INT(a));    struct program *bp = id_to_program(CDR_TO_INT(b));
3226:    /* Shouldn't happen... */    return 0;    } -  if ((flags & LE_WEAK_OBJECTS) /* && (!a->car) */) { +  if ((flags & LE_WEAK_OBJECTS) && +  (!TEST_COMPAT(7,4) || (!a->car))) {    implements_mode = 0;    return is_compatible(implements_a=ap, implements_b=bp);    }