aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-19 05:03:22 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-19 05:03:22 +0000
commit60ddf10266a0904b3c8131c9207a76972c6bb33a (patch)
tree4154fe54ee3531561c6e47a3a16968ffd8820a35 /file.c
parent48a03987ca00d158dd30364ed7c1f9c537aaa9d2 (diff)
downloadruby-60ddf10266a0904b3c8131c9207a76972c6bb33a.tar.gz
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.c5
1 files changed, 3 insertions, 2 deletions
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);