From e001d84afb3b50c9c91f41eda05b78e45382fcff Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 24 Jul 2000 22:28:15 +0000 Subject: Use bitwise and not cast to unsigned16 to remove upper bits. --- cpukit/score/src/objectget.c | 4 +++- cpukit/score/src/objectgetisr.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/objectget.c b/cpukit/score/src/objectget.c index 01d8683ca7..4c30d2a008 100644 --- a/cpukit/score/src/objectget.c +++ b/cpukit/score/src/objectget.c @@ -54,7 +54,9 @@ Objects_Control *_Objects_Get( unsigned32 index; /* index = _Objects_Get_index( id ); */ - index = (unsigned16) id; + index = id & 0x0000ffff; + /* This should work but doesn't always :( */ + /* index = (unsigned16) id; */ if ( information->maximum >= index ) { _Thread_Disable_dispatch(); diff --git a/cpukit/score/src/objectgetisr.c b/cpukit/score/src/objectgetisr.c index ea63469e12..9d0951d9fd 100644 --- a/cpukit/score/src/objectgetisr.c +++ b/cpukit/score/src/objectgetisr.c @@ -58,7 +58,9 @@ Objects_Control *_Objects_Get_isr_disable( ISR_Level level; /* index = _Objects_Get_index( id ); */ - index = (unsigned16) id; + index = id & 0x0000ffff; + /* This should work but doesn't always :( */ + /* index = (unsigned16) id; */ _ISR_Disable( level ); if ( information->maximum >= index ) { -- cgit v1.2.3