Branch: Tag:

2002-12-23

2002-12-23 13:14:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Replaced use of goto in macro DO_SIMPLE_UNLINK() with break.
Works around bugs in cl/IA32.

Rev: src/rbtree.c:1.23

2:   || 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: rbtree.c,v 1.22 2002/12/22 17:18:55 mast Exp $ + || $Id: rbtree.c,v 1.23 2002/12/23 13:14:07 grubba Exp $   */      /* An implementation of a threaded red/black balanced binary tree.
12:      #include "global.h"    - RCSID("$Id: rbtree.c,v 1.22 2002/12/22 17:18:55 mast Exp $"); + RCSID("$Id: rbtree.c,v 1.23 2002/12/23 13:14:07 grubba Exp $");      #include "interpret.h"   #include "pike_error.h"
803:    *root = rebalance_after_add (new, rbstack);   }    - #define DO_SIMPLE_UNLINK(UNLINK, PARENT, NODE) do { \ + #define DO_SIMPLE_UNLINK(UNLINK, PARENT, NODE) \ +  do { \    PARENT = RBSTACK_PEEK (rbstack); \    \    if (UNLINK->flags & RB_THREAD_PREV) { \
815:    (PARENT->flags |= RB_THREAD_NEXT, NODE = UNLINK->next)); \    else \    NODE = NULL; \ -  goto simple_unlink_done; \ +  break; /* We're done. */ \    } \    \    else { /* prev is null. */ \
843:    } \    \    if (PARENT) SET_PTR_TO_CHILD (PARENT, UNLINK, NODE, NODE); \ -  simple_unlink_done:; \ +     } while (0)      #define ADJUST_STACK_TO_NEXT(RBSTACK, NEXT) do { \