Changeset bd5a1386 in rtems


Ignore:
Timestamp:
Aug 13, 2012, 9:29:13 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
d9af2ed4
Parents:
25802b42
git-author:
Sebastian Huber <sebastian.huber@…> (08/13/12 09:29:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/20/12 08:10:25)
Message:

libcsupport: Add and use rtems_putc()

This reduces code size and provides a function similar to fputc().

Location:
cpukit
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/bspIo.h

    r25802b42 rbd5a1386  
    5454extern void printk(const char *fmt, ...);
    5555extern void putk(const char *s);
     56extern void rtems_putc(char c);
    5657
    5758/*
  • cpukit/libcsupport/Makefile.am

    r25802b42 rbd5a1386  
    121121libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c src/printk.c \
    122122    src/printk_plugin.c src/putk.c src/vprintk.c \
     123    src/rtems_putc.c \
    123124    src/printf_plugin.c \
    124125    src/sup_fs_location.c \
  • cpukit/libcsupport/src/vprintk.c

    r25802b42 rbd5a1386  
    5656
    5757    if (*fmt != '%') {
    58       BSP_output_char(*fmt);
     58      rtems_putc(*fmt);
    5959      continue;
    6060    }
     
    8181      /* need a cast here since va_arg() only takes fully promoted types */
    8282      char chr = (char) va_arg(ap, int);
    83       BSP_output_char(chr);
     83      rtems_putc(chr);
    8484      continue;
    8585    }
     
    101101      if ( !minus )
    102102        for ( i=len ; i<width ; i++ )
    103           BSP_output_char(' ');
     103          rtems_putc(' ');
    104104
    105105      /* no width option */
     
    110110      /* output the string */
    111111      for ( i=0 ; i<width && *str ; str++ )
    112         BSP_output_char(*str);
     112        rtems_putc(*str);
    113113
    114114      /* trailing spaces */
    115115      if ( minus )
    116116        for ( i=len ; i<width ; i++ )
    117           BSP_output_char(' ');
     117          rtems_putc(' ');
    118118
    119119      continue;
     
    133133      base = 16; sign = false; lflag = true;
    134134    } else {
    135       BSP_output_char(c);
     135      rtems_putc(c);
    136136      continue;
    137137    }
     
    167167
    168168  if ( sign && (num <  0) ) {
    169     BSP_output_char('-');
     169    rtems_putc('-');
    170170    unsigned_num = (unsigned long) -num;
    171171    if (maxwidth) maxwidth--;
     
    182182
    183183  for (n=maxwidth ; n > count; n-- )
    184     BSP_output_char(lead);
     184    rtems_putc(lead);
    185185
    186186  for (n = 0; n < count; n++) {
    187     BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);
     187    rtems_putc("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);
    188188  }
    189189}
Note: See TracChangeset for help on using the changeset viewer.