summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-25 16:00:17 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-06 09:06:21 +0100
commit0c286e3d7c176a4fb7faf6ba9f809996d599ca10 (patch)
treebf30809e9a4f92d19254fa1acb1f833effa8dc40 /testsuites
parentscore: Remove superfluous include (diff)
downloadrtems-0c286e3d7c176a4fb7faf6ba9f809996d599ca10.tar.bz2
score: _Chain_Insert_ordered_unprotected()
Change the chain order relation to use a directly specified left hand side value. This is similar to _RBTree_Insert_inline() and helps the compiler to better optimize the code.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/spchain/init.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
index 67bc3f53d0..51278d52f3 100644
--- a/testsuites/sptests/spchain/init.c
+++ b/testsuites/sptests/spchain/init.c
@@ -426,9 +426,14 @@ static void test_chain_node_count(void)
}
}
-static bool test_order( const Chain_Node *left, const Chain_Node *right )
+static bool test_order( const void *left, const Chain_Node *right )
{
- return left < right;
+ return (uintptr_t) left < (uintptr_t) right;
+}
+
+static void insert_ordered( Chain_Control *chain, Chain_Node *node )
+{
+ _Chain_Insert_ordered_unprotected( chain, node, node, test_order );
}
static void test_chain_insert_ordered( void )
@@ -446,11 +451,11 @@ static void test_chain_insert_ordered( void )
_Chain_Initialize_node( &nodes[ i ] );
}
- _Chain_Insert_ordered_unprotected( &chain, &nodes[4], test_order );
- _Chain_Insert_ordered_unprotected( &chain, &nodes[2], test_order );
- _Chain_Insert_ordered_unprotected( &chain, &nodes[0], test_order );
- _Chain_Insert_ordered_unprotected( &chain, &nodes[3], test_order );
- _Chain_Insert_ordered_unprotected( &chain, &nodes[1], test_order );
+ insert_ordered( &chain, &nodes[4] );
+ insert_ordered( &chain, &nodes[2] );
+ insert_ordered( &chain, &nodes[0] );
+ insert_ordered( &chain, &nodes[3] );
+ insert_ordered( &chain, &nodes[1] );
tail = _Chain_Immutable_tail( &chain );
node = _Chain_Immutable_first( &chain );