Changeset b8774933 in rtems


Ignore:
Timestamp:
May 25, 2018, 12:12:22 PM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
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.