mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
get rid of warnings
* 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:
parent
11bde3ae11
commit
7bca2f031a
5 changed files with 23 additions and 24 deletions
|
@ -1509,7 +1509,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
|
||||||
|
|
||||||
Check_Type(bn_v1, T_ARRAY);
|
Check_Type(bn_v1, T_ARRAY);
|
||||||
bignums_len = RARRAY_LEN(bn_v1);
|
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) {
|
for (i = 0; i < bignums_len; ++i) {
|
||||||
bignums[i] = GetBNPtr(rb_ary_entry(bn_v1, 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);
|
rb_ary_unshift(points_v, self);
|
||||||
points_len = RARRAY_LEN(points_v);
|
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) {
|
for (i = 0; i < points_len; ++i) {
|
||||||
Get_EC_POINT(rb_ary_entry(points_v, i), points[i]);
|
Get_EC_POINT(rb_ary_entry(points_v, i), points[i]);
|
||||||
|
|
|
@ -158,7 +158,7 @@ static void *
|
||||||
nogvl_getaddrinfo(void *arg)
|
nogvl_getaddrinfo(void *arg)
|
||||||
{
|
{
|
||||||
struct getaddrinfo_arg *ptr = arg;
|
struct getaddrinfo_arg *ptr = arg;
|
||||||
return (void *)getaddrinfo(ptr->node, ptr->service,
|
return (void *)(VALUE)getaddrinfo(ptr->node, ptr->service,
|
||||||
ptr->hints, ptr->res);
|
ptr->hints, ptr->res);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,7 +178,7 @@ rb_getaddrinfo(const char *node, const char *service,
|
||||||
arg.service = service;
|
arg.service = service;
|
||||||
arg.hints = hints;
|
arg.hints = hints;
|
||||||
arg.res = res;
|
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;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ static void *
|
||||||
nogvl_getnameinfo(void *arg)
|
nogvl_getnameinfo(void *arg)
|
||||||
{
|
{
|
||||||
struct getnameinfo_arg *ptr = arg;
|
struct getnameinfo_arg *ptr = arg;
|
||||||
return (void *)getnameinfo(ptr->sa, ptr->salen,
|
return (void *)(VALUE)getnameinfo(ptr->sa, ptr->salen,
|
||||||
ptr->host, (socklen_t)ptr->hostlen,
|
ptr->host, (socklen_t)ptr->hostlen,
|
||||||
ptr->serv, (socklen_t)ptr->servlen,
|
ptr->serv, (socklen_t)ptr->servlen,
|
||||||
ptr->flags);
|
ptr->flags);
|
||||||
|
@ -223,7 +223,7 @@ rb_getnameinfo(const struct sockaddr *sa, socklen_t salen,
|
||||||
arg.serv = serv;
|
arg.serv = serv;
|
||||||
arg.servlen = servlen;
|
arg.servlen = servlen;
|
||||||
arg.flags = flags;
|
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;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -695,7 +695,7 @@ zstream_expand_buffer_protect(void *ptr)
|
||||||
|
|
||||||
rb_protect((VALUE (*)(VALUE))zstream_expand_buffer, (VALUE)z, &state);
|
rb_protect((VALUE (*)(VALUE))zstream_expand_buffer, (VALUE)z, &state);
|
||||||
|
|
||||||
return (void *)state;
|
return (void *)(VALUE)state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -991,7 +991,7 @@ zstream_run_func(void *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args->stream_output) {
|
if (args->stream_output) {
|
||||||
state = (int)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
|
state = (int)(VALUE)rb_thread_call_with_gvl(zstream_expand_buffer_protect,
|
||||||
(void *)z);
|
(void *)z);
|
||||||
} else {
|
} else {
|
||||||
state = zstream_expand_buffer_without_gvl(z);
|
state = zstream_expand_buffer_without_gvl(z);
|
||||||
|
@ -1004,7 +1004,7 @@ zstream_run_func(void *ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (void *)err;
|
return (void *)(VALUE)err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1050,8 +1050,7 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
|
||||||
}
|
}
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
err = (int)rb_thread_call_without_gvl(
|
err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
|
||||||
zstream_run_func, (void *)&args,
|
|
||||||
zstream_unblock_func, (void *)&args);
|
zstream_unblock_func, (void *)&args);
|
||||||
|
|
||||||
if (flush != Z_FINISH && err == Z_BUF_ERROR
|
if (flush != Z_FINISH && err == Z_BUF_ERROR
|
||||||
|
|
4
io.c
4
io.c
|
@ -5015,14 +5015,14 @@ sysopen_func(void *ptr)
|
||||||
{
|
{
|
||||||
const struct sysopen_struct *data = ptr;
|
const struct sysopen_struct *data = ptr;
|
||||||
const char *fname = RSTRING_PTR(data->fname);
|
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
|
static inline int
|
||||||
rb_sysopen_internal(struct sysopen_struct *data)
|
rb_sysopen_internal(struct sysopen_struct *data)
|
||||||
{
|
{
|
||||||
int fd;
|
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)
|
if (0 <= fd)
|
||||||
rb_update_max_fd(fd);
|
rb_update_max_fd(fd);
|
||||||
return fd;
|
return fd;
|
||||||
|
|
|
@ -645,7 +645,7 @@ rb_waitpid_blocking(void *data)
|
||||||
result = wait4(arg->pid, arg->st, arg->flags, NULL);
|
result = wait4(arg->pid, arg->st, arg->flags, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (void *)result;
|
return (void *)(VALUE)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_pid_t
|
rb_pid_t
|
||||||
|
@ -659,7 +659,7 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
|
||||||
arg.pid = pid;
|
arg.pid = pid;
|
||||||
arg.st = st;
|
arg.st = st;
|
||||||
arg.flags = flags;
|
arg.flags = flags;
|
||||||
result = (rb_pid_t)rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
|
result = (rb_pid_t)(VALUE)rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
|
||||||
RUBY_UBF_PROCESS, 0);
|
RUBY_UBF_PROCESS, 0);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
|
@ -692,7 +692,7 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
result = (rb_pid_t)rb_thread_blocking_region(rb_waitpid_blocking,
|
result = (rb_pid_t)(VALUE)rb_thread_blocking_region(rb_waitpid_blocking,
|
||||||
st, RUBY_UBF_PROCESS, 0);
|
st, RUBY_UBF_PROCESS, 0);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue