Skip to content

Commit d44ef9c

Browse files
committed
Declare methods as static
1 parent 878515f commit d44ef9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ext/rapidjson/cext.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ using namespace rapidjson;
1818

1919
typedef RubyStringBuffer DefaultBuffer;
2020

21-
VALUE encode(VALUE _self, VALUE obj) {
21+
static VALUE
22+
encode(VALUE _self, VALUE obj) {
2223
RubyObjectEncoder<DefaultBuffer, Writer<DefaultBuffer> > encoder;
2324
return encoder.encode(obj);
2425
}
2526

26-
VALUE pretty_encode(VALUE _self, VALUE obj) {
27+
static VALUE
28+
pretty_encode(VALUE _self, VALUE obj) {
2729
RubyObjectEncoder<DefaultBuffer, PrettyWriter<DefaultBuffer> > encoder;
2830
return encoder.encode(obj);
2931
}
3032

31-
VALUE parse(VALUE _self, VALUE string) {
33+
static VALUE
34+
parse(VALUE _self, VALUE string) {
3235
RubyObjectHandler handler;
3336
Reader reader;
3437
char *cstring = StringValueCStr(string); // fixme?
@@ -43,7 +46,8 @@ VALUE parse(VALUE _self, VALUE string) {
4346
return handler.GetRoot();
4447
}
4548

46-
VALUE valid_json_p(VALUE _self, VALUE string) {
49+
static VALUE
50+
valid_json_p(VALUE _self, VALUE string) {
4751
NullHandler handler;
4852
Reader reader;
4953
char *cstring = StringValueCStr(string); // fixme?

0 commit comments

Comments
 (0)