change log for rtems (2011-10-02)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Oct 2 09:12:15 UTC 2011


 *ralf*:
2011-10-02	Ralf Corsépius <ralf.corsepius at rtems.org>

	* libmisc/shell/main_time.c: Introduce PRIdtime_t.

M 1.2932  cpukit/ChangeLog
M    1.3  cpukit/libmisc/shell/main_time.c

diff -u rtems/cpukit/ChangeLog:1.2931 rtems/cpukit/ChangeLog:1.2932
--- rtems/cpukit/ChangeLog:1.2931	Sun Oct  2 00:23:45 2011
+++ rtems/cpukit/ChangeLog	Sun Oct  2 03:15:01 2011
@@ -1,5 +1,9 @@
 2011-10-02	Ralf Corsépius <ralf.corsepius at rtems.org>
 
+	* libmisc/shell/main_time.c: Introduce PRIdtime_t.
+
+2011-10-02	Ralf Corsépius <ralf.corsepius at rtems.org>
+
 	* libnetworking/libc/res_comp.c: Eliminate unused var "ppch".
 
 2011-09-30	Ralf Corsépius <ralf.corsepius at rtems.org>

diff -u rtems/cpukit/libmisc/shell/main_time.c:1.2 rtems/cpukit/libmisc/shell/main_time.c:1.3
--- rtems/cpukit/libmisc/shell/main_time.c:1.2	Sun Nov 29 06:12:39 2009
+++ rtems/cpukit/libmisc/shell/main_time.c	Sun Oct  2 03:15:02 2011
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
+#include <inttypes.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -25,6 +26,15 @@
 #include <rtems/shell.h>
 #include "internal.h"
 
+/* Helper macro to print "time_t" */
+#if SIZEOF_TIME_T == 8
+#define PRIdtime_t PRId64
+#elif SIZEOF_TIME_T == 4
+#define PRIdtime_t PRId32
+#else
+#error "PRIdtime_t: unsupported size of time_t"
+#endif
+
 int rtems_shell_main_time(
   int   argc,
   char *argv[]
@@ -66,7 +76,7 @@
     period.tv_nsec += 1000000000UL;
   }
 
-  printf("time: %li:%02li:%02li.%03li\n",
+  printf("time: %" PRIdtime_t ":%02" PRIdtime_t ":%02" PRIdtime_t ".%03li\n",
          period.tv_sec / 3600,
          period.tv_sec / 60, period.tv_sec % 60,
          period.tv_nsec / 1000000);



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20111002/c975ecd8/attachment-0001.html>


More information about the vc mailing list