* io.c (sysopen_func, rb_sysopen_internal): cast through VALUE to get
  rid of warnings.  fixup of r36355.
* process.c (rb_waitpid_blocking, rb_waitpid): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-11 03:17:35 +00:00
Родитель 11bde3ae11
Коммит 7bca2f031a
5 изменённых файлов: 23 добавлений и 24 удалений

Просмотреть файл

@ -1509,7 +1509,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
Check_Type(bn_v1, T_ARRAY);
bignums_len = RARRAY_LEN(bn_v1);
bignums = (const BIGNUM **)OPENSSL_malloc(bignums_len * sizeof(BIGNUM *));
bignums = (const BIGNUM **)OPENSSL_malloc(bignums_len * (int)sizeof(BIGNUM *));
for (i = 0; i < bignums_len; ++i) {
bignums[i] = GetBNPtr(rb_ary_entry(bn_v1, i));
@ -1522,7 +1522,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
rb_ary_unshift(points_v, self);
points_len = RARRAY_LEN(points_v);
points = (const EC_POINT **)OPENSSL_malloc(points_len * sizeof(EC_POINT *));
points = (const EC_POINT **)OPENSSL_malloc(points_len * (int)sizeof(EC_POINT *));
for (i = 0; i < points_len; ++i) {
Get_EC_POINT(rb_ary_entry(points_v, i), points[i]);

Просмотреть файл

@ -158,8 +158,8 @@ static void *
nogvl_getaddrinfo(void *arg)
{
struct getaddrinfo_arg *ptr = arg;
return (void *)getaddrinfo(ptr->node, ptr->service,
ptr->hints, ptr->res);
return (void *)(VALUE)getaddrinfo(ptr->node, ptr->service,
ptr->hints, ptr->res);
}
#endif
@ -178,7 +178,7 @@ rb_getaddrinfo(const char *node, const char *service,
arg.service = service;
arg.hints = hints;
arg.res = res;
ret = (int)rb_thread_call_without_gvl(nogvl_getaddrinfo, &arg, RUBY_UBF_IO, 0);
ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getaddrinfo, &arg, RUBY_UBF_IO, 0);
return ret;
#endif
}
@ -199,10 +199,10 @@ static void *
nogvl_getnameinfo(void *arg)
{
struct getnameinfo_arg *ptr = arg;
return (void *)getnameinfo(ptr->sa, ptr->salen,
ptr->host, (socklen_t)ptr->hostlen,
ptr->serv, (socklen_t)ptr->servlen,
ptr->flags);
return (void *)(VALUE)getnameinfo(ptr->sa, ptr->salen,
ptr->host, (socklen_t)ptr->hostlen,
ptr->serv, (socklen_t)ptr->servlen,
ptr->flags);
}
#endif
@ -223,7 +223,7 @@ rb_getnameinfo(const struct sockaddr *sa, socklen_t salen,
arg.serv = serv;
arg.servlen = servlen;
arg.flags = flags;
ret = (int)rb_thread_call_without_gvl(nogvl_getnameinfo, &arg, RUBY_UBF_IO, 0);
ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getnameinfo, &arg, RUBY_UBF_IO, 0);
return ret;
#endif
}

Просмотреть файл

@ -695,7 +695,7 @@ zstream_expand_buffer_protect(void *ptr)
rb_protect((VALUE (*)(VALUE))zstream_expand_buffer, (VALUE)z, &state);
return (void *)state;
return (void *)(VALUE)state;
}
static int
@ -991,8 +991,8 @@ zstream_run_func(void *ptr)
}
if (args->stream_output) {
state = (int)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
(void *)z);
state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
(void *)z);
} else {
state = zstream_expand_buffer_without_gvl(z);
}
@ -1004,7 +1004,7 @@ zstream_run_func(void *ptr)
}
}
return (void *)err;
return (void *)(VALUE)err;
}
/*
@ -1050,9 +1050,8 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
}
loop:
err = (int)rb_thread_call_without_gvl(
zstream_run_func, (void *)&args,
zstream_unblock_func, (void *)&args);
err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
zstream_unblock_func, (void *)&args);
if (flush != Z_FINISH && err == Z_BUF_ERROR
&& z->stream.avail_out > 0) {

4
io.c
Просмотреть файл

@ -5015,14 +5015,14 @@ sysopen_func(void *ptr)
{
const struct sysopen_struct *data = ptr;
const char *fname = RSTRING_PTR(data->fname);
return (void *)rb_cloexec_open(fname, data->oflags, data->perm);
return (void *)(VALUE)rb_cloexec_open(fname, data->oflags, data->perm);
}
static inline int
rb_sysopen_internal(struct sysopen_struct *data)
{
int fd;
fd = (int)rb_thread_call_without_gvl(sysopen_func, data, RUBY_UBF_IO, 0);
fd = (int)(VALUE)rb_thread_call_without_gvl(sysopen_func, data, RUBY_UBF_IO, 0);
if (0 <= fd)
rb_update_max_fd(fd);
return fd;

Просмотреть файл

@ -645,7 +645,7 @@ rb_waitpid_blocking(void *data)
result = wait4(arg->pid, arg->st, arg->flags, NULL);
#endif
return (void *)result;
return (void *)(VALUE)result;
}
rb_pid_t
@ -659,8 +659,8 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
arg.pid = pid;
arg.st = st;
arg.flags = flags;
result = (rb_pid_t)rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
RUBY_UBF_PROCESS, 0);
result = (rb_pid_t)(VALUE)rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
RUBY_UBF_PROCESS, 0);
if (result < 0) {
if (errno == EINTR) {
RUBY_VM_CHECK_INTS();
@ -692,8 +692,8 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
}
for (;;) {
result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking,
st, RUBY_UBF_PROCESS, 0);
result = (rb_pid_t)(VALUE)rb_thread_blocking_region(rb_waitpid_blocking,
st, RUBY_UBF_PROCESS, 0);
if (result < 0) {
if (errno == EINTR) {
rb_thread_schedule();