Comments (4)
Note that this applies to the generated code.
from protobuf-objc.
Can you provide an example of the trailing whitespace in the generated code?
from protobuf-objc.
The definition
message Demo {
optional string demo_field_1 = 1;
optional string demo_field_2 = 2;
optional string demo_field_3 = 3;
optional string demo_field_4 = 4;
optional string demo_field_5 = 5;
optional string demo_field_6 = 6;
}
results in the generated code:
- (BOOL) isEqual:(id)other {
if (other == self) {
return YES;
}
if (![other isKindOfClass:[Demo class]]) {
return NO;
}
Demo *otherMessage = other;
return
self.hasDemoField1 == otherMessage.hasDemoField1 &&
(!self.hasDemoField1 || [self.demoField1 isEqual:otherMessage.demoField1]) &&
self.hasDemoField2 == otherMessage.hasDemoField2 &&
(!self.hasDemoField2 || [self.demoField2 isEqual:otherMessage.demoField2]) &&
self.hasDemoField3 == otherMessage.hasDemoField3 &&
(!self.hasDemoField3 || [self.demoField3 isEqual:otherMessage.demoField3]) &&
self.hasDemoField4 == otherMessage.hasDemoField4 &&
(!self.hasDemoField4 || [self.demoField4 isEqual:otherMessage.demoField4]) &&
self.hasDemoField5 == otherMessage.hasDemoField5 &&
(!self.hasDemoField5 || [self.demoField5 isEqual:otherMessage.demoField5]) &&
self.hasDemoField6 == otherMessage.hasDemoField6 &&
(!self.hasDemoField6 || [self.demoField6 isEqual:otherMessage.demoField6]) &&
(self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
}
The trailing whitespace is on the otherwise empty lines in the return statement.
from protobuf-objc.
Just recompiled with these fixes and found one more case. Here's the patch to fix it:
diff --git a/src/compiler/objc_enum_field.cc b/src/compiler/objc_enum_field.cc
index b85be1b..5e29026 100644
--- a/src/compiler/objc_enum_field.cc
+++ b/src/compiler/objc_enum_field.cc
@@ -215,7 +215,7 @@ namespace google { namespace protobuf { namespace compiler { namespace objective
void EnumFieldGenerator::GenerateIsEqualCodeSource(io::Printer* printer) const {
printer->Print(variables_,
"self.has$capitalized_name$ == otherMessage.has$capitalized_name$ &&\n"
- "(!self.has$capitalized_name$ || self.$name$ != otherMessage.$name$) &&\n");
+ "(!self.has$capitalized_name$ || self.$name$ != otherMessage.$name$) &&");
}
from protobuf-objc.
Related Issues (20)
- Compiler warning on lines 542 and 549 of ConcreteExtensionField.m (in runtime project)
- Make error HOT 6
- Protobuf/objectivec/GPBWellKnownTypes.h:44:10: fatal error: 'google/protobuf/Any.pbobjc.h' file not found
- Protobuf metadata support? HOT 1
- Tag a version HOT 1
- ARC compatible code generation HOT 1
- easy way to modify a message object
- Repeated fields with primitive non Object types throw an exception when printing HOT 2
- CodedOutputStream.h declares two methods twice which causes compile warnings. HOT 1
- Configure issue HOT 6
- generated isEquals fails when a repeated object has no entries
- make command fails with error HOT 2
- objc_message_field.cc and objc_enum_field.cc generate code that leaks copied objects HOT 3
- Add installation instructions to README
- iOS InvalidProtocolBuffer, truncatedMessage HOT 2
- Unable to find License Information
- Services HOT 1
- writeRawByte method in PBCodedOutputStream HOT 1
- objc_primitive_field.cc generates code that leaks copied objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf-objc.