diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 05:03:22 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 05:03:22 +0000 |
commit | 3152d68bf3510b47d2bfb811cb1044e27872b5a9 (patch) | |
tree | 4154fe54ee3531561c6e47a3a16968ffd8820a35 /file.c | |
parent | 6b58fd54d819d6356bc51bba82baf9565fd11854 (diff) |
file.c: fix 64-bit conversion warnings from r60844
* file.c (nogvl_truncate): cast int to VALUE before "void *"
(rb_file_s_truncate): cast "void *" to VALUE before int
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4652,7 +4652,7 @@ nogvl_truncate(void *ptr) { struct truncate_arg *ta = ptr; #ifdef HAVE_TRUNCATE - return (void *)truncate(ta->path, ta->pos); + return (void *)(VALUE)truncate(ta->path, ta->pos); #else /* defined(HAVE_CHSIZE) */ { int tmpfd = rb_cloexec_open(ta->path, 0, 0); @@ -4698,7 +4698,8 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len) path = rb_str_encode_ospath(path); ta.path = StringValueCStr(path); - r = (int)rb_thread_call_without_gvl(nogvl_truncate, &ta, RUBY_UBF_IO, NULL); + r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_truncate, &ta, + RUBY_UBF_IO, NULL); if (r < 0) rb_sys_fail_path(path); return INT2FIX(0); |