[rtems commit] PR2083 Wrong return value in _RBTree_Has_only_one_node
Gedare Bloom
gedare at rtems.org
Tue Dec 18 16:23:48 UTC 2012
Module: rtems
Branch: master
Commit: 7b5513f04fa4aee88936cd6cd3c3fc5e0fc4e8f2
Changeset: http://git.rtems.org/rtems/commit/?id=7b5513f04fa4aee88936cd6cd3c3fc5e0fc4e8f2
Author: Andreas Heinig <andreas.heinig at cs.tu-dortmund.de>
Date: Tue Dec 18 11:27:49 2012 -0500
PR2083 Wrong return value in _RBTree_Has_only_one_node
The function _RBTree_Has_only_one_node shall return a boolean value, but
returns NULL. NULL, however, is defined as: (void *)0. Hence it does not match
the scalar bool type. Return false instead.
---
cpukit/score/inline/rtems/score/rbtree.inl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpukit/score/inline/rtems/score/rbtree.inl b/cpukit/score/inline/rtems/score/rbtree.inl
index c5187a0..439b40a 100644
--- a/cpukit/score/inline/rtems/score/rbtree.inl
+++ b/cpukit/score/inline/rtems/score/rbtree.inl
@@ -221,7 +221,7 @@ RTEMS_INLINE_ROUTINE bool _RBTree_Has_only_one_node(
const RBTree_Control *the_rbtree
)
{
- if(!the_rbtree) return NULL; /* TODO: expected behavior? */
+ if(!the_rbtree) return false; /* TODO: expected behavior? */
return (the_rbtree->root->child[RBT_LEFT] == NULL && the_rbtree->root->child[RBT_RIGHT] == NULL);
}
More information about the vc
mailing list