summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-13 18:44:34 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-13 18:44:34 +0000
commita01ac84d2056ed4cb1899a7736c8636f1ec2c2c3 (patch)
tree15d9b723b3017a67f64650f6344ee89d17f3c6fd
parentb579fa077d0a89d2bafa2856c6fdae606cd044e7 (diff)
downloadruby-a01ac84d2056ed4cb1899a7736c8636f1ec2c2c3.tar.gz
ruby-a01ac84d2056ed4cb1899a7736c8636f1ec2c2c3.tar.xz
ruby-a01ac84d2056ed4cb1899a7736c8636f1ec2c2c3.zip
* file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
sizeof(void*). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c074c143e..92ea36d57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 14 03:38:54 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
+
+ * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
+ sizeof(void*).
+
Fri Jan 13 19:26:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/diagram.rb:
diff --git a/file.c b/file.c
index cc09a42cd..d3f7639dd 100644
--- a/file.c
+++ b/file.c
@@ -1681,7 +1681,7 @@ rb_file_ctime(VALUE obj)
static void
chmod_internal(const char *path, void *mode)
{
- if (chmod(path, (int)mode) < 0)
+ if (chmod(path, *(int *)mode) < 0)
rb_sys_fail(path);
}
@@ -1710,7 +1710,7 @@ rb_file_s_chmod(int argc, VALUE *argv)
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
- n = apply2files(chmod_internal, rest, (void *)(long)mode);
+ n = apply2files(chmod_internal, rest, &mode);
return LONG2FIX(n);
}