summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2023-05-04 19:11:07 +0200
committerGitHub <noreply@github.com>2023-05-04 19:11:07 +0200
commitc1e6a14476e210efeac79aa260c2eb2d1d98a580 (patch)
tree5eacd0a7fc1ec3b6b6eaec5a267acf46cbf52160
parent0d938c355f1737baa962fe5977e7ecb87f8b1945 (diff)
parent5ceefca1e14ffaa17dc3103ecd25160e1af189b7 (diff)
downloadffi-c1e6a14476e210efeac79aa260c2eb2d1d98a580.tar.gz
Merge pull request #1031 from larskanis/rm-structfield-get
Remove no longer used StructField.get and .put
-rw-r--r--ext/ffi_c/Struct.c10
-rw-r--r--ext/ffi_c/Struct.h3
2 files changed, 2 insertions, 11 deletions
diff --git a/ext/ffi_c/Struct.c b/ext/ffi_c/Struct.c
index 9eb10ec..3e4f8d1 100644
--- a/ext/ffi_c/Struct.c
+++ b/ext/ffi_c/Struct.c
@@ -356,10 +356,7 @@ struct_aref(VALUE self, VALUE fieldName)
s = struct_validate(self);
f = struct_field(s, fieldName);
- if (f->get != NULL) {
- return (*f->get)(f, s);
-
- } else if (f->memoryOp != NULL) {
+ if (f->memoryOp != NULL) {
return (*f->memoryOp->get)(s->pointer, f->offset);
} else {
@@ -385,10 +382,7 @@ struct_aset(VALUE self, VALUE fieldName, VALUE value)
s = struct_validate(self);
f = struct_field(s, fieldName);
- if (f->put != NULL) {
- (*f->put)(f, s, value);
-
- } else if (f->memoryOp != NULL) {
+ if (f->memoryOp != NULL) {
(*f->memoryOp->put)(s->pointer, f->offset, value);
diff --git a/ext/ffi_c/Struct.h b/ext/ffi_c/Struct.h
index 8e9491b..b86607d 100644
--- a/ext/ffi_c/Struct.h
+++ b/ext/ffi_c/Struct.h
@@ -59,9 +59,6 @@ extern "C" {
VALUE rbType;
VALUE rbName;
- VALUE (*get)(StructField* field, Struct* s);
- void (*put)(StructField* field, Struct* s, VALUE value);
-
MemoryOp* memoryOp;
};