1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=

sizeof(void*).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2006-01-13 18:44:34 +00:00
parent eb24aaf576
commit 4678e9340a
2 changed files with 7 additions and 2 deletions

View file

@ -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> Fri Jan 13 19:26:15 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/diagram.rb: * lib/rdoc/diagram.rb:

4
file.c
View file

@ -1681,7 +1681,7 @@ rb_file_ctime(VALUE obj)
static void static void
chmod_internal(const char *path, void *mode) chmod_internal(const char *path, void *mode)
{ {
if (chmod(path, (int)mode) < 0) if (chmod(path, *(int *)mode) < 0)
rb_sys_fail(path); rb_sys_fail(path);
} }
@ -1710,7 +1710,7 @@ rb_file_s_chmod(int argc, VALUE *argv)
rb_scan_args(argc, argv, "1*", &vmode, &rest); rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode); mode = NUM2INT(vmode);
n = apply2files(chmod_internal, rest, (void *)(long)mode); n = apply2files(chmod_internal, rest, &mode);
return LONG2FIX(n); return LONG2FIX(n);
} }