diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-07-10 11:56:06 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-07-10 12:05:14 -0700 |
commit | a1daeaba80570a673913f8184855219607a6f556 (patch) | |
tree | f82cd2e2da4584b9bb7ebdeefc4e355558dc9b81 /ruby/ext/google/protobuf_c/protobuf.c | |
parent | ab2094de11155ffa57e7d38a9b996dd038af981e (diff) | |
download | protobuf-a1daeaba80570a673913f8184855219607a6f556.tar.gz protobuf-a1daeaba80570a673913f8184855219607a6f556.tar.bz2 protobuf-a1daeaba80570a673913f8184855219607a6f556.zip |
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
Diffstat (limited to 'ruby/ext/google/protobuf_c/protobuf.c')
-rw-r--r-- | ruby/ext/google/protobuf_c/protobuf.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |