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
This commit is contained in:
parent
6b58fd54d8
commit
3152d68bf3
5
file.c
5
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user