Ignore:
Timestamp:
05/25/18 12:12:22 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
dea4bbe3
Parents:
7d7c50de
git-author:
Sebastian Huber <sebastian.huber@…> (05/25/18 12:12:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/05/18 05:08:40)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/objectgetnameasstring.c

    r7d7c50de rb8774933  
    2222#include <rtems/score/threadimpl.h>
    2323
    24 #include <ctype.h>
     24/*
     25 * Do not use isprint() from <ctypes.h> since this depends on the heavy weight
     26 * C locale support of Newlib.
     27 */
     28static bool _Objects_Name_char_is_printable( char c )
     29{
     30  unsigned char uc;
     31
     32  uc = (unsigned char) c;
     33  return uc >= ' ' && uc <= '~';
     34}
    2535
    2636size_t _Objects_Name_to_string(
     
    5666    while ( *s != '\0' ) {
    5767      if ( i < buffer_size ) {
    58         *d = isprint((unsigned char) *s) ? *s : '*';
     68        *d = _Objects_Name_char_is_printable(*s) ? *s : '*';
    5969        ++d;
    6070      }
Note: See TracChangeset for help on using the changeset viewer.