* [ANN] kgio 2.9.0 - cleanups, bug fixes, minor improvements
@ 2014-02-04 3:12 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2014-02-04 3:12 UTC (permalink / raw)
To: kgio
Changes:
This adds a new kgio_syssend method for Ruby 1.9+ which behaves
like BasicSocket#send, but will not raise exceptions on EAGAIN.
Eric Wong (12):
test_poll: remove race prone test_poll_EINTR_changed test
tryopen: remove RARRAY_PTR usage in init
read_write: remove the rest of RARRAY_PTR usage
my_writev: stylistic fixes
Rakefile: kill raa_update task
avoid downsizing casts
connect: constify RSTRING-related things
set RSTRING_MODIFIED where appropriate for Rubinius
split read_write.c into {read,write,writev}.c
add kgio_syssend method to wrap send(2)
write: correct check for various blocking regions
tryopen: additional debug information for bad Errno values
Hleb Valoshka (1):
Don't use deprecated api
* http://bogomips.org/kgio/
* kgio@librelist.org
* git://bogomips.org/kgio.git
* http://bogomips.org/kgio/NEWS.atom.xml
--
Eric Wong
^ permalink raw reply [relevance 7%]
* [PATCH] avoid downsizing casts
@ 2014-01-20 21:23 6% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2014-01-20 21:23 UTC (permalink / raw)
To: kgio
It's always safe to cast a 32-bit value to a 64-bit value, but
compilers can warn going the other way (because VALUE is a pointer).
Tested with `ruby -v`
ruby 2.2.0dev (2014-01-19 trunk 44646) [x86_64-linux]
which enables -Wpointer-to-int-cast
---
pushed as 809b9716a2593c0bfcaa115e7e560615c6357b55
ext/kgio/poll.c | 4 ++--
ext/kgio/tryopen.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ext/kgio/poll.c b/ext/kgio/poll.c
index 15774d8..ae8d235 100644
--- a/ext/kgio/poll.c
+++ b/ext/kgio/poll.c
@@ -139,13 +139,13 @@ static VALUE poll_result(int nr, struct poll_args *a)
static VALUE do_poll(VALUE args)
{
struct poll_args *a = (struct poll_args *)args;
- int nr;
+ long nr;
Check_Type(a->ios, T_HASH);
retry:
hash2pollfds(a);
- nr = (int)rb_thread_blocking_region(nogvl_poll, a, RUBY_UBF_IO, NULL);
+ nr = (long)rb_thread_blocking_region(nogvl_poll, a, RUBY_UBF_IO, NULL);
if (nr < 0) {
if (interrupted()) {
if (retryable(a)) {
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c
index 1d8fffd..5889294 100644
--- a/ext/kgio/tryopen.c
+++ b/ext/kgio/tryopen.c
@@ -81,7 +81,7 @@ static VALUE my_thread_blocking_region(
*/
static VALUE s_tryopen(int argc, VALUE *argv, VALUE klass)
{
- int fd;
+ long fd;
VALUE pathname, flags, mode;
struct open_args o;
int retried = 0;
@@ -106,7 +106,7 @@ static VALUE s_tryopen(int argc, VALUE *argv, VALUE klass)
}
retry:
- fd = (int)rb_thread_blocking_region(nogvl_open, &o, RUBY_UBF_IO, 0);
+ fd = (long)rb_thread_blocking_region(nogvl_open, &o, RUBY_UBF_IO, 0);
if (fd < 0) {
if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) {
rb_gc();
@@ -125,7 +125,7 @@ retry:
return rv;
}
}
- rv = rb_funcall(klass, id_for_fd, 1, INT2FIX(fd));
+ rv = rb_funcall(klass, id_for_fd, 1, LONG2FIX(fd));
set_file_path(rv, pathname);
return rv;
}
--
Eric Wong
^ permalink raw reply related [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-01-20 21:23 6% [PATCH] avoid downsizing casts Eric Wong
2014-02-04 3:12 7% [ANN] kgio 2.9.0 - cleanups, bug fixes, minor improvements Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/kgio.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).