Skip to content

Commit 57be41c

Browse files
authored
Merge pull request #151 from sue445/fix_typo
Fix typo
2 parents c523f75 + c6ba144 commit 57be41c

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

_tools/ruby_h_to_go/spec/ruby_h_to_go/function_definition_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
RubyHeaderParser::FunctionDefinition.new(
1010
name: "rb_define_method",
1111
definition: "void rb_define_method(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity)",
12-
typeref: typedef(type: "void"),
12+
typeref: typeref(type: "void"),
1313
args: [
1414
argument(type: "VALUE", name: "klass"),
1515
argument(type: "char", name: "mid", pointer: :ref),
@@ -44,7 +44,7 @@
4444
RubyHeaderParser::FunctionDefinition.new(
4545
name: "rb_block_call",
4646
definition: "VALUE rb_block_call(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t proc, VALUE data2)", # rubocop:disable Layout/LineLength
47-
typeref: typedef(type: "VALUE"),
47+
typeref: typeref(type: "VALUE"),
4848
args: [
4949
argument(type: "VALUE", name: "obj"),
5050
argument(type: "ID", name: "mid"),
@@ -81,7 +81,7 @@
8181
RubyHeaderParser::FunctionDefinition.new(
8282
name: "rb_funcallv",
8383
definition: "VALUE rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv)",
84-
typeref: typedef(type: "VALUE"),
84+
typeref: typeref(type: "VALUE"),
8585
args: [
8686
argument(type: "VALUE", name: "recv"),
8787
argument(type: "ID", name: "mid"),
@@ -114,7 +114,7 @@
114114
RubyHeaderParser::FunctionDefinition.new(
115115
name: "rb_thread_call_with_gvl",
116116
definition: "void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1)",
117-
typeref: typedef(type: "void", pointer: :ref),
117+
typeref: typeref(type: "void", pointer: :ref),
118118
args: [
119119
argument(type: "void", name: "arg1", pointer: :function),
120120
argument(type: "void", name: "data1", pointer: :ref),
@@ -145,7 +145,7 @@
145145
RubyHeaderParser::FunctionDefinition.new(
146146
name: "rb_uv_to_utf8",
147147
definition: "int rb_uv_to_utf8(char buf[6], unsigned long uv)",
148-
typeref: typedef(type: "int"),
148+
typeref: typeref(type: "int"),
149149
args: [
150150
argument(type: "char", name: "buf", pointer: :array, length: 6),
151151
argument(type: "unsigned long", name: "uv"),
@@ -176,7 +176,7 @@
176176
RubyHeaderParser::FunctionDefinition.new(
177177
name: "rb_errno_ptr",
178178
definition: "int *rb_errno_ptr(void)",
179-
typeref: typedef(type: "int", pointer: :ref),
179+
typeref: typeref(type: "int", pointer: :ref),
180180
args: [],
181181
)
182182
end
@@ -204,7 +204,7 @@
204204
RubyHeaderParser::FunctionDefinition.new(
205205
name: "rb_big2ll",
206206
definition: "rb_big2ll(VALUE)",
207-
typeref: typedef(type: "long long"),
207+
typeref: typeref(type: "long long"),
208208
args: [
209209
argument(type: "VALUE", name: "arg1"),
210210
],
@@ -234,7 +234,7 @@
234234
RubyHeaderParser::FunctionDefinition.new(
235235
name: "rb_big2ull",
236236
definition: "rb_big2ull(VALUE)",
237-
typeref: typedef(type: "unsigned long long"),
237+
typeref: typeref(type: "unsigned long long"),
238238
args: [
239239
argument(type: "VALUE", name: "arg1"),
240240
],
@@ -264,7 +264,7 @@
264264
RubyHeaderParser::FunctionDefinition.new(
265265
name: "rb_scan_args_set",
266266
definition: "rb_scan_args_set(int kw_flag, int argc, const VALUE *argv,",
267-
typeref: typedef(type: "int"),
267+
typeref: typeref(type: "int"),
268268
args: [
269269
argument(type: "int", name: "kw_flag"),
270270
argument(type: "int", name: "argc"),
@@ -310,7 +310,7 @@
310310
RubyHeaderParser::FunctionDefinition.new(
311311
name: "RSTRING_END",
312312
definition: "RSTRING_END(VALUE str)",
313-
typeref: typedef(type: "char", pointer: :ref),
313+
typeref: typeref(type: "char", pointer: :ref),
314314
args: [
315315
argument(type: "VALUE", name: "str"),
316316
],
@@ -340,7 +340,7 @@
340340
RubyHeaderParser::FunctionDefinition.new(
341341
name: "rb_const_list",
342342
definition: "VALUE rb_const_list(void*)",
343-
typeref: typedef(type: "VALUE"),
343+
typeref: typeref(type: "VALUE"),
344344
args: [
345345
argument(type: "void", name: "arg1", pointer: :ref),
346346
],
@@ -370,7 +370,7 @@
370370
RubyHeaderParser::FunctionDefinition.new(
371371
name: "rb_feature_provided",
372372
definition: "int rb_feature_provided(const char *feature, const char **loading)",
373-
typeref: typedef(type: "int"),
373+
typeref: typeref(type: "int"),
374374
args: [
375375
argument(type: "char", name: "feature", pointer: :ref),
376376
argument(type: "char", name: "loading", pointer: :sref, length: 2),
@@ -404,7 +404,7 @@
404404
RubyHeaderParser::FunctionDefinition.new(
405405
name: "rb_find_file_ext",
406406
definition: "int rb_find_file_ext(VALUE *feature, const char *const *exts)",
407-
typeref: typedef(type: "int"),
407+
typeref: typeref(type: "int"),
408408
args: [
409409
argument(type: "VALUE", name: "feature", pointer: :ref),
410410
argument(type: "char", name: "exts", pointer: :str_array),
@@ -440,7 +440,7 @@
440440
RubyHeaderParser::FunctionDefinition.new(
441441
name: "rb_data_typed_object_make",
442442
definition: "rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap, size_t size)",
443-
typeref: typedef(type: "VALUE"),
443+
typeref: typeref(type: "VALUE"),
444444
args: [
445445
argument(type: "VALUE", name: "klass"),
446446
argument(type: "rb_data_type_t", name: "type", pointer: :ref),
@@ -475,7 +475,7 @@
475475
RubyHeaderParser::FunctionDefinition.new(
476476
name: "rb_define_variable",
477477
definition: "void rb_define_variable(const char *name, VALUE *var)",
478-
typeref: typedef(type: "void"),
478+
typeref: typeref(type: "void"),
479479
args: [
480480
argument(type: "char", name: "name", pointer: :ref),
481481
argument(type: "VALUE", name: "var", pointer: :in_ref),
@@ -511,7 +511,7 @@
511511
RubyHeaderParser::FunctionDefinition.new(
512512
name:,
513513
definition: "",
514-
typeref: typedef(type: "void"),
514+
typeref: typeref(type: "void"),
515515
args: [],
516516
)
517517
end

_tools/ruby_h_to_go/spec/ruby_header_parser/parser_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
its(:name) { should eq "rb_define_method" }
2727
its(:definition) { should eq "void rb_define_method(VALUE klass, const char *mid, VALUE (*func)(), int arity)" }
28-
its(:typeref) { should eq typedef(type: "void") }
28+
its(:typeref) { should eq typeref(type: "void") }
2929
its(:args) { should eq args }
3030
end
3131

@@ -45,7 +45,7 @@
4545

4646
its(:name) { should eq "rb_block_call" }
4747
its(:definition) { should eq "VALUE rb_block_call(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t proc, VALUE data2)" } # rubocop:disable Layout/LineLength
48-
its(:typeref) { should eq typedef(type: "VALUE") }
48+
its(:typeref) { should eq typeref(type: "VALUE") }
4949
its(:args) { should eq args }
5050
end
5151

@@ -61,7 +61,7 @@
6161

6262
its(:name) { should eq "rb_uv_to_utf8" }
6363
its(:definition) { should eq "int rb_uv_to_utf8(char buf[6], unsigned long uv)" }
64-
its(:typeref) { should eq typedef(type: "int") }
64+
its(:typeref) { should eq typeref(type: "int") }
6565
its(:args) { should eq args }
6666
end
6767

@@ -79,7 +79,7 @@
7979

8080
its(:name) { should eq "rb_funcallv" }
8181
its(:definition) { should eq "VALUE rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv)" }
82-
its(:typeref) { should eq typedef(type: "VALUE") }
82+
its(:typeref) { should eq typeref(type: "VALUE") }
8383
its(:args) { should eq args }
8484
end
8585

@@ -95,7 +95,7 @@
9595

9696
its(:name) { should eq "rb_find_file_ext" }
9797
its(:definition) { should eq "int rb_find_file_ext(VALUE *feature, const char *const *exts)" }
98-
its(:typeref) { should eq typedef(type: "int") }
98+
its(:typeref) { should eq typeref(type: "int") }
9999
its(:args) { should eq args }
100100
end
101101

@@ -108,7 +108,7 @@
108108

109109
its(:name) { should eq "rb_errno_ptr" }
110110
its(:definition) { should eq "int *rb_errno_ptr(void)" }
111-
its(:typeref) { should eq typedef(type: "int", pointer: :ref) }
111+
its(:typeref) { should eq typeref(type: "int", pointer: :ref) }
112112
its(:args) { should eq args }
113113
end
114114

@@ -121,7 +121,7 @@
121121

122122
its(:name) { should eq "rb_block_proc" }
123123
its(:definition) { should eq "VALUE rb_block_proc(void)" }
124-
its(:typeref) { should eq typedef(type: "VALUE") }
124+
its(:typeref) { should eq typeref(type: "VALUE") }
125125
its(:args) { should eq args }
126126
end
127127

@@ -136,7 +136,7 @@
136136

137137
its(:name) { should eq "rb_big2ll" }
138138
its(:definition) { should include "rb_big2ll(VALUE)" }
139-
its(:typeref) { should eq typedef(type: "long long") }
139+
its(:typeref) { should eq typeref(type: "long long") }
140140
its(:args) { should eq args }
141141
end
142142

@@ -151,7 +151,7 @@
151151

152152
its(:name) { should eq "rb_big2ull" }
153153
its(:definition) { should include "rb_big2ull(VALUE)" }
154-
its(:typeref) { should eq typedef(type: "unsigned long long") }
154+
its(:typeref) { should eq typeref(type: "unsigned long long") }
155155
its(:args) { should eq args }
156156
end
157157

@@ -166,7 +166,7 @@
166166

167167
its(:name) { should eq "rb_const_list" }
168168
its(:definition) { should eq "VALUE rb_const_list(void*)" }
169-
its(:typeref) { should eq typedef(type: "VALUE") }
169+
its(:typeref) { should eq typeref(type: "VALUE") }
170170
its(:args) { should eq args }
171171
end
172172

@@ -182,7 +182,7 @@
182182

183183
its(:name) { should eq "rb_feature_provided" }
184184
its(:definition) { should eq "int rb_feature_provided(const char *feature, const char **loading)" }
185-
its(:typeref) { should eq typedef(type: "int") }
185+
its(:typeref) { should eq typeref(type: "int") }
186186
its(:args) { should eq args }
187187
end
188188

@@ -198,7 +198,7 @@
198198

199199
its(:name) { should eq "rb_define_variable" }
200200
its(:definition) { should eq "void rb_define_variable(const char *name, VALUE *var)" }
201-
its(:typeref) { should eq typedef(type: "void") }
201+
its(:typeref) { should eq typeref(type: "void") }
202202
its(:args) { should eq args }
203203
end
204204
end
@@ -224,7 +224,7 @@
224224

225225
its(:name) { should eq "rb_num2int_inline" }
226226
its(:definition) { should eq "rb_num2int_inline(VALUE x)" }
227-
its(:typeref) { should eq typedef(type: "int") }
227+
its(:typeref) { should eq typeref(type: "int") }
228228
its(:args) { should eq args }
229229
end
230230

@@ -239,7 +239,7 @@
239239

240240
its(:name) { should eq "rb_int2num_inline" }
241241
its(:definition) { should eq "rb_int2num_inline(int v)" }
242-
its(:typeref) { should eq typedef(type: "VALUE") }
242+
its(:typeref) { should eq typeref(type: "VALUE") }
243243
its(:args) { should eq args }
244244
end
245245

@@ -265,7 +265,7 @@
265265

266266
its(:name) { should eq "rb_scan_args_set" }
267267
its(:definition) { should eq "rb_scan_args_set(int kw_flag, int argc, const VALUE *argv," } # TODO: Fix this after
268-
its(:typeref) { should eq typedef(type: "int") }
268+
its(:typeref) { should eq typeref(type: "int") }
269269
its(:args) { should eq args }
270270
end
271271

@@ -280,7 +280,7 @@
280280

281281
its(:name) { should eq "RSTRING_END" }
282282
its(:definition) { should eq "RSTRING_END(VALUE str)" }
283-
its(:typeref) { should eq typedef(type: "char", pointer: :ref) }
283+
its(:typeref) { should eq typeref(type: "char", pointer: :ref) }
284284
its(:args) { should eq args }
285285
end
286286

@@ -298,7 +298,7 @@
298298

299299
its(:name) { should eq "rb_data_typed_object_make" }
300300
its(:definition) { should eq "rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap, size_t size)" }
301-
its(:typeref) { should eq typedef(type: "VALUE") }
301+
its(:typeref) { should eq typeref(type: "VALUE") }
302302
its(:args) { should eq args }
303303
end
304304
end

_tools/ruby_h_to_go/spec/support/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def argument(type:, name:, pointer: nil, length: 0)
55
RubyHeaderParser::ArgumentDefinition.new(type:, name:, pointer:, length:)
66
end
77

8-
def typedef(type:, pointer: nil)
8+
def typeref(type:, pointer: nil)
99
RubyHeaderParser::TyperefDefinition.new(type:, pointer:)
1010
end
1111
end

0 commit comments

Comments
 (0)