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.94 2000/11/17 10:14:03 per Exp $"); + RCSID("$Id: array.c,v 1.95 2000/11/29 21:22:21 hubbe 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:1258:    * before zipping the sets together.    */   PMOD_EXPORT struct array *merge_array_with_order(struct array *a, struct array *b,INT32 op)   {    ONERROR r1,r2,r3,r4,r5;    INT32 *zipper;    struct array *tmpa,*tmpb,*ret;    INT32 *ordera, *orderb;       ordera=get_set_order(a); -  orderb=get_set_order(b); +  SET_ONERROR(r4,free,ordera);    -  +  orderb=get_set_order(b);    SET_ONERROR(r5,free,orderb); -  SET_ONERROR(r4,free,ordera); +     tmpa=reorder_and_copy_array(a,ordera);    SET_ONERROR(r1,do_free_array,tmpa);       tmpb=reorder_and_copy_array(b,orderb);    SET_ONERROR(r2,do_free_array,tmpb);       zipper=merge(tmpa,tmpb,op);    SET_ONERROR(r3,free,zipper);          fsort_with_order( (zipper+1), zipper+*zipper, array_merge_fun,    ordera, orderb );       ret=array_zip(tmpa,tmpb,zipper);    UNSET_ONERROR(r3); free((char *)zipper);    UNSET_ONERROR(r2); free_array(tmpb);    UNSET_ONERROR(r1); free_array(tmpa); -  UNSET_ONERROR(r4); free((char *)ordera); +     UNSET_ONERROR(r5); free((char *)orderb); -  +  UNSET_ONERROR(r4); free((char *)ordera);    return ret;   }         #define CMP(X,Y) set_svalue_cmpfun(X,Y)   #define TYPE struct svalue   #define ID set_sort_svalues   #include "fsort_template.h"   #undef CMP   #undef TYPE