summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-15 11:30:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-15 11:30:33 +0000
commita45936d454104b1d1e7ea663f1580339ce1f1071 (patch)
treec1b8157705cc773c790cad1ef7d37a2c47d3661c /file.c
parent8a0cd16de1b523fa80ec0e02ae7f114d28fa41b7 (diff)
* configure.in (dev_t): use RUBY_REPLACE_TYPE.
* file.c (rb_stat_inspect): use PRI_DEVT_PREFIX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/file.c b/file.c
index 33425faae1..fb748d91d5 100644
--- a/file.c
+++ b/file.c
@@ -316,14 +316,6 @@ rb_stat_cmp(VALUE self, VALUE other)
#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_stat_inspect(VALUE self)
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));