Skip to content

Commit 845f9a1

Browse files
committed
Remove C99-ism for some platforms [ci skip]
Fix #11
1 parent 3ad41be commit 845f9a1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ext/io/wait/wait.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ io_ready_p(VALUE io)
146146
#endif
147147
}
148148

149-
// Ruby 3.2+ can define these methods. This macro indicates that case.
149+
/* Ruby 3.2+ can define these methods. This macro indicates that case. */
150150
#ifndef RUBY_IO_WAIT_METHODS
151151

152152
/*
@@ -351,18 +351,18 @@ io_wait(int argc, VALUE *argv, VALUE io)
351351
#else
352352
VALUE timeout = Qundef;
353353
rb_io_event_t events = 0;
354-
int return_io = 0;
354+
int i, return_io = 0;
355355

356-
// The documented signature for this method is actually incorrect.
357-
// A single timeout is allowed in any position, and multiple symbols can be given.
358-
// Whether this is intentional or not, I don't know, and as such I consider this to
359-
// be a legacy/slow path.
356+
/* The documented signature for this method is actually incorrect.
357+
* A single timeout is allowed in any position, and multiple symbols can be given.
358+
* Whether this is intentional or not, I don't know, and as such I consider this to
359+
* be a legacy/slow path. */
360360
if (argc != 2 || (RB_SYMBOL_P(argv[0]) || RB_SYMBOL_P(argv[1]))) {
361-
// We'd prefer to return the actual mask, but this form would return the io itself:
361+
/* We'd prefer to return the actual mask, but this form would return the io itself: */
362362
return_io = 1;
363363

364-
// Slow/messy path:
365-
for (int i = 0; i < argc; i += 1) {
364+
/* Slow/messy path: */
365+
for (i = 0; i < argc; i += 1) {
366366
if (RB_SYMBOL_P(argv[i])) {
367367
events |= wait_mode_sym(argv[i]);
368368
}
@@ -381,7 +381,7 @@ io_wait(int argc, VALUE *argv, VALUE io)
381381
}
382382
}
383383
else /* argc == 2 and neither are symbols */ {
384-
// This is the fast path:
384+
/* This is the fast path: */
385385
events = io_event_from_value(argv[0]);
386386
timeout = argv[1];
387387
}
@@ -391,9 +391,9 @@ io_wait(int argc, VALUE *argv, VALUE io)
391391
RB_IO_POINTER(io, fptr);
392392

393393
if (rb_io_read_pending(fptr)) {
394-
// This was the original behaviour:
394+
/* This was the original behaviour: */
395395
if (return_io) return Qtrue;
396-
// New behaviour always returns an event mask:
396+
/* New behaviour always returns an event mask: */
397397
else return RB_INT2NUM(RUBY_IO_READABLE);
398398
}
399399
}

0 commit comments

Comments
 (0)