pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:1:   /*   || 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: array.c,v 1.157 2004/04/06 13:00:40 nilsson Exp $ + || $Id: array.c,v 1.158 2004/04/06 15:37:54 nilsson Exp $   */      #include "global.h"   #include "svalue.h"   #include "array.h"   #include "object.h"   #include "las.h"   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"
pike.git/src/array.c:19:   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "pike_security.h"   #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"   #include "multiset.h"    - RCSID("$Id: array.c,v 1.157 2004/04/06 13:00:40 nilsson Exp $"); + RCSID("$Id: array.c,v 1.158 2004/04/06 15:37:54 nilsson Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    0, /* previous */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:953:    return 0;    else    return -1;    else    if (!b->u.array->size)    return 1;    return alpha_svalue_cmpfun(ITEM(a->u.array), ITEM(b->u.array));       case T_MULTISET:    if (a == b) return 0; - #ifdef PIKE_NEW_MULTISETS +     {    ptrdiff_t a_pos = multiset_first (a->u.multiset);    ptrdiff_t b_pos = multiset_first (b->u.multiset);    struct svalue ind_a, ind_b;    if (a_pos < 0)    if (b_pos < 0)    return 0;    else    return -1;    else    if (b_pos < 0)    return 1;    res = alpha_svalue_cmpfun (    use_multiset_index (a->u.multiset, a_pos, ind_a),    use_multiset_index (b->u.multiset, b_pos, ind_b));    sub_msnode_ref (a->u.multiset);    sub_msnode_ref (b->u.multiset);    return res;    } - #else -  if (multiset_is_empty (a->u.multiset)) -  if (multiset_is_empty (b->u.multiset)) -  return 0; -  else -  return -1; -  else -  if (multiset_is_empty (b->u.multiset)) -  return 1; -  return alpha_svalue_cmpfun (ITEM (a->u.multiset->ind), ITEM (b->u.multiset->ind)); - #endif +        case T_OBJECT:    if(a->u.object == b->u.object) return 0;    break;       default:   #if 1    /* I think it would be better to leave the order undefined in    * these cases since the addresses aren't observable    * properties in pike. /mast */