ruby-changes:17500
From: nobu <ko1@a...>
Date: Fri, 15 Oct 2010 20:33:12 +0900 (JST)
Subject: [ruby-changes:17500] Ruby:r29505 (trunk): * configure.in (dev_t): use RUBY_REPLACE_TYPE.
nobu 2010-10-15 20:30:33 +0900 (Fri, 15 Oct 2010) New Revision: 29505 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29505 Log: * configure.in (dev_t): use RUBY_REPLACE_TYPE. * file.c (rb_stat_inspect): use PRI_DEVT_PREFIX. Modified files: trunk/ChangeLog trunk/configure.in trunk/file.c Index: configure.in =================================================================== --- configure.in (revision 29504) +++ configure.in (revision 29505) @@ -576,7 +576,6 @@ RUBY_CHECK_SIZEOF(float) RUBY_CHECK_SIZEOF(double) RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>]) -RUBY_CHECK_SIZEOF(dev_t, [int long "long long"]) dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included] AC_DEFUN([RUBY_REPLACE_TYPE], [dnl @@ -625,6 +624,7 @@ RUBY_REPLACE_TYPE(uid_t, int, UIDT) RUBY_REPLACE_TYPE(gid_t, int, GIDT) RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>]) +RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT) AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes, [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], Index: ChangeLog =================================================================== --- ChangeLog (revision 29504) +++ ChangeLog (revision 29505) @@ -1,3 +1,9 @@ +Fri Oct 15 20:30:30 2010 Nobuyoshi Nakada <nobu@r...> + + * configure.in (dev_t): use RUBY_REPLACE_TYPE. + + * file.c (rb_stat_inspect): use PRI_DEVT_PREFIX. + Fri Oct 15 17:26:57 2010 NARUSE, Yui <naruse@r...> * pack.c (pack_pack): simplify comparison of explicit_endian Index: file.c =================================================================== --- file.c (revision 29504) +++ file.c (revision 29505) @@ -316,14 +316,6 @@ #define ST2UINT(val) ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1))) -#if SIZEOF_DEV_T > SIZEOF_LONG && defined(HAVE_LONG_LONG) -# define DEVT2NUM(v) ULL2NUM(v) -#elif SIZEOF_DEV_T == SIZEOF_LONG -# define DEVT2NUM(v) ULONG2NUM(v) -#else -# define DEVT2NUM(v) UINT2NUM(v) -#endif - /* * call-seq: * stat.dev -> fixnum @@ -779,10 +771,10 @@ rb_str_buf_cat2(str, "="); v = (*member[i].func)(self); if (i == 2) { /* mode */ - rb_str_catf(str, "0%lo", NUM2ULONG(v)); + rb_str_catf(str, "0%lo", (unsigned long)NUM2ULONG(v)); } else if (i == 0 || i == 6) { /* dev/rdev */ - rb_str_catf(str, "0x%lx", NUM2ULONG(v)); + rb_str_catf(str, "0x%"PRI_DEVT_PREFIX"x", NUM2DEVT(v)); } else { rb_str_append(str, rb_inspect(v)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/