From a1daeaba80570a673913f8184855219607a6f556 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 10 Jul 2015 11:56:06 -0700 Subject: Conform to C89/C90 variable declaration rules. While we are C99 in general, the Ruby build system for building C extensions enables several flags that throw warnings for C89/C90 variable ordering rules. To avoid spewing a million warnings (or trying to specifically override these warnings with command-line flags, which would be tricky and possibly fragile) we conform to Ruby's world of C89/C90. Change-Id: I0e03e62d95068dfdfde112df0fb16a248a2f32a0 --- ruby/ext/google/protobuf_c/protobuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ruby/ext/google/protobuf_c/protobuf.c') diff --git a/ruby/ext/google/protobuf_c/protobuf.c b/ruby/ext/google/protobuf_c/protobuf.c index d0625a10..32e3aea3 100644 --- a/ruby/ext/google/protobuf_c/protobuf.c +++ b/ruby/ext/google/protobuf_c/protobuf.c @@ -80,10 +80,11 @@ ID descriptor_instancevar_interned; // This must be named "Init_protobuf_c" because the Ruby module is named // "protobuf_c" -- the VM looks for this symbol in our .so. void Init_protobuf_c() { - descriptor_instancevar_interned = rb_intern(kDescriptorInstanceVar); VALUE google = rb_define_module("Google"); VALUE protobuf = rb_define_module_under(google, "Protobuf"); VALUE internal = rb_define_module_under(protobuf, "Internal"); + + descriptor_instancevar_interned = rb_intern(kDescriptorInstanceVar); DescriptorPool_register(protobuf); Descriptor_register(protobuf); FieldDescriptor_register(protobuf); -- cgit v1.2.3