diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-25 12:05:53 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-29 10:33:33 +0100 |
commit | 70382718450c6b5d83232188cc71b6c795048a27 (patch) | |
tree | 454cdea0181e12e183532d24cc7483fa28c9a09e /cpukit/score/src/objectnamespaceremove.c | |
parent | score: Remove bogus thread object name support (diff) | |
download | rtems-70382718450c6b5d83232188cc71b6c795048a27.tar.bz2 |
Remove RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES
Enable support for string objects names unconditionally. Add const
qualifier throughout. Split _Objects_Namespace_remove() into
_Objects_Namespace_remove_u32() and _Objects_Namespace_remove_string()
to avoid an unnecessary dependency on _Workspace_Free().
Update #2514.
Diffstat (limited to 'cpukit/score/src/objectnamespaceremove.c')
-rw-r--r-- | cpukit/score/src/objectnamespaceremove.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/cpukit/score/src/objectnamespaceremove.c b/cpukit/score/src/objectnamespaceremove.c index 6698737254..cc2c954a77 100644 --- a/cpukit/score/src/objectnamespaceremove.c +++ b/cpukit/score/src/objectnamespaceremove.c @@ -22,24 +22,24 @@ #include <rtems/score/objectimpl.h> #include <rtems/score/wkspace.h> -void _Objects_Namespace_remove( - Objects_Information *information, - Objects_Control *the_object +void _Objects_Namespace_remove_u32( + const Objects_Information *information, + Objects_Control *the_object ) { - #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) - /* - * If this is a string format name, then free the memory. - */ - if ( information->is_string ) - _Workspace_Free( (void *)the_object->name.name_p ); - #endif - - /* - * Clear out either format. - */ - #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) - the_object->name.name_p = NULL; - #endif + _Assert( !information->is_string ); the_object->name.name_u32 = 0; } + +void _Objects_Namespace_remove_string( + const Objects_Information *information, + Objects_Control *the_object +) +{ + char *name; + + _Assert( information->is_string ); + name = RTEMS_DECONST( char *, the_object->name.name_p ); + the_object->name.name_p = NULL; + _Workspace_Free( name ); +} |