Use bitwise and not cast to unsigned16 to remove upper bits.

This commit is contained in:
Joel Sherrill
2000-07-24 22:28:15 +00:00
parent ce21604c21
commit e001d84afb
4 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -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();
+3 -1
View File
@@ -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 ) {
+3 -1
View File
@@ -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();
+3 -1
View File
@@ -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 ) {