Changeset 94107fa8 in rtems


Ignore:
Timestamp:
10/02/11 08:15:02 (11 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, 5, master
Children:
ff09991
Parents:
75e454c0
Message:

2011-10-02 Ralf Corsépius <ralf.corsepius@…>

  • libmisc/shell/main_time.c: Introduce PRIdtime_t.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r75e454c0 r94107fa8  
     12011-10-02      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libmisc/shell/main_time.c: Introduce PRIdtime_t.
     4
    152011-10-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    26
  • cpukit/libmisc/shell/main_time.c

    r75e454c0 r94107fa8  
    1818#include <unistd.h>
    1919#include <string.h>
     20#include <inttypes.h>
    2021#include <errno.h>
    2122#include <sys/types.h>
     
    2526#include <rtems/shell.h>
    2627#include "internal.h"
     28
     29/* Helper macro to print "time_t" */
     30#if SIZEOF_TIME_T == 8
     31#define PRIdtime_t PRId64
     32#elif SIZEOF_TIME_T == 4
     33#define PRIdtime_t PRId32
     34#else
     35#error "PRIdtime_t: unsupported size of time_t"
     36#endif
    2737
    2838int rtems_shell_main_time(
     
    6777  }
    6878
    69   printf("time: %li:%02li:%02li.%03li\n",
     79  printf("time: %" PRIdtime_t ":%02" PRIdtime_t ":%02" PRIdtime_t ".%03li\n",
    7080         period.tv_sec / 3600,
    7181         period.tv_sec / 60, period.tv_sec % 60,
Note: See TracChangeset for help on using the changeset viewer.