Skip to content

Commit

Permalink
Clean warnings: ISO C90 forbids mixed declarations and code
Browse files Browse the repository at this point in the history
  • Loading branch information
nurse committed Aug 14, 2010
1 parent 4f9c595 commit 80c50e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
18 changes: 12 additions & 6 deletions optional/capi/ext/kernel_spec.c
Expand Up @@ -28,11 +28,13 @@ VALUE kernel_spec_rb_block_proc(VALUE self) {
#ifdef HAVE_RB_ENSURE
VALUE kernel_spec_rb_ensure(VALUE self, VALUE main_proc, VALUE arg,
VALUE ensure_proc, VALUE arg2) {
VALUE main_array = rb_ary_new();
VALUE main_array, ensure_array;

main_array = rb_ary_new();
rb_ary_push(main_array, main_proc);
rb_ary_push(main_array, arg);

VALUE ensure_array = rb_ary_new();
ensure_array = rb_ary_new();
rb_ary_push(ensure_array, ensure_proc);
rb_ary_push(ensure_array, arg2);

Expand Down Expand Up @@ -66,11 +68,13 @@ VALUE kernel_spec_rb_throw(VALUE self, VALUE result) {
#ifdef HAVE_RB_RESCUE
VALUE kernel_spec_rb_rescue(VALUE self, VALUE main_proc, VALUE arg,
VALUE raise_proc, VALUE arg2) {
VALUE main_array = rb_ary_new();
VALUE main_array, raise_array;

main_array = rb_ary_new();
rb_ary_push(main_array, main_proc);
rb_ary_push(main_array, arg);

VALUE raise_array = rb_ary_new();
raise_array = rb_ary_new();
rb_ary_push(raise_array, raise_proc);
rb_ary_push(raise_array, arg2);

Expand All @@ -81,11 +85,13 @@ VALUE kernel_spec_rb_rescue(VALUE self, VALUE main_proc, VALUE arg,

#ifdef HAVE_RB_RESCUE2
VALUE kernel_spec_rb_rescue2(int argc, VALUE *args, VALUE self) {
VALUE main_array = rb_ary_new();
VALUE main_array, raise_array;

main_array = rb_ary_new();
rb_ary_push(main_array, args[0]);
rb_ary_push(main_array, args[1]);

VALUE raise_array = rb_ary_new();
raise_array = rb_ary_new();
rb_ary_push(raise_array, args[2]);
rb_ary_push(raise_array, args[3]);

Expand Down
5 changes: 3 additions & 2 deletions optional/capi/ext/thread_spec.c
Expand Up @@ -49,13 +49,14 @@ static VALUE thread_spec_rb_thread_local_aset(VALUE self, VALUE thr, VALUE sym,
#ifdef HAVE_RB_THREAD_SELECT
static VALUE thread_spec_rb_thread_select_fd(VALUE self, VALUE fd_num, VALUE msec) {
int fd = NUM2INT(fd_num);
struct timeval tv = {0, NUM2INT(msec)};
int n;

fd_set read;
FD_ZERO(&read);
FD_SET(fd, &read);

struct timeval tv = {0, NUM2INT(msec)};
int n = rb_thread_select(fd + 1, &read, NULL, NULL, &tv);
n = rb_thread_select(fd + 1, &read, NULL, NULL, &tv);
if(n == 1 && FD_ISSET(fd, &read)) return Qtrue;
return Qfalse;
}
Expand Down

0 comments on commit 80c50e6

Please sign in to comment.