mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
opr: Silence rbtree warning
On OS X, gcc can complain that 'child' is uninitialized whenever this 'else if' condition is false. We already handled the case where both node->right and node->left are non-NULL earlier in this function, so this should never occur. So, to get rid of the warning, just always take the path in the 'else if', and assert that the right child is NULL. Change-Id: I3575de84ea172d3c7e0e022809fdcd0e3b4dcc27 Reviewed-on: http://gerrit.openafs.org/10687 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
b921bf94f6
commit
9f8b765bbd
@ -40,6 +40,7 @@
|
||||
#else
|
||||
# include <roken.h>
|
||||
#endif
|
||||
#include <afs/opr.h>
|
||||
|
||||
#include "rbtree.h"
|
||||
|
||||
@ -422,8 +423,10 @@ opr_rbtree_remove(struct opr_rbtree *head, struct opr_rbtree_node *node)
|
||||
|
||||
if (node->left == NULL)
|
||||
child = node->right;
|
||||
else if (node->right == NULL)
|
||||
else {
|
||||
opr_Assert(node->right == NULL);
|
||||
child = node->left;
|
||||
}
|
||||
|
||||
child->parent = node->parent;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user