Attached is a patch to protoc 2.5.0 java_message.cc that reduces one type 
of compilation warnings.

Could someone please perform a sanity check?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


--- java_message.cc	2013-03-21 12:46:33.000000000 -0700
+++ java_message.cc.orig	2013-02-26 09:56:40.000000000 -0800
@@ -1259,20 +1259,14 @@
 
   // Use builder bits to track mutable repeated fields.
   int totalBuilderBits = 0;
-  int numRepeatedFields = 0;
   for (int i = 0; i < descriptor_->field_count(); i++) {
-    const FieldDescriptor* dfield = descriptor_->field(i);
-    const FieldGenerator& field = field_generators_.get(dfield);
+    const FieldGenerator& field = field_generators_.get(descriptor_->field(i));
     totalBuilderBits += field.GetNumBitsForBuilder();
-    if (dfield->is_repeated())
-      numRepeatedFields++;
   }
-  if (numRepeatedFields /* > 0 */) {
-    int totalBuilderInts = (totalBuilderBits + 31) / 32;
-    for (int i = 0; i < totalBuilderInts; i++) {
-      printer->Print("int mutable_$bit_field_name$ = 0;\n",
-	"bit_field_name", GetBitFieldName(i));
-    }
+  int totalBuilderInts = (totalBuilderBits + 31) / 32;
+  for (int i = 0; i < totalBuilderInts; i++) {
+    printer->Print("int mutable_$bit_field_name$ = 0;\n",
+      "bit_field_name", GetBitFieldName(i));
   }
 
   if (HasUnknownFields(descriptor_)) {

Reply via email to