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.199 2008/01/29 20:10:06 grubba Exp $ + || $Id: array.c,v 1.200 2008/02/12 18:51:29 grubba 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:1223:   /** This sort is stable. The return value is like the one from    * get_alpha_order. */   PMOD_EXPORT INT32 *stable_sort_array_destructively(struct array *v)   {    INT32 *current_order;    ONERROR tmp;    int e;       if(!v->size) return NULL;    -  /* Overlow safe: ((1<<29)-4)*4 < ULONG_MAX */ +  /* Overflow safe: ((1<<29)-4)*4 < ULONG_MAX */    current_order=(INT32 *)xalloc(v->size * sizeof(INT32));    SET_ONERROR(tmp, free, current_order);    for(e=0; e<v->size; e++) current_order[e]=e;       low_stable_sort_svalues (0, v->size - 1, ITEM (v), current_order, v->size);       UNSET_ONERROR (tmp);    return current_order;   }