Skip to content

Commit

Permalink
Fix compiler warnings raised by ruby-2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Oct 10, 2019
1 parent 753d522 commit 8bcf60b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions ext/ffi_c/Call.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ call_blocking_function(void* data)
}

VALUE
rbffi_do_blocking_call(void *data)
rbffi_do_blocking_call(VALUE data)
{
rb_thread_call_without_gvl(call_blocking_function, data, (void *) -1, NULL);
rb_thread_call_without_gvl(call_blocking_function, (void*)data, (void *) -1, NULL);

return Qnil;
}

VALUE
rbffi_save_frame_exception(void *data, VALUE exc)
rbffi_save_frame_exception(VALUE data, VALUE exc)
{
rbffi_frame_t* frame = (rbffi_frame_t *) data;
frame->exc = exc;
Expand Down
4 changes: 2 additions & 2 deletions ext/ffi_c/Call.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ typedef struct rbffi_blocking_call {
void* params;
} rbffi_blocking_call_t;

VALUE rbffi_do_blocking_call(void* data);
VALUE rbffi_save_frame_exception(void *data, VALUE exc);
VALUE rbffi_do_blocking_call(VALUE data);
VALUE rbffi_save_frame_exception(VALUE data, VALUE exc);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions ext/ffi_c/Function.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ static VALUE function_init(VALUE self, VALUE rbFunctionInfo, VALUE rbProc);
static void callback_invoke(ffi_cif* cif, void* retval, void** parameters, void* user_data);
static bool callback_prep(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize);
static void* callback_with_gvl(void* data);
static VALUE invoke_callback(void* data);
static VALUE save_callback_exception(void* data, VALUE exc);
static VALUE invoke_callback(VALUE data);
static VALUE save_callback_exception(VALUE data, VALUE exc);

#define DEFER_ASYNC_CALLBACK 1

Expand Down Expand Up @@ -658,7 +658,7 @@ callback_with_gvl(void* data)
}

static VALUE
invoke_callback(void* data)
invoke_callback(VALUE data)
{
struct gvl_callback* cb = (struct gvl_callback *) data;

Expand Down Expand Up @@ -848,7 +848,7 @@ invoke_callback(void* data)
}

static VALUE
save_callback_exception(void* data, VALUE exc)
save_callback_exception(VALUE data, VALUE exc)
{
struct gvl_callback* cb = (struct gvl_callback *) data;

Expand Down
14 changes: 7 additions & 7 deletions ext/ffi_c/LongDouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

static VALUE rb_cBigDecimal = Qnil;
static VALUE bigdecimal_load(VALUE unused);
static VALUE bigdecimal_failed(VALUE value);
static VALUE bigdecimal_failed(VALUE value, VALUE exc);

VALUE
VALUE
rbffi_longdouble_new(long double ld)
{
if (!RTEST(rb_cBigDecimal)) {
Expand All @@ -28,13 +28,13 @@ rbffi_longdouble_new(long double ld)
return rb_float_new(ld);
}

long double
long double
rbffi_num2longdouble(VALUE value)
{
if (TYPE(value) == T_FLOAT) {
return rb_num2dbl(value);
}

if (!RTEST(rb_cBigDecimal) && rb_const_defined(rb_cObject, rb_intern("BigDecimal"))) {
rb_cBigDecimal = rb_const_get(rb_cObject, rb_intern("BigDecimal"));
}
Expand All @@ -49,15 +49,15 @@ rbffi_num2longdouble(VALUE value)
}


static VALUE
static VALUE
bigdecimal_load(VALUE unused)
{
rb_require("bigdecimal");
return rb_const_get(rb_cObject, rb_intern("BigDecimal"));
}

static VALUE
bigdecimal_failed(VALUE value)
static VALUE
bigdecimal_failed(VALUE value, VALUE exc)
{
return value;
}

0 comments on commit 8bcf60b

Please sign in to comment.