summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/ext/data_spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/ext/data_spec.c')
-rw-r--r--spec/ruby/optional/capi/ext/data_spec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/ruby/optional/capi/ext/data_spec.c b/spec/ruby/optional/capi/ext/data_spec.c
index 52adeee59f..ac6b51b454 100644
--- a/spec/ruby/optional/capi/ext/data_spec.c
+++ b/spec/ruby/optional/capi/ext/data_spec.c
@@ -20,7 +20,7 @@ void sample_wrapped_struct_mark(void* st) {
}
VALUE sdaf_alloc_func(VALUE klass) {
- struct sample_wrapped_struct* bar = (struct sample_wrapped_struct *)malloc(sizeof(struct sample_wrapped_struct));
+ struct sample_wrapped_struct* bar = malloc(sizeof(struct sample_wrapped_struct));
bar->foo = 42;
return Data_Wrap_Struct(klass, &sample_wrapped_struct_mark, &sample_wrapped_struct_free, bar);
}
@@ -33,7 +33,7 @@ VALUE sdaf_get_struct(VALUE self) {
}
VALUE sws_wrap_struct(VALUE self, VALUE val) {
- struct sample_wrapped_struct* bar = (struct sample_wrapped_struct *)malloc(sizeof(struct sample_wrapped_struct));
+ struct sample_wrapped_struct* bar = malloc(sizeof(struct sample_wrapped_struct));
bar->foo = FIX2INT(val);
return Data_Wrap_Struct(rb_cObject, &sample_wrapped_struct_mark, &sample_wrapped_struct_free, bar);
}
@@ -59,7 +59,7 @@ VALUE sws_get_struct_data_ptr(VALUE self, VALUE obj) {
VALUE sws_change_struct(VALUE self, VALUE obj, VALUE new_val) {
struct sample_wrapped_struct *old_struct, *new_struct;
- new_struct = (struct sample_wrapped_struct *)malloc(sizeof(struct sample_wrapped_struct));
+ new_struct = malloc(sizeof(struct sample_wrapped_struct));
new_struct->foo = FIX2INT(new_val);
old_struct = RDATA(obj)->data;
free(old_struct);