diff options
author | Damien Miller <djm@mindrot.org> | 2003-01-08 11:16:48 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-01-08 11:16:48 +1100 |
commit | 13dd03a0e2605f0ec2da811aa814a58bc2dd9a3d (patch) | |
tree | 16312c22195da192458f6e9c8e9b2def232ad2dc /openbsd-compat/sys-tree.h | |
parent | bc9b7c41e2339cc5158357213dad9f238612705b (diff) |
- (djm) Sync openbsd-compat/ with OpenBSD -current
Diffstat (limited to 'openbsd-compat/sys-tree.h')
-rw-r--r-- | openbsd-compat/sys-tree.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/openbsd-compat/sys-tree.h b/openbsd-compat/sys-tree.h index 0a58710c..927ca04c 100644 --- a/openbsd-compat/sys-tree.h +++ b/openbsd-compat/sys-tree.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.h,v 1.6 2002/06/11 22:09:52 provos Exp $ */ +/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -343,12 +343,13 @@ struct { \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - RB_AUGMENT(RB_PARENT(elm, field)); \ } else \ (head)->rbh_root = (tmp); \ RB_LEFT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ } while (0) #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ @@ -362,12 +363,13 @@ struct { \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ - RB_AUGMENT(RB_PARENT(elm, field)); \ } else \ (head)->rbh_root = (tmp); \ RB_RIGHT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ } while (0) /* Generates prototypes and inline functions */ |