pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.100 2001/01/03 16:36:45 grubba Exp $"); + RCSID("$Id: array.c,v 1.101 2001/01/03 21:35:13 grubba Exp $");      PMOD_EXPORT struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:673:    if(a->u.integer > b->u.integer) return 1;    return 0;       default:    if(a->u.refs < b->u.refs) return -1;    if(a->u.refs > b->u.refs) return 1;    return 0;       case T_OBJECT:    if(a->u.object == b->u.object) return 0; -  if(a->u.refs < b->u.refs) { def=-1; break; } -  if(a->u.refs > b->u.refs) { def=1; break; } -  def = (a<b)?-1:1; +  if(a->u.object->prog == b->u.object->prog) { +  if (a->u.object->prog) { +  if(a->u.object < b->u.object) { +  def = -1; +  } else { +  def = 1; +  } +  } else { +  /* Destructed objects are considered equal. */ +  return 0; +  } +  } else { +  /* Attempt to group objects cloned from the same program */ +  if (a->u.object->prog < b->u.object->prog) { +  def = -1; +  } else { +  def = 1; +  } +  }    break;    }    }else{    def=a->type - b->type;    }       if (a->type == T_OBJECT && a->u.object->prog) {    if (FIND_LFUN(a->u.object->prog,LFUN_LT) != -1) {    push_svalue(b);    apply_lfun(a->u.object,LFUN_LT,1);