From 70382718450c6b5d83232188cc71b6c795048a27 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 25 Oct 2018 12:05:53 +0200 Subject: 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. --- cpukit/score/src/objectnamespaceremove.c | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'cpukit/score/src/objectnamespaceremove.c') 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 #include -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 ); +} -- cgit v1.2.3