Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up C# code #544

Merged
merged 3 commits into from Jun 28, 2015
Merged

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Jun 25, 2015

This is relative to pull request #543, which should be merged first.

@jtattermusch @anandolee

@@ -408,9 +405,10 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
"}\n\n");

// GetHashCode
// Start with a non-zero value to easily distinguish between null and "empty" messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 is more used for non-zero value. Better to explain a little why use 17 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to use 1 if that's more common in your experience. I think it makes sense to use a different "empty" hash code for "message", "repeated field" and "map field" though - are 1, 2, 3 fine for you?

(Note that this PR depends on the map PR, so it may be worth reviewing that first.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is fine. Just add comments to explain it

@anandolee
Copy link
Contributor

Implementation LGTM. A few comments for the tests

ProtoDump isn't currently useful, but will be when ToString emits JSON: fixed.
ProtoBench: deleted; we should reinstate when there's a common proto3 benchmark.
ProtoMunge: delete; not useful enough to merit fixing up.

Removed the [TestFixture] from ByteStringTest as Travis uses a recent enough version of NUnit.
- Remove some old proto2-based C#-only messages
- Remove the "build" directory which only contained out-of-date files
- Remove the csharp_namespace option from proto2 messages
- Change "Google.ProtocolBuffers" to "Google.Protobuf" in other messages
@jskeet
Copy link
Contributor Author

jskeet commented Jun 27, 2015

Okay, this is ready for merge now, if you're happy with it, @anandolee.
Most of the changes are either just deleting files entirely, or removing the csharp_namespace option from .proto files. The actual code changes are around removing extension support from the descriptor classes.

@anandolee
Copy link
Contributor

yes, LGTM

jskeet added a commit that referenced this pull request Jun 28, 2015
@jskeet jskeet merged commit b08b6bf into protocolbuffers:csharp-experimental Jun 28, 2015
@jskeet jskeet deleted the csharp-cleanup branch June 29, 2015 19:48
@jtattermusch
Copy link
Contributor

LGTM (ex-post)

taoso pushed a commit to taoso/protobuf that referenced this pull request Aug 1, 2018
When --go_out=paths=source_relative:., output filenames are always
derived from the input filenames. For example, the output file
for a/b/c.proto will always be a/b/c.pb.go, regardless of the
presence or absence of a go_package option in the input file.

Fixes protocolbuffers#515.
adellahlou pushed a commit to adellahlou/protobuf that referenced this pull request Apr 20, 2023
rinarakaki pushed a commit to rinarakaki/protobuf that referenced this pull request Aug 30, 2023
Put map entries into unknown fields when unknown enum values are encountered
bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
Put map entries into unknown fields when unknown enum values are encountered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants