pike.git / src / rbtree.c

version» Context lines:

pike.git/src/rbtree.c:1:   /* An implementation of a threaded red/black balanced binary tree.    *    * Created 2001-04-27 by Martin Stjernholm    * -  * $Id: rbtree.c,v 1.6 2001/05/02 11:07:15 mast Exp $ +  * $Id: rbtree.c,v 1.7 2001/05/02 14:50:37 grubba Exp $    */      #include "global.h"   #include "constants.h"   #include "builtin_functions.h"   #include "interpret.h"   #include "mapping.h"   #include "pike_error.h"   #include "svalue.h"   #include "rbtree.h"
pike.git/src/rbtree.c:354:      PMOD_EXPORT int rb_indval_delete (struct rb_node_indval **tree,    struct svalue *ind,    struct svalue *cmp_less)   {    struct rb_node_indval *old;    if (cmp_less) {    struct svalue_cmp_data data;    data.cmp_less = cmp_less;    data.key = ind; -  HDR (old) = low_rb_delete ((struct rb_node_hdr **) tree, +  old = INDVAL(low_rb_delete((struct rb_node_hdr **) tree,    (low_rb_cmp_fn *) svalue_cmp_eq, &data, -  sizeof (struct rb_node_indval)); +  sizeof (struct rb_node_indval)));    }    else -  HDR (old) = low_rb_delete ((struct rb_node_hdr **) tree, +  old = INDVAL(low_rb_delete((struct rb_node_hdr **) tree,    (low_rb_cmp_fn *) rb_ind_default_cmp, ind, -  sizeof (struct rb_node_indval)); +  sizeof (struct rb_node_indval)));    if (old) {    struct svalue tmp;    free_svalue (use_rb_node_ind (old, tmp));    free_svalue (&old->val);    really_free_rb_node_indval (old);    return 1;    }    return 0;   }   
pike.git/src/rbtree.c:384:    struct rb_node_indval *node,    struct svalue *cmp_less)   {    struct svalue tmp;    struct rb_node_indval *old;    use_rb_node_ind (node, tmp);    if (cmp_less) {    struct svalue_cmp_data data;    data.cmp_less = cmp_less;    data.key = &tmp; -  HDR (old) = low_rb_delete_node ((struct rb_node_hdr **) tree, +  old = INDVAL(low_rb_delete_node((struct rb_node_hdr **) tree,    (low_rb_cmp_fn *) svalue_cmp_eq, &data, -  HDR (node), sizeof (struct rb_node_indval)); +  HDR(node), sizeof(struct rb_node_indval)));    }    else -  HDR (old) = low_rb_delete_node ((struct rb_node_hdr **) tree, +  old = INDVAL(low_rb_delete_node((struct rb_node_hdr **) tree,    (low_rb_cmp_fn *) rb_ind_default_cmp, &tmp, -  HDR (node), sizeof (struct rb_node_indval)); +  HDR(node), sizeof(struct rb_node_indval)));    free_svalue (use_rb_node_ind (old, tmp));    free_svalue (&old->val);    really_free_rb_node_indval (old);    return old;   }      static struct rb_node_indval *copy_indval_node (struct rb_node_indval *node)   {    struct rb_node_indval *new = alloc_rb_node_indval();    struct svalue tmp;