diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-25 14:12:22 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-05 07:08:40 +0200 |
commit | b8774933223f0573833c6ee0f668e0fea0fc8fbc (patch) | |
tree | a36e9a6ce3e7f75d219708af46ca787201c218b9 /cpukit/score/src | |
parent | rtems: Move _Status_Object_name_errors_to_status (diff) | |
download | rtems-b8774933223f0573833c6ee0f668e0fea0fc8fbc.tar.bz2 |
score: Simplify _Objects_Name_to_string()
Do not use isprint() from <ctype.h> since it depends on the heavy weight
C locale implementation in Newlib.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/objectgetnameasstring.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c index 7a6177a124..f23b1599e1 100644 --- a/cpukit/score/src/objectgetnameasstring.c +++ b/cpukit/score/src/objectgetnameasstring.c @@ -21,7 +21,17 @@ #include <rtems/score/threadimpl.h> -#include <ctype.h> +/* + * Do not use isprint() from <ctypes.h> since this depends on the heavy weight + * C locale support of Newlib. + */ +static bool _Objects_Name_char_is_printable( char c ) +{ + unsigned char uc; + + uc = (unsigned char) c; + return uc >= ' ' && uc <= '~'; +} size_t _Objects_Name_to_string( Objects_Name name, @@ -55,7 +65,7 @@ size_t _Objects_Name_to_string( if ( s != NULL ) { while ( *s != '\0' ) { if ( i < buffer_size ) { - *d = isprint((unsigned char) *s) ? *s : '*'; + *d = _Objects_Name_char_is_printable(*s) ? *s : '*'; ++d; } |