From 60ddf10266a0904b3c8131c9207a76972c6bb33a Mon Sep 17 00:00:00 2001 From: normal Date: Sun, 19 Nov 2017 05:03:22 +0000 Subject: 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 --- file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 96f59f2bc7..144f1f47a6 100644 --- a/file.c +++ b/file.c @@ -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); -- cgit v1.2.3