ruby-changes:24310
From: nobu <ko1@a...>
Date: Wed, 11 Jul 2012 12:18:44 +0900 (JST)
Subject: [ruby-changes:24310] nobu:r36361 (trunk): get rid of warnings
nobu 2012-07-11 12:17:35 +0900 (Wed, 11 Jul 2012) New Revision: 36361 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36361 Log: 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. Modified files: trunk/ext/openssl/ossl_pkey_ec.c trunk/ext/socket/raddrinfo.c trunk/ext/zlib/zlib.c trunk/io.c trunk/process.c Index: io.c =================================================================== --- io.c (revision 36360) +++ io.c (revision 36361) @@ -5015,14 +5015,14 @@ { 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; Index: process.c =================================================================== --- process.c (revision 36360) +++ process.c (revision 36361) @@ -645,7 +645,7 @@ result = wait4(arg->pid, arg->st, arg->flags, NULL); #endif - return (void *)result; + return (void *)(VALUE)result; } rb_pid_t @@ -659,8 +659,8 @@ 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 @@ } 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(); Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 36360) +++ ext/zlib/zlib.c (revision 36361) @@ -695,7 +695,7 @@ rb_protect((VALUE (*)(VALUE))zstream_expand_buffer, (VALUE)z, &state); - return (void *)state; + return (void *)(VALUE)state; } static int @@ -991,8 +991,8 @@ } 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 @@ } } - return (void *)err; + return (void *)(VALUE)err; } /* @@ -1050,9 +1050,8 @@ } 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) { Index: ext/openssl/ossl_pkey_ec.c =================================================================== --- ext/openssl/ossl_pkey_ec.c (revision 36360) +++ ext/openssl/ossl_pkey_ec.c (revision 36361) @@ -1509,7 +1509,7 @@ 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 @@ 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]); Index: ext/socket/raddrinfo.c =================================================================== --- ext/socket/raddrinfo.c (revision 36360) +++ ext/socket/raddrinfo.c (revision 36361) @@ -158,8 +158,8 @@ 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 @@ 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 @@ 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 @@ 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 } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/